13
13
14
14
#include " BreakpointPrinter.h"
15
15
#include " NewPMDriver.h"
16
- #include " PassPrinters.h"
17
16
#include " llvm/ADT/Triple.h"
18
17
#include " llvm/Analysis/CallGraph.h"
19
18
#include " llvm/Analysis/CallGraphSCCPass.h"
@@ -199,10 +198,6 @@ DisableBuiltins("disable-builtin",
199
198
cl::desc (" Disable specific target library builtin function" ),
200
199
cl::ZeroOrMore);
201
200
202
- static cl::opt<bool >
203
- AnalyzeOnly (" analyze" , cl::desc(" Only perform analysis, no optimization. "
204
- " Legacy pass manager only." ));
205
-
206
201
static cl::opt<bool > EnableDebugify (
207
202
" enable-debugify" ,
208
203
cl::desc (
@@ -603,11 +598,6 @@ int main(int argc, char **argv) {
603
598
604
599
LLVMContext Context;
605
600
606
- if (AnalyzeOnly && NoOutput) {
607
- errs () << argv[0 ] << " : analyze mode conflicts with no-output mode.\n " ;
608
- return 1 ;
609
- }
610
-
611
601
// If `-passes=` is specified, use NPM.
612
602
// If `-enable-new-pm` is specified and there are no codegen passes, use NPM.
613
603
// e.g. `-enable-new-pm -sroa` will use NPM.
@@ -756,7 +746,7 @@ int main(int argc, char **argv) {
756
746
// If the output is set to be emitted to standard out, and standard out is a
757
747
// console, print out a warning message and refuse to do it. We don't
758
748
// impress anyone by spewing tons of binary goo to a terminal.
759
- if (!Force && !NoOutput && !AnalyzeOnly && ! OutputAssembly)
749
+ if (!Force && !NoOutput && !OutputAssembly)
760
750
if (CheckBitcodeOutputToConsole (Out->os ()))
761
751
NoOutput = true ;
762
752
@@ -783,13 +773,6 @@ int main(int argc, char **argv) {
783
773
}
784
774
785
775
if (UseNPM) {
786
- if (AnalyzeOnly) {
787
- errs () << " Cannot specify -analyze under new pass manager, either "
788
- " specify '-enable-new-pm=0', or use the corresponding new pass "
789
- " manager pass, e.g. '-passes=print<scalar-evolution>'. For a "
790
- " full list of passes, see the '--print-passes' flag.\n " ;
791
- return 1 ;
792
- }
793
776
if (legacy::debugPassSpecified ()) {
794
777
errs ()
795
778
<< " -debug-pass does not work with the new PM, either use "
@@ -963,30 +946,8 @@ int main(int argc, char **argv) {
963
946
else
964
947
errs () << argv[0 ] << " : cannot create pass: "
965
948
<< PassInf->getPassName () << " \n " ;
966
- if (P) {
967
- PassKind Kind = P->getPassKind ();
949
+ if (P)
968
950
addPass (Passes, P);
969
-
970
- if (AnalyzeOnly) {
971
- switch (Kind) {
972
- case PT_Region:
973
- Passes.add (createRegionPassPrinter (PassInf, Out->os ()));
974
- break ;
975
- case PT_Loop:
976
- Passes.add (createLoopPassPrinter (PassInf, Out->os ()));
977
- break ;
978
- case PT_Function:
979
- Passes.add (createFunctionPassPrinter (PassInf, Out->os ()));
980
- break ;
981
- case PT_CallGraphSCC:
982
- Passes.add (createCallGraphPassPrinter (PassInf, Out->os ()));
983
- break ;
984
- default :
985
- Passes.add (createModulePassPrinter (PassInf, Out->os ()));
986
- break ;
987
- }
988
- }
989
- }
990
951
}
991
952
992
953
if (OptLevelO0)
@@ -1039,7 +1000,7 @@ int main(int argc, char **argv) {
1039
1000
std::unique_ptr<raw_svector_ostream> BOS;
1040
1001
raw_ostream *OS = nullptr ;
1041
1002
1042
- const bool ShouldEmitOutput = !NoOutput && !AnalyzeOnly ;
1003
+ const bool ShouldEmitOutput = !NoOutput;
1043
1004
1044
1005
// Write bitcode or assembly to the output as the last step...
1045
1006
if (ShouldEmitOutput || RunTwice) {
0 commit comments