aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNicolas Geoffray <nicolas.geoffray@lip6.fr>2010-04-14 22:06:37 +0000
committerNicolas Geoffray <nicolas.geoffray@lip6.fr>2010-04-14 22:06:37 +0000
commit4eb373988e3211b0a481dee60ecdc3d12821b7b9 (patch)
treeeb31270f456141ac12708afca09466a57959bc38
parent2fd100a4cb6c7c013f9bf78fc06b655515b0851c (diff)
downloadexternal_llvm-4eb373988e3211b0a481dee60ecdc3d12821b7b9.zip
external_llvm-4eb373988e3211b0a481dee60ecdc3d12821b7b9.tar.gz
external_llvm-4eb373988e3211b0a481dee60ecdc3d12821b7b9.tar.bz2
Don't use DILocation when processing a DebugLoc.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101294 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/ExecutionEngine/JIT/JITEmitter.cpp17
1 files changed, 9 insertions, 8 deletions
diff --git a/lib/ExecutionEngine/JIT/JITEmitter.cpp b/lib/ExecutionEngine/JIT/JITEmitter.cpp
index c47b795..ab257fd 100644
--- a/lib/ExecutionEngine/JIT/JITEmitter.cpp
+++ b/lib/ExecutionEngine/JIT/JITEmitter.cpp
@@ -369,7 +369,7 @@ namespace {
ValueMap<const Function *, EmittedCode,
EmittedFunctionConfig> EmittedFunctions;
- DILocation PrevDLT;
+ DebugLoc PrevDL;
/// Instance of the JIT
JIT *TheJIT;
@@ -377,7 +377,7 @@ namespace {
public:
JITEmitter(JIT &jit, JITMemoryManager *JMM, TargetMachine &TM)
: SizeEstimate(0), Resolver(jit, *this), MMI(0), CurFn(0),
- EmittedFunctions(this), PrevDLT(NULL), TheJIT(&jit) {
+ EmittedFunctions(this), TheJIT(&jit) {
MemMgr = JMM ? JMM : JITMemoryManager::CreateDefaultMemManager();
if (jit.getJITInfo().needsGOT()) {
MemMgr->AllocateGOT();
@@ -823,19 +823,17 @@ void *JITEmitter::getPointerToGVIndirectSym(GlobalValue *V, void *Reference) {
void JITEmitter::processDebugLoc(DebugLoc DL, bool BeforePrintingInsn) {
if (DL.isUnknown()) return;
if (!BeforePrintingInsn) return;
-
- // FIXME: This is horribly inefficient.
- DILocation CurDLT(DL.getAsMDNode(
- EmissionDetails.MF->getFunction()->getContext()));
- if (CurDLT.getScope().getNode() != 0 && PrevDLT.getNode() !=CurDLT.getNode()){
+ const LLVMContext& Context = EmissionDetails.MF->getFunction()->getContext();
+
+ if (DL.getScope(Context) != 0 && PrevDL != DL) {
JITEvent_EmittedFunctionDetails::LineStart NextLine;
NextLine.Address = getCurrentPCValue();
NextLine.Loc = DL;
EmissionDetails.LineStarts.push_back(NextLine);
}
- PrevDLT = CurDLT;
+ PrevDL = DL;
}
static unsigned GetConstantPoolSizeInBytes(MachineConstantPool *MCP,
@@ -1212,6 +1210,9 @@ bool JITEmitter::finishFunction(MachineFunction &F) {
TheJIT->NotifyFunctionEmitted(*F.getFunction(), FnStart, FnEnd-FnStart,
EmissionDetails);
+ // Reset the previous debug location.
+ PrevDL = DebugLoc();
+
DEBUG(dbgs() << "JIT: Finished CodeGen of [" << (void*)FnStart
<< "] Function: " << F.getFunction()->getName()
<< ": " << (FnEnd-FnStart) << " bytes of text, "