summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/llvm/Support/IRBuilder.h15
-rw-r--r--lib/VMCore/IRBuilder.cpp13
2 files changed, 11 insertions, 17 deletions
diff --git a/include/llvm/Support/IRBuilder.h b/include/llvm/Support/IRBuilder.h
index 1f4e598990..acda93bc4c 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.
diff --git a/lib/VMCore/IRBuilder.cpp b/lib/VMCore/IRBuilder.cpp
index 9f2786e4e3..c1b783c752 100644
--- a/lib/VMCore/IRBuilder.cpp
+++ b/lib/VMCore/IRBuilder.cpp
@@ -32,19 +32,6 @@ Value *IRBuilderBase::CreateGlobalString(const char *Str, const Twine &Name) {
return GV;
}
-/// SetCurrentDebugLocation - Set location information used by debugging
-/// information.
-void IRBuilderBase::SetCurrentDebugLocation(MDNode *L) {
- if (DbgMDKind == 0)
- DbgMDKind = Context.getMDKindID("dbg");
- CurDbgLocation = L;
-}
-
-void IRBuilderBase::SetInstDebugLocation(Instruction *I) const {
- if (CurDbgLocation)
- I->setMetadata(DbgMDKind, CurDbgLocation);
-}
-
const Type *IRBuilderBase::getCurrentFunctionReturnType() const {
assert(BB && BB->getParent() && "No current function!");
return BB->getParent()->getReturnType();