summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPierre-Marie de Rodat <derodat@adacore.com>2017-03-31 14:23:33 (GMT)
committerPierre-Marie de Rodat <derodat@adacore.com>2018-03-23 18:02:47 (GMT)
commitbd4e49ef5163a9708c88ccbfc92bea0a56b67a16 (patch)
tree9291fb964cdddd95b4bc752e7a9879877567eea0 /src
parent321b8b7d53f836aeb2c4a433bcc9e606de0ee1e8 (diff)
downloadcv2pdb-bd4e49ef5163a9708c88ccbfc92bea0a56b67a16.zip
cv2pdb-bd4e49ef5163a9708c88ccbfc92bea0a56b67a16.tar.gz
cv2pdb-bd4e49ef5163a9708c88ccbfc92bea0a56b67a16.tar.bz2
CV2PDB::addDWARFEnumType: use getDWARFBasicType for base type translation
Diffstat (limited to 'src')
-rw-r--r--src/dwarf2pdb.cpp15
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++;