[llvm-commits] [llvm-gcc-4.2] r87008 - /llvm-gcc-4.2/trunk/gcc/llvm-debug.cpp
Devang Patel
dpatel at apple.com
Thu Nov 12 10:31:58 PST 2009
Author: dpatel
Date: Thu Nov 12 12:31:57 2009
New Revision: 87008
URL: http://llvm.org/viewvc/llvm-project?rev=87008&view=rev
Log:
"Attach debug info with llvm instructions" mode was enabled a month ago. Now make it permanent and remove old way of inserting intrinsics to encode debug info for locations and types.
Modified:
llvm-gcc-4.2/trunk/gcc/llvm-debug.cpp
Modified: llvm-gcc-4.2/trunk/gcc/llvm-debug.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/llvm-debug.cpp?rev=87008&r1=87007&r2=87008&view=diff
==============================================================================
--- llvm-gcc-4.2/trunk/gcc/llvm-debug.cpp (original)
+++ llvm-gcc-4.2/trunk/gcc/llvm-debug.cpp Thu Nov 12 12:31:57 2009
@@ -250,9 +250,6 @@
Fn->hasInternalLinkage(),
true /*definition*/);
-#ifndef ATTACH_DEBUG_INFO_TO_AN_INSN
- DebugFactory.InsertSubprogramStart(SP, CurBB);
-#endif
// Push function on region stack.
RegionStack.push_back(SP);
RegionMap[FnDecl] = SP;
@@ -293,9 +290,6 @@
/// region - "llvm.dbg.region.end."
void DebugInfo::EmitFunctionEnd(BasicBlock *CurBB, bool EndFunction) {
assert(!RegionStack.empty() && "Region stack mismatch, stack empty!");
-#ifndef ATTACH_DEBUG_INFO_TO_AN_INSN
- DebugFactory.InsertRegionEnd(RegionStack.back(), CurBB);
-#endif
RegionStack.pop_back();
// Blocks get erased; clearing these is needed for determinism, and also
// a good idea if the next function gets inlined.
@@ -334,14 +328,12 @@
Instruction *Call = DebugFactory.InsertDeclare(AI, D,
Builder.GetInsertBlock());
-#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
+ 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());
}
@@ -388,7 +380,7 @@
// or in Apple Block helper functions.
if (!isPartOfAppleBlockPrologue(CurLineNo)
&& !isCopyOrDestroyHelper(cfun->decl)) {
-#ifdef ATTACH_DEBUG_INFO_TO_AN_INSN
+
if (RegionStack.empty())
return;
llvm::DIDescriptor DR = RegionStack.back();
@@ -397,11 +389,6 @@
llvm::DILocation DL =
DebugFactory.CreateLocation(CurLineNo, 0 /* column */, DS, DO);
Builder.SetCurrentDebugLocation(DL.getNode());
-#else
- DebugFactory.InsertStopPoint(getOrCreateCompileUnit(CurFullPath),
- CurLineNo, 0 /*column no. */,
- CurBB);
-#endif
}
}
More information about the llvm-commits
mailing list