[llvm-commits] [llvm] r86859 - /llvm/trunk/include/llvm/Support/IRBuilder.h

Devang Patel dpatel at apple.com
Wed Nov 11 11:06:06 PST 2009


Author: dpatel
Date: Wed Nov 11 13:06:06 2009
New Revision: 86859

URL: http://llvm.org/viewvc/llvm-project?rev=86859&view=rev
Log:
Add SetDebugLocation() variant to 
add debug info location to an instruction.

Modified:
    llvm/trunk/include/llvm/Support/IRBuilder.h

Modified: llvm/trunk/include/llvm/Support/IRBuilder.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Support/IRBuilder.h?rev=86859&r1=86858&r2=86859&view=diff

==============================================================================
--- llvm/trunk/include/llvm/Support/IRBuilder.h (original)
+++ llvm/trunk/include/llvm/Support/IRBuilder.h Wed Nov 11 13:06:06 2009
@@ -151,6 +151,15 @@
       Context.getMetadata().addMD(MDKind, CurDbgLocation, I);
   }
 
+  /// SetDebugLocation -  Set location information for the given instruction.
+  void SetDebugLocation(Instruction *I, MDNode *Loc) {
+    if (MDKind == 0) 
+      MDKind = Context.getMetadata().getMDKind("dbg");
+    if (MDKind == 0)
+      MDKind = Context.getMetadata().registerMDKind("dbg");
+    Context.getMetadata().addMD(MDKind, Loc, I);
+  }
+
   /// Insert - Insert and return the specified instruction.
   template<typename InstTy>
   InstTy *Insert(InstTy *I, const Twine &Name = "") const {





More information about the llvm-commits mailing list