aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Analysis/DebugInfo.cpp
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
commit8e06a5eb4751e9be8558c9957d209882a49e3ca6 (patch)
treed97d3b65143f7ad0ae40047d2b1737deea6e1e28 /llvm/lib/Analysis/DebugInfo.cpp
parent18cc4acb001552340e4e29c49872d0995f0a7f28 (diff)
downloadllvm-8e06a5eb4751e9be8558c9957d209882a49e3ca6.zip
llvm-8e06a5eb4751e9be8558c9957d209882a49e3ca6.tar.gz
llvm-8e06a5eb4751e9be8558c9957d209882a49e3ca6.tar.bz2
Do not forget debug info for enums. Use named mdnode to keep track of these types.
llvm-svn: 110712
Diffstat (limited to 'llvm/lib/Analysis/DebugInfo.cpp')
-rw-r--r--llvm/lib/Analysis/DebugInfo.cpp17
1 files changed, 15 insertions, 2 deletions
diff --git a/llvm/lib/Analysis/DebugInfo.cpp b/llvm/lib/Analysis/DebugInfo.cpp
index 337dc3f..2bf87da5 100644
--- a/llvm/lib/Analysis/DebugInfo.cpp
+++ b/llvm/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);
}