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 | 4c1e9541d34585aac1bbb54cb9d3f93ab108fe00 (patch) | |
tree | 78eef85025724b804b5c64eacd2e79117aab5372 /llvm/lib/Analysis | |
parent | 5cb85ebe94611ff3cb3b845717bd8d318e14e62e (diff) | |
download | bcm5719-llvm-4c1e9541d34585aac1bbb54cb9d3f93ab108fe00.tar.gz bcm5719-llvm-4c1e9541d34585aac1bbb54cb9d3f93ab108fe00.zip |
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
llvm-svn: 66260
Diffstat (limited to 'llvm/lib/Analysis')
-rw-r--r-- | llvm/lib/Analysis/LoopPass.cpp | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/llvm/lib/Analysis/LoopPass.cpp b/llvm/lib/Analysis/LoopPass.cpp index c45c2ef4c0b..c4ff9889446 100644 --- a/llvm/lib/Analysis/LoopPass.cpp +++ b/llvm/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, ""); |