Add SetDebugLocation() variant to

add debug info location to an instruction.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86859 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Devang Patel 2009-11-11 19:06:06 +00:00
parent 77e4751011
commit 4a8efb0c39

View File

@ -151,6 +151,15 @@ public:
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 {