diff options
author | Pierre-Marie de Rodat <derodat@adacore.com> | 2017-03-31 14:23:33 (GMT) |
---|---|---|
committer | Pierre-Marie de Rodat <derodat@adacore.com> | 2018-03-23 18:02:47 (GMT) |
commit | bd4e49ef5163a9708c88ccbfc92bea0a56b67a16 (patch) | |
tree | 9291fb964cdddd95b4bc752e7a9879877567eea0 | |
parent | 321b8b7d53f836aeb2c4a433bcc9e606de0ee1e8 (diff) | |
download | cv2pdb-bd4e49ef5163a9708c88ccbfc92bea0a56b67a16.zip cv2pdb-bd4e49ef5163a9708c88ccbfc92bea0a56b67a16.tar.gz cv2pdb-bd4e49ef5163a9708c88ccbfc92bea0a56b67a16.tar.bz2 |
CV2PDB::addDWARFEnumType: use getDWARFBasicType for base type translation
-rw-r--r-- | src/dwarf2pdb.cpp | 15 |
1 files changed, 3 insertions, 12 deletions
diff --git a/src/dwarf2pdb.cpp b/src/dwarf2pdb.cpp index bac8448..677751a 100644 --- a/src/dwarf2pdb.cpp +++ b/src/dwarf2pdb.cpp @@ -1112,7 +1112,6 @@ int CV2PDB::addDWARFEnum(DWARF_InfoData& enumid, DWARF_CompilationUnit* cu, DIEC int fieldlistType = nextDwarfType++;
int count = 0;
- int basetype = T_INT4;
rdtype = (codeview_reftype*)(dwarfTypes + cbDwarfTypes);
int rdbegin = cbDwarfTypes;
@@ -1135,17 +1134,9 @@ int CV2PDB::addDWARFEnum(DWARF_InfoData& enumid, DWARF_CompilationUnit* cu, DIEC rdtype = (codeview_reftype*)(dwarfTypes + rdbegin);
rdtype->fieldlist.len += cbDwarfTypes - rdbegin - 2;
- if (enumid.type != 0)
- {
- basetype = getTypeByDWARFPtr(cu, enumid.type);
- }
- else
- {
- // TODO: refactor addDWARFBasicType to reuse the part that creates a
- // primitive type ID without creating an user type.
- basetype = T_INT4;
- }
-
+ int basetype = (enumid.type != 0)
+ ? getTypeByDWARFPtr(cu, enumid.type)
+ : getDWARFBasicType(enumid.encoding, enumid.byte_size);
dtype = (codeview_type*)(userTypes + cbUserTypes);
cbUserTypes += addEnum(dtype, count, fieldlistType, 0, basetype, enumid.name);
int enumType = nextUserType++;
|