1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-23 03:02:36 +01:00

Execute all Pass Printers even if -quiet is set.

Follow the same logic in the LoopPass, ModulePass and CallGraphSCCPass printers,
as it was already used in the BasicBlockPass and FunctionPass printers. This is
more consistent.

The other option would have been to completely disable dumping the analysis
information. However, as this information is the only information printed if the
-analysis flag is set, calling opt would not do anything at all.

llvm-svn: 113360
This commit is contained in:
Tobias Grosser 2010-09-08 15:02:51 +00:00
parent 184dc25d98
commit 001e8a9350

View File

@ -148,17 +148,16 @@ struct CallGraphSCCPassPrinter : public CallGraphSCCPass {
} }
virtual bool runOnSCC(CallGraphSCC &SCC) { virtual bool runOnSCC(CallGraphSCC &SCC) {
if (!Quiet) { if (!Quiet)
Out << "Printing analysis '" << PassToPrint->getPassName() << "':\n"; Out << "Printing analysis '" << PassToPrint->getPassName() << "':\n";
for (CallGraphSCC::iterator I = SCC.begin(), E = SCC.end(); I != E; ++I) {
Function *F = (*I)->getFunction();
if (F)
getAnalysisID<Pass>(PassToPrint->getTypeInfo()).print(Out,
F->getParent());
}
}
// Get and print pass... // Get and print pass...
for (CallGraphSCC::iterator I = SCC.begin(), E = SCC.end(); I != E; ++I) {
Function *F = (*I)->getFunction();
if (F)
getAnalysisID<Pass>(PassToPrint->getTypeInfo()).print(Out,
F->getParent());
}
return false; return false;
} }
@ -185,12 +184,11 @@ struct ModulePassPrinter : public ModulePass {
} }
virtual bool runOnModule(Module &M) { virtual bool runOnModule(Module &M) {
if (!Quiet) { if (!Quiet)
Out << "Printing analysis '" << PassToPrint->getPassName() << "':\n"; Out << "Printing analysis '" << PassToPrint->getPassName() << "':\n";
getAnalysisID<Pass>(PassToPrint->getTypeInfo()).print(Out, &M);
}
// Get and print pass... // Get and print pass...
getAnalysisID<Pass>(PassToPrint->getTypeInfo()).print(Out, &M);
return false; return false;
} }
@ -216,10 +214,10 @@ struct FunctionPassPrinter : public FunctionPass {
} }
virtual bool runOnFunction(Function &F) { virtual bool runOnFunction(Function &F) {
if (!Quiet) { if (!Quiet)
Out << "Printing analysis '" << PassToPrint->getPassName() Out << "Printing analysis '" << PassToPrint->getPassName()
<< "' for function '" << F.getName() << "':\n"; << "' for function '" << F.getName() << "':\n";
}
// Get and print pass... // Get and print pass...
getAnalysisID<Pass>(PassToPrint->getTypeInfo()).print(Out, getAnalysisID<Pass>(PassToPrint->getTypeInfo()).print(Out,
F.getParent()); F.getParent());
@ -250,12 +248,12 @@ struct LoopPassPrinter : public LoopPass {
virtual bool runOnLoop(Loop *L, LPPassManager &LPM) { virtual bool runOnLoop(Loop *L, LPPassManager &LPM) {
if (!Quiet) { if (!Quiet)
Out << "Printing analysis '" << PassToPrint->getPassName() << "':\n"; Out << "Printing analysis '" << PassToPrint->getPassName() << "':\n";
getAnalysisID<Pass>(PassToPrint->getTypeInfo()).print(Out,
L->getHeader()->getParent()->getParent());
}
// Get and print pass... // Get and print pass...
getAnalysisID<Pass>(PassToPrint->getTypeInfo()).print(Out,
L->getHeader()->getParent()->getParent());
return false; return false;
} }
@ -282,10 +280,9 @@ struct BasicBlockPassPrinter : public BasicBlockPass {
} }
virtual bool runOnBasicBlock(BasicBlock &BB) { virtual bool runOnBasicBlock(BasicBlock &BB) {
if (!Quiet) { if (!Quiet)
Out << "Printing Analysis info for BasicBlock '" << BB.getName() Out << "Printing Analysis info for BasicBlock '" << BB.getName()
<< "': Pass " << PassToPrint->getPassName() << ":\n"; << "': Pass " << PassToPrint->getPassName() << ":\n";
}
// Get and print pass... // Get and print pass...
getAnalysisID<Pass>(PassToPrint->getTypeInfo()).print(Out, getAnalysisID<Pass>(PassToPrint->getTypeInfo()).print(Out,