aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/CGDebugInfo.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2009-12-28 21:44:41 +0000
committerChris Lattner <sabre@nondot.org>2009-12-28 21:44:41 +0000
commitd5b8902c0329d80a216803b58dc3b689349a0c11 (patch)
treee0d286d799bba081cb2f4265fc6b91a652ea1744 /lib/CodeGen/CGDebugInfo.cpp
parent2d3dfd70eee48005f253b72d288e0eb4ed754fe0 (diff)
this form of SetDebugLocation is about to go away, add some #includes that
are about to not come in implicitly. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92228 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CGDebugInfo.cpp')
-rw-r--r--lib/CodeGen/CGDebugInfo.cpp17
1 files changed, 13 insertions, 4 deletions
diff --git a/lib/CodeGen/CGDebugInfo.cpp b/lib/CodeGen/CGDebugInfo.cpp
index b7401a40f2..0f590a3174 100644
--- a/lib/CodeGen/CGDebugInfo.cpp
+++ b/lib/CodeGen/CGDebugInfo.cpp
@@ -26,6 +26,7 @@
#include "llvm/DerivedTypes.h"
#include "llvm/Instructions.h"
#include "llvm/Intrinsics.h"
+#include "llvm/LLVMContext.h"
#include "llvm/Module.h"
#include "llvm/ADT/StringExtras.h"
#include "llvm/ADT/SmallVector.h"
@@ -1216,9 +1217,12 @@ void CGDebugInfo::EmitDeclare(const VarDecl *Decl, unsigned Tag,
llvm::DIScope DS(RegionStack.back());
llvm::DILocation DO(NULL);
- llvm::DILocation DL =
- DebugFactory.CreateLocation(Line, Column, DS, DO);
- Builder.SetDebugLocation(Call, DL.getNode());
+ llvm::DILocation DL = DebugFactory.CreateLocation(Line, Column, DS, DO);
+
+ // TODO: Remove #include of LLVMContext from this.
+ llvm::LLVMContext &Context = Call->getContext();
+ unsigned DbgMDKind = Context.getMetadata().getMDKindID("dbg");
+ Context.getMetadata().addMD(DbgMDKind, DL.getNode(), Call);
}
/// EmitDeclare - Emit local variable declaration debug info.
@@ -1419,7 +1423,12 @@ void CGDebugInfo::EmitDeclare(const BlockDeclRefExpr *BDRE, unsigned Tag,
llvm::DILocation DO(NULL);
llvm::DILocation DL =
DebugFactory.CreateLocation(Line, PLoc.getColumn(), DS, DO);
- Builder.SetDebugLocation(Call, DL.getNode());
+
+ // TODO: Remove #include of LLVMContext from this.
+ llvm::LLVMContext &Context = Call->getContext();
+ unsigned DbgMDKind = Context.getMetadata().getMDKindID("dbg");
+ Context.getMetadata().addMD(DbgMDKind, DL.getNode(), Call);
+
}
void CGDebugInfo::EmitDeclareOfAutoVariable(const VarDecl *Decl,