[llvm-commits] [dragonegg] r88785 - /dragonegg/trunk/llvm-debug.cpp
Duncan Sands
baldrick at free.fr
Sat Nov 14 04:34:44 PST 2009
Author: baldrick
Date: Sat Nov 14 06:34:44 2009
New Revision: 88785
URL: http://llvm.org/viewvc/llvm-project?rev=88785&view=rev
Log:
Port commit 86860 (dpatel) from llvm-gcc:
Create new location to attach with llvm.dbg.declare. This location is only used to find the context of the variable by the code generator.
Modified:
dragonegg/trunk/llvm-debug.cpp
Modified: dragonegg/trunk/llvm-debug.cpp
URL: http://llvm.org/viewvc/llvm-project/dragonegg/trunk/llvm-debug.cpp?rev=88785&r1=88784&r2=88785&view=diff
==============================================================================
--- dragonegg/trunk/llvm-debug.cpp (original)
+++ dragonegg/trunk/llvm-debug.cpp Sat Nov 14 06:34:44 2009
@@ -326,7 +326,15 @@
// Insert an llvm.dbg.declare into the current block.
Instruction *Call = DebugFactory.InsertDeclare(AI, D,
Builder.GetInsertBlock());
- Builder.SetDebugLocation(Call);
+
+#ifdef ATTACH_DEBUG_INFO_TO_AN_INSN
+ llvm::DIDescriptor DR = RegionStack.back();
+ llvm::DIScope DS = llvm::DIScope(DR.getNode());
+ llvm::DILocation DO(NULL);
+ llvm::DILocation DL =
+ DebugFactory.CreateLocation(CurLineNo, 0 /* column */, DS, DO);
+ Builder.SetDebugLocation(Call, DL.getNode());
+#endif
}
/// EmitStopPoint - Emit a call to llvm.dbg.stoppoint to indicate a change of
More information about the llvm-commits
mailing list