[cfe-commits] r92236 - /cfe/trunk/lib/CodeGen/CGDebugInfo.cpp

Chris Lattner sabre at nondot.org
Mon Dec 28 15:41:40 PST 2009


Author: lattner
Date: Mon Dec 28 17:41:39 2009
New Revision: 92236

URL: http://llvm.org/viewvc/llvm-project?rev=92236&view=rev
Log:
adjust for llvm api changes.

Modified:
    cfe/trunk/lib/CodeGen/CGDebugInfo.cpp

Modified: cfe/trunk/lib/CodeGen/CGDebugInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGDebugInfo.cpp?rev=92236&r1=92235&r2=92236&view=diff

==============================================================================
--- cfe/trunk/lib/CodeGen/CGDebugInfo.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGDebugInfo.cpp Mon Dec 28 17:41:39 2009
@@ -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 @@
   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 @@
   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,





More information about the cfe-commits mailing list