diff --git a/llvm/test/Other/opt-legacy-syntax-deprecation.ll b/llvm/test/Other/opt-legacy-syntax-deprecation.ll --- a/llvm/test/Other/opt-legacy-syntax-deprecation.ll +++ b/llvm/test/Other/opt-legacy-syntax-deprecation.ll @@ -1,12 +1,12 @@ ; REQUIRES: x86-registered-target -; RUN: opt -temporarily-allow-old-pass-syntax /dev/null -disable-output 2>&1 | FileCheck %s --check-prefix=OK --allow-empty -; RUN: opt -temporarily-allow-old-pass-syntax /dev/null -disable-output -passes=instcombine 2>&1 | FileCheck %s --check-prefix=OK --allow-empty -; RUN: opt -temporarily-allow-old-pass-syntax /dev/null -disable-output -instcombine 2>&1 | FileCheck %s --check-prefix=WARN -; RUN: opt -temporarily-allow-old-pass-syntax /dev/null -disable-output -instcombine -globaldce 2>&1 | FileCheck %s --check-prefix=WARN -; RUN: opt -temporarily-allow-old-pass-syntax /dev/null -disable-output -instcombine -enable-new-pm=0 2>&1 | FileCheck %s --check-prefix=OK --allow-empty -; RUN: opt -temporarily-allow-old-pass-syntax /dev/null -disable-output -codegenprepare -mtriple=x86_64-unknown-linux-gnu 2>&1 | FileCheck %s --check-prefix=OK --allow-empty +; RUN: opt /dev/null -disable-output 2>&1 | FileCheck %s --check-prefix=OK --allow-empty +; RUN: opt /dev/null -disable-output -passes=instcombine 2>&1 | FileCheck %s --check-prefix=OK --allow-empty +; RUN: not opt /dev/null -disable-output -instcombine 2>&1 | FileCheck %s --check-prefix=WARN +; RUN: not opt /dev/null -disable-output -instcombine -globaldce 2>&1 | FileCheck %s --check-prefix=WARN +; RUN: opt /dev/null -disable-output -instcombine -enable-new-pm=0 2>&1 | FileCheck %s --check-prefix=OK --allow-empty +; RUN: opt /dev/null -disable-output -codegenprepare -mtriple=x86_64-unknown-linux-gnu 2>&1 | FileCheck %s --check-prefix=OK --allow-empty ; OK-NOT: deprecated -; WARN: The `opt -passname` syntax for the new pass manager is deprecated, please use `opt -passes=` (or the `-p` alias for a more concise version). +; WARN: The `opt -passname` syntax for the new pass manager is not supported, please use `opt -passes=` (or the `-p` alias for a more concise version). diff --git a/llvm/test/Other/opt-old-new-pm-passes.ll b/llvm/test/Other/opt-old-new-pm-passes.ll deleted file mode 100644 --- a/llvm/test/Other/opt-old-new-pm-passes.ll +++ /dev/null @@ -1,2 +0,0 @@ -; RUN: not opt -dce --passes=inline %s 2>&1 | FileCheck %s -; CHECK: Cannot specify passes via both -foo-pass and --passes=foo-pass 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 @@ -87,12 +87,6 @@ static cl::alias PassPipeline2("p", cl::aliasopt(PassPipeline), cl::desc("Alias for -passes")); -static cl::opt TemporarilyAllowOldPassesSyntax( - "temporarily-allow-old-pass-syntax", - cl::desc("Do not use in new tests. To be removed once all tests have " - "migrated."), - cl::init(false)); - static cl::opt PrintPasses("print-passes", cl::desc("Print available passes that can be " "specified in -passes=foo and exit")); @@ -487,6 +481,15 @@ const bool UseNPM = (EnableNewPassManager && !shouldForceLegacyPM()) || PassPipeline.getNumOccurrences() > 0; + if (UseNPM && !PassList.empty()) { + errs() << "The `opt -passname` syntax for the new pass manager is " + "not supported, please use `opt -passes=` (or the `-p` " + "alias for a more concise version).\n"; + errs() << "See https://llvm.org/docs/NewPassManager.html#invoking-opt " + "for more details on the pass pipeline syntax.\n\n"; + return 1; + } + if (!UseNPM && PluginList.size()) { errs() << argv[0] << ": " << PassPlugins.ArgStr << " specified with legacy PM.\n"; @@ -678,15 +681,6 @@ "-passes='default,other-pass'\n"; return 1; } - if (!PassList.empty()) { - errs() << "The `opt -passname` syntax for the new pass manager is " - "deprecated, please use `opt -passes=` (or the `-p` " - "alias for a more concise version).\n"; - errs() << "See https://llvm.org/docs/NewPassManager.html#invoking-opt " - "for more details on the pass pipeline syntax.\n\n"; - if (!TemporarilyAllowOldPassesSyntax) - return 1; - } std::string Pipeline = PassPipeline; SmallVector Passes;