1. Revise vector debug support.
2. Update docs for vector debug support and new version control.
3. Simplify serialization of DebugDescInfo subclasses.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28816 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/CodeGen/DwarfWriter.cpp b/lib/CodeGen/DwarfWriter.cpp
index 7805bbc..b384b41 100644
--- a/lib/CodeGen/DwarfWriter.cpp
+++ b/lib/CodeGen/DwarfWriter.cpp
@@ -1276,11 +1276,18 @@
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 @@
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;