this form of SetDebugLocation is about to go away, add some #includes that

are about to not come in implicitly.

llvm-svn: 92228
This commit is contained in:
Chris Lattner 2009-12-28 21:44:41 +00:00
parent 17079fc0fa
commit 5e124bf913
2 changed files with 15 additions and 7 deletions

View File

@ -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,

View File

@ -30,6 +30,7 @@
#include "llvm/CallingConv.h"
#include "llvm/Module.h"
#include "llvm/Intrinsics.h"
#include "llvm/LLVMContext.h"
#include "llvm/Target/TargetData.h"
#include "llvm/Support/ErrorHandling.h"
using namespace clang;
@ -1089,9 +1090,7 @@ static void ReplaceUsesOfNonProtoTypeWithRealFunction(llvm::GlobalValue *Old,
CI->replaceAllUsesWith(NewCall);
// Copy any custom metadata attached with CI.
llvm::MetadataContext &TheMetadata = CI->getContext().getMetadata();
TheMetadata.copyMD(CI, NewCall);
CI->getContext().getMetadata().copyMD(CI, NewCall);
CI->eraseFromParent();
}
}