diff options
author | Chris Lattner <sabre@nondot.org> | 2010-03-31 04:09:11 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2010-03-31 04:09:11 +0000 |
commit | 5169c9e56771bb6a60d55de4786287eb6ec192ea (patch) | |
tree | 9e9ca4da9eee82fbe4a730afb4548c1ed9539913 /include/llvm/Support | |
parent | 870cfcf9a6189b65a8ee805b93a2c737c0183e62 (diff) | |
download | external_llvm-5169c9e56771bb6a60d55de4786287eb6ec192ea.zip external_llvm-5169c9e56771bb6a60d55de4786287eb6ec192ea.tar.gz external_llvm-5169c9e56771bb6a60d55de4786287eb6ec192ea.tar.bz2 |
make irbuilder use the new optimized debug info accessors.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99984 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/Support')
-rw-r--r-- | include/llvm/Support/IRBuilder.h | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/include/llvm/Support/IRBuilder.h b/include/llvm/Support/IRBuilder.h index 1f4e598..acda93b 100644 --- a/include/llvm/Support/IRBuilder.h +++ b/include/llvm/Support/IRBuilder.h @@ -40,7 +40,6 @@ protected: /// IRBuilderBase - Common base class shared among various IRBuilders. class IRBuilderBase { - unsigned DbgMDKind; MDNode *CurDbgLocation; protected: BasicBlock *BB; @@ -49,7 +48,7 @@ protected: public: IRBuilderBase(LLVMContext &context) - : DbgMDKind(0), CurDbgLocation(0), Context(context) { + : CurDbgLocation(0), Context(context) { ClearInsertionPoint(); } @@ -82,12 +81,20 @@ public: /// SetCurrentDebugLocation - Set location information used by debugging /// information. - void SetCurrentDebugLocation(MDNode *L); + void SetCurrentDebugLocation(MDNode *L) { + CurDbgLocation = L; + } + + /// SetCurrentDebugLocation - Set location information used by debugging + /// information. MDNode *getCurrentDebugLocation() const { return CurDbgLocation; } /// SetInstDebugLocation - If this builder has a current debug location, set /// it on the specified instruction. - void SetInstDebugLocation(Instruction *I) const; + void SetInstDebugLocation(Instruction *I) const { + if (CurDbgLocation) + I->setDbgMetadata(CurDbgLocation); + } //===--------------------------------------------------------------------===// // Miscellaneous creation methods. |