[llvm-branch-commits] [lld] 31e03a9 - [WebAssembly] Rename --lto-no-new-pass-manager to --no-lto-new-pass-manager

Fangrui Song via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Tue Dec 1 16:57:10 PST 2020


Author: Fangrui Song
Date: 2020-12-01T16:52:37-08:00
New Revision: 31e03a9bd9561e6b21e4e1f5b80a8316de624876

URL: https://github.com/llvm/llvm-project/commit/31e03a9bd9561e6b21e4e1f5b80a8316de624876
DIFF: https://github.com/llvm/llvm-project/commit/31e03a9bd9561e6b21e4e1f5b80a8316de624876.diff

LOG: [WebAssembly] Rename --lto-no-new-pass-manager to --no-lto-new-pass-manager

In addition, disallow `-lto-new-pass-manager` (see D79371).

Note: the ELF port has also adopted --no-lto-new-pass-manager

Reviewed By: aeubanks

Differential Revision: https://reviews.llvm.org/D92422

Added: 
    

Modified: 
    lld/test/wasm/lto/new-pass-manager.ll
    lld/wasm/Driver.cpp
    lld/wasm/Options.td

Removed: 
    


################################################################################
diff  --git a/lld/test/wasm/lto/new-pass-manager.ll b/lld/test/wasm/lto/new-pass-manager.ll
index 2f49c4d55df8..48829de8d378 100644
--- a/lld/test/wasm/lto/new-pass-manager.ll
+++ b/lld/test/wasm/lto/new-pass-manager.ll
@@ -1,6 +1,6 @@
 ; RUN: llvm-as -o %t.bc %s
 ; RUN: wasm-ld --lto-new-pass-manager --lto-debug-pass-manager -o /dev/null %t.bc 2>&1 | FileCheck %s
-; RUN: wasm-ld --lto-new-pass-manager --lto-debug-pass-manager --lto-no-new-pass-manager -o /dev/null %t.bc 2>&1 | FileCheck %s --allow-empty --check-prefix=LPM
+; RUN: wasm-ld --lto-new-pass-manager --lto-debug-pass-manager --no-lto-new-pass-manager -o /dev/null %t.bc 2>&1 | FileCheck %s --allow-empty --check-prefix=LPM
 
 ; CHECK: Starting llvm::Module pass manager run
 ; CHECK: Finished llvm::Module pass manager run

diff  --git a/lld/wasm/Driver.cpp b/lld/wasm/Driver.cpp
index d15cf40f6e5f..98a8d10f9dd3 100644
--- a/lld/wasm/Driver.cpp
+++ b/lld/wasm/Driver.cpp
@@ -380,7 +380,7 @@ static void readConfigs(opt::InputArgList &args) {
   config->ltoo = args::getInteger(args, OPT_lto_O, 2);
   config->ltoPartitions = args::getInteger(args, OPT_lto_partitions, 1);
   config->ltoNewPassManager = args.hasFlag(OPT_lto_new_pass_manager,
-                                           OPT_lto_no_new_pass_manager, false);
+                                           OPT_no_lto_new_pass_manager, false);
   config->ltoDebugPassManager = args.hasArg(OPT_lto_debug_pass_manager);
   config->mapFile = args.getLastArgValue(OPT_Map);
   config->optimize = args::getInteger(args, OPT_O, 0);

diff  --git a/lld/wasm/Options.td b/lld/wasm/Options.td
index 283fe3fc2931..92368b171fa9 100644
--- a/lld/wasm/Options.td
+++ b/lld/wasm/Options.td
@@ -17,6 +17,11 @@ multiclass B<string name, string help1, string help2> {
   def no_ # NAME: Flag<["--", "-"], "no-" # name>, HelpText<help2>;
 }
 
+multiclass BB<string name, string help1, string help2> {
+  def NAME: Flag<["--"], name>, HelpText<help1>;
+  def no_ # NAME: Flag<["--"], "no-" # name>, HelpText<help2>;
+}
+
 // The following flags are shared with the ELF linker
 def Bsymbolic: F<"Bsymbolic">, HelpText<"Bind defined symbols locally">;
 
@@ -215,10 +220,7 @@ def thinlto_cache_dir: J<"thinlto-cache-dir=">,
 defm thinlto_cache_policy: Eq<"thinlto-cache-policy", "Pruning policy for the ThinLTO cache">;
 def thinlto_jobs: J<"thinlto-jobs=">,
   HelpText<"Number of ThinLTO jobs. Default to --threads=">;
-def lto_new_pass_manager: F<"lto-new-pass-manager">,
-  HelpText<"Use new pass manager">;
-def lto_no_new_pass_manager: F<"lto-no-new-pass-manager">,
-  HelpText<"Use legacy pass manager">;
+defm lto_new_pass_manager: BB<"lto-new-pass-manager", "Use new pass manager", "Use legacy pass manager">;
 def lto_debug_pass_manager: F<"lto-debug-pass-manager">,
   HelpText<"Debug new pass manager">;
 


        


More information about the llvm-branch-commits mailing list