diff --git a/llvm/lib/IR/LegacyPassManager.cpp b/llvm/lib/IR/LegacyPassManager.cpp --- a/llvm/lib/IR/LegacyPassManager.cpp +++ b/llvm/lib/IR/LegacyPassManager.cpp @@ -52,15 +52,14 @@ }; } // namespace -static cl::opt -PassDebugging("debug-pass", cl::Hidden, - cl::desc("Print PassManager debugging information"), - cl::values( - clEnumVal(Disabled , "disable debug output"), - clEnumVal(Arguments , "print pass arguments to pass to 'opt'"), - clEnumVal(Structure , "print pass structure before run()"), - clEnumVal(Executions, "print pass name before it is executed"), - clEnumVal(Details , "print pass details when it is executed"))); +static cl::opt PassDebugging( + "debug-pass", cl::Hidden, + cl::desc("Print legacy PassManager debugging information"), + cl::values(clEnumVal(Disabled, "disable debug output"), + clEnumVal(Arguments, "print pass arguments to pass to 'opt'"), + clEnumVal(Structure, "print pass structure before run()"), + clEnumVal(Executions, "print pass name before it is executed"), + clEnumVal(Details, "print pass details when it is executed"))); /// isPassDebuggingExecutionsOrMore - Return true if -debug-pass=Executions /// or higher is specified. diff --git a/llvm/tools/opt/opt.cpp b/llvm/tools/opt/opt.cpp --- a/llvm/tools/opt/opt.cpp +++ b/llvm/tools/opt/opt.cpp @@ -66,14 +66,15 @@ // The OptimizationList is automatically populated with registered Passes by the // PassNameParser. -// -static cl::list -PassList(cl::desc("Optimizations available:")); +static cl::list PassList(cl::desc( + "Optimizations available (use '-passes=' for the new pass manager)")); -static cl::opt - EnableNewPassManager("enable-new-pm", - cl::desc("Enable the new pass manager"), - cl::init(LLVM_ENABLE_NEW_PASS_MANAGER)); +static cl::opt EnableNewPassManager( + "enable-new-pm", + cl::desc("Enable the new pass manager, translating " + "'opt -foo' to 'opt -passes=foo'. This is strictly for the new PM " + "migration, use '-passes=' when possible."), + cl::init(LLVM_ENABLE_NEW_PASS_MANAGER)); // This flag specifies a textual description of the optimization pass pipeline // to run over the module. This flag switches opt to use the new pass manager @@ -84,8 +85,6 @@ cl::desc("A textual description of the pass pipeline for optimizing"), cl::Hidden); -// Other command line options... -// static cl::opt InputFilename(cl::Positional, cl::desc(""), cl::init("-"), cl::value_desc("filename")); @@ -142,44 +141,46 @@ StripNamedMetadata("strip-named-metadata", cl::desc("Strip module-level named metadata")); -static cl::opt DisableInline("disable-inlining", - cl::desc("Do not run the inliner pass")); +static cl::opt + DisableInline("disable-inlining", + cl::desc("Do not run the inliner pass (legacy PM only)")); static cl::opt DisableOptimizations("disable-opt", cl::desc("Do not run any optimization passes")); -static cl::opt -StandardLinkOpts("std-link-opts", - cl::desc("Include the standard link time optimizations")); +static cl::opt StandardLinkOpts( + "std-link-opts", + cl::desc("Include the standard link time optimizations (legacy PM only)")); static cl::opt -OptLevelO0("O0", - cl::desc("Optimization level 0. Similar to clang -O0")); + OptLevelO0("O0", cl::desc("Optimization level 0. Similar to clang -O0. " + "Use -passes='default' for the new PM")); static cl::opt -OptLevelO1("O1", - cl::desc("Optimization level 1. Similar to clang -O1")); + OptLevelO1("O1", cl::desc("Optimization level 1. Similar to clang -O1. " + "Use -passes='default' for the new PM")); static cl::opt -OptLevelO2("O2", - cl::desc("Optimization level 2. Similar to clang -O2")); + OptLevelO2("O2", cl::desc("Optimization level 2. Similar to clang -O2. " + "Use -passes='default' for the new PM")); static cl::opt -OptLevelOs("Os", - cl::desc("Like -O2 with extra optimizations for size. Similar to clang -Os")); + OptLevelOs("Os", cl::desc("Like -O2 but size-conscious. Similar to clang " + "-Os. Use -passes='default' for the new PM")); -static cl::opt -OptLevelOz("Oz", - cl::desc("Like -Os but reduces code size further. Similar to clang -Oz")); +static cl::opt OptLevelOz( + "Oz", + cl::desc("Like -O2 but optimize for code size above all else. Similar to " + "clang -Oz. Use -passes='default' for the new PM")); static cl::opt -OptLevelO3("O3", - cl::desc("Optimization level 3. Similar to clang -O3")); + OptLevelO3("O3", cl::desc("Optimization level 3. Similar to clang -O3. " + "Use -passes='default' for the new PM")); -static cl::opt -CodeGenOptLevel("codegen-opt-level", - cl::desc("Override optimization level for codegen hooks")); +static cl::opt CodeGenOptLevel( + "codegen-opt-level", + cl::desc("Override optimization level for codegen hooks, legacy PM only")); static cl::opt TargetTriple("mtriple", cl::desc("Override target triple for module")); @@ -205,7 +206,8 @@ cl::ZeroOrMore); static cl::opt -AnalyzeOnly("analyze", cl::desc("Only perform analysis, no optimization")); + AnalyzeOnly("analyze", cl::desc("Only perform analysis, no optimization. " + "Legacy pass manager only.")); static cl::opt EnableDebugify( "enable-debugify", @@ -231,10 +233,10 @@ cl::desc("Preserve use-list order when writing LLVM assembly."), cl::init(false), cl::Hidden); -static cl::opt - RunTwice("run-twice", - cl::desc("Run all passes twice, re-using the same pass manager."), - cl::init(false), cl::Hidden); +static cl::opt RunTwice("run-twice", + cl::desc("Run all passes twice, re-using the " + "same pass manager (legacy PM only)."), + cl::init(false), cl::Hidden); static cl::opt DiscardValueNames( "discard-value-names",