[llvm-commits] [llvm-gcc-4.2] r68154 - in /llvm-gcc-4.2/branches/Apple/Dib/gcc: llvm-convert.cpp llvm-debug.cpp llvm-debug.h
Bill Wendling
isanbard at gmail.com
Tue Mar 31 15:31:16 PDT 2009
Author: void
Date: Tue Mar 31 17:31:16 2009
New Revision: 68154
URL: http://llvm.org/viewvc/llvm-project?rev=68154&view=rev
Log:
--- Merging (from foreign repository) r68152 into '.':
U gcc/llvm-convert.cpp
U gcc/llvm-debug.cpp
U gcc/llvm-debug.h
Fix nondeterminism in whether line numbers got
generated near the beginning of a function. Now
they do, an improvement. This allows checking
in 67884 finally:
Enable debug info at -O. I've fixed a lot of
bugs where -g affects optimization recently; there
are currently no such cases in the llvm testsuite or
a substantial amount of other code on Darwin, which
seems sufficient to turn it on. Woot. I make
no claims about the quality of the generated debug
info.
Any cases where you see -g affecting optimization can
now usefully be reported as bugs. TEST=ipodbgopt should
test this in the llvm testsuite.
Modified:
llvm-gcc-4.2/branches/Apple/Dib/gcc/llvm-convert.cpp
llvm-gcc-4.2/branches/Apple/Dib/gcc/llvm-debug.cpp
llvm-gcc-4.2/branches/Apple/Dib/gcc/llvm-debug.h
Modified: llvm-gcc-4.2/branches/Apple/Dib/gcc/llvm-convert.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/branches/Apple/Dib/gcc/llvm-convert.cpp?rev=68154&r1=68153&r2=68154&view=diff
==============================================================================
--- llvm-gcc-4.2/branches/Apple/Dib/gcc/llvm-convert.cpp (original)
+++ llvm-gcc-4.2/branches/Apple/Dib/gcc/llvm-convert.cpp Tue Mar 31 17:31:16 2009
@@ -668,7 +668,7 @@
}
if (TheDebugInfo) {
TheDebugInfo->EmitStopPoint(Fn, Builder.GetInsertBlock());
- TheDebugInfo->EmitRegionEnd(Builder.GetInsertBlock());
+ TheDebugInfo->EmitRegionEnd(Builder.GetInsertBlock(), true);
}
if (RetVals.empty())
Builder.CreateRetVoid();
Modified: llvm-gcc-4.2/branches/Apple/Dib/gcc/llvm-debug.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/branches/Apple/Dib/gcc/llvm-debug.cpp?rev=68154&r1=68153&r2=68154&view=diff
==============================================================================
--- llvm-gcc-4.2/branches/Apple/Dib/gcc/llvm-debug.cpp (original)
+++ llvm-gcc-4.2/branches/Apple/Dib/gcc/llvm-debug.cpp Tue Mar 31 17:31:16 2009
@@ -273,10 +273,17 @@
/// EmitRegionEnd - Constructs the debug code for exiting a declarative
/// region - "llvm.dbg.region.end."
-void DebugInfo::EmitRegionEnd(BasicBlock *CurBB) {
+void DebugInfo::EmitRegionEnd(BasicBlock *CurBB, bool EndFunction) {
assert(!RegionStack.empty() && "Region stack mismatch, stack empty!");
DebugFactory.InsertRegionEnd(RegionStack.back(), CurBB);
RegionStack.pop_back();
+ // Blocks get erased; clearing these is needed for determinism, and also
+ // a good idea if the next function gets inlined.
+ if (EndFunction) {
+ PrevBB = NULL;
+ PrevLineNo = 0;
+ PrevFullPath = NULL;
+ }
}
/// EmitDeclare - Constructs the debug code for allocation of a new variable.
@@ -307,13 +314,9 @@
}
/// EmitStopPoint - Emit a call to llvm.dbg.stoppoint to indicate a change of
-/// source line - "llvm.dbg.stoppoint."
+/// source line - "llvm.dbg.stoppoint." Now enabled at -O.
void DebugInfo::EmitStopPoint(Function *Fn, BasicBlock *CurBB) {
- // Do not emit line number info, for now.
- if (optimize)
- return;
-
// Don't bother if things are the same as last time.
if (PrevLineNo == CurLineNo &&
PrevBB == CurBB &&
Modified: llvm-gcc-4.2/branches/Apple/Dib/gcc/llvm-debug.h
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/branches/Apple/Dib/gcc/llvm-debug.h?rev=68154&r1=68153&r2=68154&view=diff
==============================================================================
--- llvm-gcc-4.2/branches/Apple/Dib/gcc/llvm-debug.h (original)
+++ llvm-gcc-4.2/branches/Apple/Dib/gcc/llvm-debug.h Tue Mar 31 17:31:16 2009
@@ -89,7 +89,7 @@
/// EmitRegionEnd - Constructs the debug code for exiting a declarative
/// region - "llvm.dbg.region.end."
- void EmitRegionEnd(BasicBlock *CurBB);
+ void EmitRegionEnd(BasicBlock *CurBB, bool EndFunction);
/// EmitDeclare - Constructs the debug code for allocation of a new variable.
/// region - "llvm.dbg.declare."
More information about the llvm-commits
mailing list