aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/CGDebugInfo.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2009-12-28 23:41:39 +0000
committerChris Lattner <sabre@nondot.org>2009-12-28 23:41:39 +0000
commit23e92c059ccb9ed7bb3129b5ff3c5ecae1b3c256 (patch)
treef030187f391c5e4cc88221d54ca7cf898051db30 /lib/CodeGen/CGDebugInfo.cpp
parentd5b8902c0329d80a216803b58dc3b689349a0c11 (diff)
adjust for llvm api changes.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92236 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CGDebugInfo.cpp')
-rw-r--r--lib/CodeGen/CGDebugInfo.cpp12
1 files changed, 2 insertions, 10 deletions
diff --git a/lib/CodeGen/CGDebugInfo.cpp b/lib/CodeGen/CGDebugInfo.cpp
index 0f590a3174..5fa9da1089 100644
--- a/lib/CodeGen/CGDebugInfo.cpp
+++ b/lib/CodeGen/CGDebugInfo.cpp
@@ -26,7 +26,6 @@
#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"
@@ -1219,10 +1218,7 @@ void CGDebugInfo::EmitDeclare(const VarDecl *Decl, unsigned Tag,
llvm::DILocation DO(NULL);
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);
+ Call->setMetadata("dbg", DL.getNode());
}
/// EmitDeclare - Emit local variable declaration debug info.
@@ -1424,11 +1420,7 @@ void CGDebugInfo::EmitDeclare(const BlockDeclRefExpr *BDRE, unsigned Tag,
llvm::DILocation DL =
DebugFactory.CreateLocation(Line, PLoc.getColumn(), 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);
-
+ Call->setMetadata("dbg", DL.getNode());
}
void CGDebugInfo::EmitDeclareOfAutoVariable(const VarDecl *Decl,