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
This commit is contained in:
Chris Lattner
2009-03-06 06:45:05 +00:00
parent 7157228a58
commit d6f16587ab
3 changed files with 129 additions and 90 deletions
+7 -5
View File
@@ -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, "");