diff options
| author | Devang Patel <dpatel@apple.com> | 2009-11-11 19:06:06 +0000 |
|---|---|---|
| committer | Devang Patel <dpatel@apple.com> | 2009-11-11 19:06:06 +0000 |
| commit | 717b246b192ea4239c0f7b1cc7262de24e7bf6ff (patch) | |
| tree | aa0435443c1d845a10f9c400475a64e7a131463b /llvm | |
| parent | 3d3c24a82c6ece607775f4beb7891e4ddce550bb (diff) | |
| download | bcm5719-llvm-717b246b192ea4239c0f7b1cc7262de24e7bf6ff.tar.gz bcm5719-llvm-717b246b192ea4239c0f7b1cc7262de24e7bf6ff.zip | |
Add SetDebugLocation() variant to
add debug info location to an instruction.
llvm-svn: 86859
Diffstat (limited to 'llvm')
| -rw-r--r-- | llvm/include/llvm/Support/IRBuilder.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/llvm/include/llvm/Support/IRBuilder.h b/llvm/include/llvm/Support/IRBuilder.h index 4652e8fb941..05c3c569aa1 100644 --- a/llvm/include/llvm/Support/IRBuilder.h +++ b/llvm/include/llvm/Support/IRBuilder.h @@ -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 { |

