summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2009-12-28 21:45:40 +0000
committerChris Lattner <sabre@nondot.org>2009-12-28 21:45:40 +0000
commit43469b6957140898709382082ef95dd4b77ac20a (patch)
treee24223bd578354c880e93acbdf6e84279c1fd6c4 /lib
parenta53cfd16f075f22655a8c965b122aea38e635aa3 (diff)
downloadllvm-43469b6957140898709382082ef95dd4b77ac20a.tar.gz
llvm-43469b6957140898709382082ef95dd4b77ac20a.tar.bz2
llvm-43469b6957140898709382082ef95dd4b77ac20a.tar.xz
move debug info stuff out of line, allowing two #includes
to go away from IRBuilder.h git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92230 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r--lib/Target/Target.cpp1
-rw-r--r--lib/VMCore/IRBuilder.cpp15
2 files changed, 16 insertions, 0 deletions
diff --git a/lib/Target/Target.cpp b/lib/Target/Target.cpp
index cc6be9fa7a..cddf49e515 100644
--- a/lib/Target/Target.cpp
+++ b/lib/Target/Target.cpp
@@ -15,6 +15,7 @@
#include "llvm-c/Target.h"
#include "llvm/PassManager.h"
#include "llvm/Target/TargetData.h"
+#include "llvm/LLVMContext.h"
#include <cstring>
using namespace llvm;
diff --git a/lib/VMCore/IRBuilder.cpp b/lib/VMCore/IRBuilder.cpp
index 850812cf66..99803f134f 100644
--- a/lib/VMCore/IRBuilder.cpp
+++ b/lib/VMCore/IRBuilder.cpp
@@ -14,6 +14,8 @@
#include "llvm/Support/IRBuilder.h"
#include "llvm/GlobalVariable.h"
+#include "llvm/Metadata.h"
+#include "llvm/LLVMContext.h"
using namespace llvm;
/// CreateGlobalString - Make a new global variable with an initializer that
@@ -29,3 +31,16 @@ Value *IRBuilderBase::CreateGlobalString(const char *Str, const Twine &Name) {
GV->setName(Name);
return GV;
}
+
+/// SetCurrentDebugLocation - Set location information used by debugging
+/// information.
+void IRBuilderBase::SetCurrentDebugLocation(MDNode *L) {
+ if (DbgMDKind == 0)
+ DbgMDKind = Context.getMetadata().getMDKindID("dbg");
+ CurDbgLocation = L;
+}
+
+void IRBuilderBase::SetInstDebugLocation(Instruction *I) const {
+ if (CurDbgLocation)
+ Context.getMetadata().addMD(DbgMDKind, CurDbgLocation, I);
+}