diff options
Diffstat (limited to 'lib/CodeGen/DwarfWriter.cpp')
-rw-r--r-- | lib/CodeGen/DwarfWriter.cpp | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/lib/CodeGen/DwarfWriter.cpp b/lib/CodeGen/DwarfWriter.cpp index 7805bbcbbf..b384b416a4 100644 --- a/lib/CodeGen/DwarfWriter.cpp +++ b/lib/CodeGen/DwarfWriter.cpp @@ -1276,11 +1276,18 @@ DIE *DwarfWriter::NewType(DIE *Context, TypeDesc *TyDesc, CompileUnit *Unit) { NewType(Context, FromTy, Unit)); } } else if (CompositeTypeDesc *CompTy = dyn_cast<CompositeTypeDesc>(TyDesc)) { + // Fetch tag + unsigned Tag = CompTy->getTag(); + // Create specific DIE. - Slot = Ty = new DIE(CompTy->getTag()); + Slot = Ty = Tag == DW_TAG_vector_type ? new DIE(DW_TAG_array_type) : + new DIE(Tag); + std::vector<DebugInfoDesc *> &Elements = CompTy->getElements(); - switch (CompTy->getTag()) { + switch (Tag) { + case DW_TAG_vector_type: Ty->AddUInt(DW_AT_GNU_vector, DW_FORM_flag, 1); + // Fall thru case DW_TAG_array_type: { // Add element type. if (TypeDesc *FromTy = CompTy->getFromType()) { @@ -1288,11 +1295,6 @@ DIE *DwarfWriter::NewType(DIE *Context, TypeDesc *TyDesc, CompileUnit *Unit) { NewType(Context, FromTy, Unit)); } - // check for vector type - if (CompTy->isVector()) { - Ty->AddUInt(DW_AT_GNU_vector, DW_FORM_flag, 1); - } - // Don't emit size attribute. Size = 0; |