summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDevang Patel <dpatel@apple.com>2011-05-03 16:18:28 +0000
committerDevang Patel <dpatel@apple.com>2011-05-03 16:18:28 +0000
commit09fa69e151c6032eb40b230fe1d4eb8453f5c20a (patch)
treed087ecc43efd99bd3ed968c668a36d346627a3e8
parent9c373c1c7a34531e1ff102e72f8de1ef98af561e (diff)
downloadbcm5719-llvm-09fa69e151c6032eb40b230fe1d4eb8453f5c20a.tar.gz
bcm5719-llvm-09fa69e151c6032eb40b230fe1d4eb8453f5c20a.zip
Use llvm.dbg.cu named metadata to collect compile units.
llvm-svn: 130756
-rw-r--r--llvm/docs/SourceLevelDebugging.html4
-rw-r--r--llvm/lib/Analysis/DIBuilder.cpp4
2 files changed, 7 insertions, 1 deletions
diff --git a/llvm/docs/SourceLevelDebugging.html b/llvm/docs/SourceLevelDebugging.html
index c9ae0202def..4c4439fd59f 100644
--- a/llvm/docs/SourceLevelDebugging.html
+++ b/llvm/docs/SourceLevelDebugging.html
@@ -342,7 +342,9 @@ height="369">
that produced it.</p>
<p>Compile unit descriptors provide the root context for objects declared in a
- specific compilation unit. File descriptors are defined using this context.</p>
+ specific compilation unit. File descriptors are defined using this context.
+ These descriptors are collected by a named metadata
+ <tt>!llvm.dbg.cu</tt>.
</div>
diff --git a/llvm/lib/Analysis/DIBuilder.cpp b/llvm/lib/Analysis/DIBuilder.cpp
index dc98c9e67a8..1375e497ac6 100644
--- a/llvm/lib/Analysis/DIBuilder.cpp
+++ b/llvm/lib/Analysis/DIBuilder.cpp
@@ -51,6 +51,10 @@ void DIBuilder::createCompileUnit(unsigned Lang, StringRef Filename,
ConstantInt::get(Type::getInt32Ty(VMContext), RunTimeVer)
};
TheCU = DICompileUnit(MDNode::get(VMContext, Elts));
+
+ // Create a named metadata so that it is easier to find cu in a module.
+ NamedMDNode *NMD = M.getOrInsertNamedMetadata("llvm.dbg.cu");
+ NMD->addOperand(TheCU);
}
/// createFile - Create a file descriptor to hold debugging information
OpenPOWER on IntegriCloud