diff options
author | Devang Patel <dpatel@apple.com> | 2010-08-10 20:01:20 +0000 |
---|---|---|
committer | Devang Patel <dpatel@apple.com> | 2010-08-10 20:01:20 +0000 |
commit | e7e5a0f6fb1dec21f296a9872088935860660819 (patch) | |
tree | 86a761e919b083cd2c22985cd0f1d6c679326631 /lib/Analysis/DebugInfo.cpp | |
parent | 1321fec0a6de49d7b7376e915264fbd40d0c4414 (diff) |
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/DebugInfo.cpp')
-rw-r--r-- | lib/Analysis/DebugInfo.cpp | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/lib/Analysis/DebugInfo.cpp b/lib/Analysis/DebugInfo.cpp index 337dc3fc3d..2bf87da5fa 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); } |