[llvm-commits] [llvm] r130756 - in /llvm/trunk: docs/SourceLevelDebugging.html lib/Analysis/DIBuilder.cpp

Devang Patel dpatel at apple.com
Tue May 3 09:18:28 PDT 2011


Author: dpatel
Date: Tue May  3 11:18:28 2011
New Revision: 130756

URL: http://llvm.org/viewvc/llvm-project?rev=130756&view=rev
Log:
Use llvm.dbg.cu  named metadata to collect compile units.

Modified:
    llvm/trunk/docs/SourceLevelDebugging.html
    llvm/trunk/lib/Analysis/DIBuilder.cpp

Modified: llvm/trunk/docs/SourceLevelDebugging.html
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/SourceLevelDebugging.html?rev=130756&r1=130755&r2=130756&view=diff
==============================================================================
--- llvm/trunk/docs/SourceLevelDebugging.html (original)
+++ llvm/trunk/docs/SourceLevelDebugging.html Tue May  3 11:18:28 2011
@@ -342,7 +342,9 @@
    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>
 

Modified: llvm/trunk/lib/Analysis/DIBuilder.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/DIBuilder.cpp?rev=130756&r1=130755&r2=130756&view=diff
==============================================================================
--- llvm/trunk/lib/Analysis/DIBuilder.cpp (original)
+++ llvm/trunk/lib/Analysis/DIBuilder.cpp Tue May  3 11:18:28 2011
@@ -51,6 +51,10 @@
     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





More information about the llvm-commits mailing list