[CLASSES]: Move cu__create_new_enumeration to before cu__process_function

Will be used by cu__process_function, no code changed.

Signed-off-by: Arnaldo Carvalho de Melo <acme@mandriva.com>
This commit is contained in:
Arnaldo Carvalho de Melo 2007-01-06 14:01:09 -02:00
parent 136f3786de
commit 0b930b1ce8
1 changed files with 34 additions and 34 deletions

View File

@ -2008,6 +2008,40 @@ static void cu__create_new_inline_expansion(struct cu *cu, Dwarf_Die *die,
lexblock__add_inline_expansion(lexblock, exp);
}
static void cu__create_new_enumeration(Dwarf_Die *die, struct cu *cu)
{
Dwarf_Die child;
struct class *enumeration = class__new(die);
if (enumeration == NULL)
oom("class__new");
if (!dwarf_haschildren(die) || dwarf_child(die, &child) != 0) {
fprintf(stderr, "%s: DW_TAG_enumeration_type with no "
"children!\n", __FUNCTION__);
return;
}
die = &child;
do {
struct enumerator *enumerator;
const uint16_t tag = dwarf_tag(die);
if (tag != DW_TAG_enumerator) {
fprintf(stderr, "%s: DW_TAG_%s not handled!\n",
__FUNCTION__, dwarf_tag_name(tag));
continue;
}
enumerator = enumerator__new(die);
if (enumerator == NULL)
oom("enumerator__new");
enumeration__add(enumeration, enumerator);
} while (dwarf_siblingof(die, die) == 0);
cu__add_tag(cu, &enumeration->tag);
}
static void cu__process_function(Dwarf_Die *die,
struct cu *cu, struct ftype *ftype,
struct lexblock *lexblock)
@ -2070,40 +2104,6 @@ static void cu__create_new_function(Dwarf_Die *die, struct cu *cu)
cu__add_function(cu, function);
}
static void cu__create_new_enumeration(Dwarf_Die *die, struct cu *cu)
{
Dwarf_Die child;
struct class *enumeration = class__new(die);
if (enumeration == NULL)
oom("class__new");
if (!dwarf_haschildren(die) || dwarf_child(die, &child) != 0) {
fprintf(stderr, "%s: DW_TAG_enumeration_type with no "
"children!\n", __FUNCTION__);
return;
}
die = &child;
do {
struct enumerator *enumerator;
const uint16_t tag = dwarf_tag(die);
if (tag != DW_TAG_enumerator) {
fprintf(stderr, "%s: DW_TAG_%s not handled!\n",
__FUNCTION__, dwarf_tag_name(tag));
continue;
}
enumerator = enumerator__new(die);
if (enumerator == NULL)
oom("enumerator__new");
enumeration__add(enumeration, enumerator);
} while (dwarf_siblingof(die, die) == 0);
cu__add_tag(cu, &enumeration->tag);
}
static void cu__process_die(Dwarf_Die *die, struct cu *cu)
{
Dwarf_Die child;