[llvm-commits] [llvm] r113360 - /llvm/trunk/tools/opt/opt.cpp
Tobias Grosser
grosser at fim.uni-passau.de
Wed Sep 8 08:02:51 PDT 2010
Author: grosser
Date: Wed Sep 8 10:02:51 2010
New Revision: 113360
URL: http://llvm.org/viewvc/llvm-project?rev=113360&view=rev
Log:
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.
Modified:
llvm/trunk/tools/opt/opt.cpp
Modified: llvm/trunk/tools/opt/opt.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/opt/opt.cpp?rev=113360&r1=113359&r2=113360&view=diff
==============================================================================
--- llvm/trunk/tools/opt/opt.cpp (original)
+++ llvm/trunk/tools/opt/opt.cpp Wed Sep 8 10:02:51 2010
@@ -148,17 +148,16 @@
}
virtual bool runOnSCC(CallGraphSCC &SCC) {
- if (!Quiet) {
+ if (!Quiet)
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...
+ 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;
}
@@ -185,12 +184,11 @@
}
virtual bool runOnModule(Module &M) {
- if (!Quiet) {
+ if (!Quiet)
Out << "Printing analysis '" << PassToPrint->getPassName() << "':\n";
- getAnalysisID<Pass>(PassToPrint->getTypeInfo()).print(Out, &M);
- }
// Get and print pass...
+ getAnalysisID<Pass>(PassToPrint->getTypeInfo()).print(Out, &M);
return false;
}
@@ -216,10 +214,10 @@
}
virtual bool runOnFunction(Function &F) {
- if (!Quiet) {
+ if (!Quiet)
Out << "Printing analysis '" << PassToPrint->getPassName()
<< "' for function '" << F.getName() << "':\n";
- }
+
// Get and print pass...
getAnalysisID<Pass>(PassToPrint->getTypeInfo()).print(Out,
F.getParent());
@@ -250,12 +248,12 @@
virtual bool runOnLoop(Loop *L, LPPassManager &LPM) {
- if (!Quiet) {
+ if (!Quiet)
Out << "Printing analysis '" << PassToPrint->getPassName() << "':\n";
- getAnalysisID<Pass>(PassToPrint->getTypeInfo()).print(Out,
- L->getHeader()->getParent()->getParent());
- }
+
// Get and print pass...
+ getAnalysisID<Pass>(PassToPrint->getTypeInfo()).print(Out,
+ L->getHeader()->getParent()->getParent());
return false;
}
@@ -282,10 +280,9 @@
}
virtual bool runOnBasicBlock(BasicBlock &BB) {
- if (!Quiet) {
+ if (!Quiet)
Out << "Printing Analysis info for BasicBlock '" << BB.getName()
<< "': Pass " << PassToPrint->getPassName() << ":\n";
- }
// Get and print pass...
getAnalysisID<Pass>(PassToPrint->getTypeInfo()).print(Out,
More information about the llvm-commits
mailing list