aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Analysis
diff options
context:
space:
mode:
authorDevang Patel <dpatel@apple.com>2010-08-10 20:01:20 +0000
committerDevang Patel <dpatel@apple.com>2010-08-10 20:01:20 +0000
commite7e5a0f6fb1dec21f296a9872088935860660819 (patch)
tree86a761e919b083cd2c22985cd0f1d6c679326631 /lib/Analysis
parent1321fec0a6de49d7b7376e915264fbd40d0c4414 (diff)
downloadexternal_llvm-e7e5a0f6fb1dec21f296a9872088935860660819.zip
external_llvm-e7e5a0f6fb1dec21f296a9872088935860660819.tar.gz
external_llvm-e7e5a0f6fb1dec21f296a9872088935860660819.tar.bz2
Do not forget debug info for enums. Use named mdnode to keep track of these types.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110712 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis')
-rw-r--r--lib/Analysis/DebugInfo.cpp17
1 files changed, 15 insertions, 2 deletions
diff --git a/lib/Analysis/DebugInfo.cpp b/lib/Analysis/DebugInfo.cpp
index 337dc3f..2bf87da 100644
--- a/lib/Analysis/DebugInfo.cpp
+++ b/lib/Analysis/DebugInfo.cpp
@@ -923,7 +923,14 @@ DICompositeType DIFactory::CreateCompositeType(unsigned Tag,
ConstantInt::get(Type::getInt32Ty(VMContext), RuntimeLang),
ContainingType
};
- return DICompositeType(MDNode::get(VMContext, &Elts[0], 13));
+
+ MDNode *Node = MDNode::get(VMContext, &Elts[0], 13);
+ // Create a named metadata so that we do not lose this enum info.
+ if (Tag == dwarf::DW_TAG_enumeration_type) {
+ NamedMDNode *NMD = M.getOrInsertNamedMetadata("llvm.dbg.enum");
+ NMD->addOperand(Node);
+ }
+ return DICompositeType(Node);
}
@@ -955,7 +962,13 @@ DICompositeType DIFactory::CreateCompositeTypeEx(unsigned Tag,
Elements,
ConstantInt::get(Type::getInt32Ty(VMContext), RuntimeLang)
};
- return DICompositeType(MDNode::get(VMContext, &Elts[0], 12));
+ MDNode *Node = MDNode::get(VMContext, &Elts[0], 12);
+ // Create a named metadata so that we do not lose this enum info.
+ if (Tag == dwarf::DW_TAG_enumeration_type) {
+ NamedMDNode *NMD = M.getOrInsertNamedMetadata("llvm.dbg.enum");
+ NMD->addOperand(Node);
+ }
+ return DICompositeType(Node);
}