summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Analysis/DIBuilder.cpp
diff options
context:
space:
mode:
authorEric Christopher <echristo@apple.com>2011-10-11 22:59:11 +0000
committerEric Christopher <echristo@apple.com>2011-10-11 22:59:11 +0000
commit6647b830872363979f7e946cb5d7642b4a95d3d8 (patch)
tree9c0f59f80b7b1fbd5c5be57748ec9b2d2ac95455 /llvm/lib/Analysis/DIBuilder.cpp
parent57d16927504a90f2ae7f8781134190aba4eb29c2 (diff)
downloadbcm5719-llvm-6647b830872363979f7e946cb5d7642b4a95d3d8.tar.gz
bcm5719-llvm-6647b830872363979f7e946cb5d7642b4a95d3d8.zip
Add a new wrapper node for a DILexicalBlock that encapsulates it and a
file. Since it should only be used when necessary propagate it through the backend code generation and tweak testcases accordingly. This helps with code like in clang's test/CodeGen/debug-info-line.c where we have multiple #line directives within a single lexical block and want to generate only a single block that contains each file change. Part of rdar://10246360 llvm-svn: 141729
Diffstat (limited to 'llvm/lib/Analysis/DIBuilder.cpp')
-rw-r--r--llvm/lib/Analysis/DIBuilder.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/llvm/lib/Analysis/DIBuilder.cpp b/llvm/lib/Analysis/DIBuilder.cpp
index fd56d369a66..bfa429d5412 100644
--- a/llvm/lib/Analysis/DIBuilder.cpp
+++ b/llvm/lib/Analysis/DIBuilder.cpp
@@ -851,6 +851,18 @@ DINameSpace DIBuilder::createNameSpace(DIDescriptor Scope, StringRef Name,
return DINameSpace(MDNode::get(VMContext, Elts));
}
+/// createLexicalBlockFile - This creates a new MDNode that encapsulates
+/// an existing scope with a new filename.
+DILexicalBlockFile DIBuilder::createLexicalBlockFile(DIDescriptor Scope,
+ DIFile File) {
+ Value *Elts[] = {
+ GetTagConstant(VMContext, dwarf::DW_TAG_lexical_block),
+ Scope,
+ File
+ };
+ return DILexicalBlockFile(MDNode::get(VMContext, Elts));
+}
+
DILexicalBlock DIBuilder::createLexicalBlock(DIDescriptor Scope, DIFile File,
unsigned Line, unsigned Col) {
// Defeat MDNode uniqing for lexical blocks by using unique id.
OpenPOWER on IntegriCloud