summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Analysis/DebugInfo.cpp
diff options
context:
space:
mode:
authorStuart Hastings <stuart@apple.com>2010-07-08 22:28:59 +0000
committerStuart Hastings <stuart@apple.com>2010-07-08 22:28:59 +0000
commit43d226deeac18cdfcedee8ff44954ac742dc9b9d (patch)
tree3e7552e65ff47c46966f8c33dd57f154902ec9cd /llvm/lib/Analysis/DebugInfo.cpp
parent9f034c1e5d061559cae3c58d01affc0e45f122ed (diff)
downloadbcm5719-llvm-43d226deeac18cdfcedee8ff44954ac742dc9b9d.tar.gz
bcm5719-llvm-43d226deeac18cdfcedee8ff44954ac742dc9b9d.zip
Fix decl/def debug info for template functions. Radar 8063111.
llvm-svn: 107919
Diffstat (limited to 'llvm/lib/Analysis/DebugInfo.cpp')
-rw-r--r--llvm/lib/Analysis/DebugInfo.cpp11
1 files changed, 8 insertions, 3 deletions
diff --git a/llvm/lib/Analysis/DebugInfo.cpp b/llvm/lib/Analysis/DebugInfo.cpp
index c8d0d22ec2e..ca6c2e6d721 100644
--- a/llvm/lib/Analysis/DebugInfo.cpp
+++ b/llvm/lib/Analysis/DebugInfo.cpp
@@ -1107,14 +1107,19 @@ DIVariable DIFactory::CreateComplexVariable(unsigned Tag, DIDescriptor Context,
/// CreateBlock - This creates a descriptor for a lexical block with the
/// specified parent VMContext.
DILexicalBlock DIFactory::CreateLexicalBlock(DIDescriptor Context,
- unsigned LineNo, unsigned Col) {
+ DIFile F, unsigned LineNo,
+ unsigned Col) {
+ // Defeat MDNode uniqing for lexical blocks.
+ static unsigned int unique_id = 0;
Value *Elts[] = {
GetTagConstant(dwarf::DW_TAG_lexical_block),
Context,
ConstantInt::get(Type::getInt32Ty(VMContext), LineNo),
- ConstantInt::get(Type::getInt32Ty(VMContext), Col)
+ ConstantInt::get(Type::getInt32Ty(VMContext), Col),
+ F,
+ ConstantInt::get(Type::getInt32Ty(VMContext), unique_id++)
};
- return DILexicalBlock(MDNode::get(VMContext, &Elts[0], 4));
+ return DILexicalBlock(MDNode::get(VMContext, &Elts[0], 6));
}
/// CreateNameSpace - This creates new descriptor for a namespace
OpenPOWER on IntegriCloud