diff options
author | Chris Lattner <sabre@nondot.org> | 2009-03-06 06:45:05 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2009-03-06 06:45:05 +0000 |
commit | d6f16587ab292b20857933b3ba13d3d1c62a8d62 (patch) | |
tree | ae2e65b158a4171daa528a43330c965f65a24666 /lib/Analysis/LoopPass.cpp | |
parent | 7157228a58fe0025488130548680cf645e14f068 (diff) |
Sprinkle some PrettyStackEntry magic into the passmanager. With this, we now
get nice and happy stack traces when we crash in an optimizer or codegen. For
example, an abort put in UnswitchLoops now looks like this:
Stack dump:
0. Program arguments: clang pr3399.c -S -O3
1. <eof> parser at end of file
2. per-module optimization passes
3. Running pass 'CallGraph Pass Manager' on module 'pr3399.c'.
4. Running pass 'Loop Pass Manager' on function '@foo'
5. Running pass 'Unswitch loops' on basic block '%for.inc'
Abort
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@66260 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis/LoopPass.cpp')
-rw-r--r-- | lib/Analysis/LoopPass.cpp | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/lib/Analysis/LoopPass.cpp b/lib/Analysis/LoopPass.cpp index c45c2ef4c0..c4ff988944 100644 --- a/lib/Analysis/LoopPass.cpp +++ b/lib/Analysis/LoopPass.cpp @@ -209,7 +209,6 @@ bool LPPassManager::runOnFunction(Function &F) { // Run all passes on current SCC for (unsigned Index = 0; Index < getNumContainedPasses(); ++Index) { - Pass *P = getContainedPass(Index); dumpPassInfo(P, EXECUTION_MSG, ON_LOOP_MSG, ""); @@ -217,11 +216,14 @@ bool LPPassManager::runOnFunction(Function &F) { initializeAnalysisImpl(P); - StartPassTimer(P); LoopPass *LP = dynamic_cast<LoopPass *>(P); - assert (LP && "Invalid LPPassManager member"); - Changed |= LP->runOnLoop(CurrentLoop, *this); - StopPassTimer(P); + { + PassManagerPrettyStackEntry X(LP, *CurrentLoop->getHeader()); + StartPassTimer(P); + assert(LP && "Invalid LPPassManager member"); + Changed |= LP->runOnLoop(CurrentLoop, *this); + StopPassTimer(P); + } if (Changed) dumpPassInfo(P, MODIFICATION_MSG, ON_LOOP_MSG, ""); |