From f9c0d1b0562c4789638a91ce97f1c2d99608005b Mon Sep 17 00:00:00 2001 From: Fangrui Song Date: Wed, 9 Dec 2020 16:57:36 -0800 Subject: [Driver] Add -f[no-]legacy-pass-manager to supersede -f[no-]experimental-new-pass-manager The new PM is considered stable and many downstream groups have adopted it (some have adopted it for more than two years). Add -f[no-]legacy-pass-manager to reflect the fact that it is no longer experimental and the legacy pass manager is something we strive to retire. In the future, when the legacy PM eventually goes away, -fno-experimental-new-pass-manager and -flegacy-pass-manager will be removed. This patch also changes -f[no-]legacy-pass-manager to pass `-plugin-opt={new,legacy}-pass-manager` to the linker (supported by both ld.lld and LLVMgold.so) when -flto/-flto=thin is specified Reviewed By: aeubanks, rsmith Differential Revision: https://reviews.llvm.org/D92915 --- clang/lib/Frontend/CompilerInvocation.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'clang/lib/Frontend/CompilerInvocation.cpp') diff --git a/clang/lib/Frontend/CompilerInvocation.cpp b/clang/lib/Frontend/CompilerInvocation.cpp index 6d4e677..be5a644 100644 --- a/clang/lib/Frontend/CompilerInvocation.cpp +++ b/clang/lib/Frontend/CompilerInvocation.cpp @@ -1006,10 +1006,10 @@ static bool ParseCodeGenArgs(CodeGenOptions &Opts, ArgList &Args, InputKind IK, setPGOUseInstrumentor(Opts, Opts.ProfileInstrumentUsePath); Opts.ProfileRemappingFile = std::string(Args.getLastArgValue(OPT_fprofile_remapping_file_EQ)); - if (!Opts.ProfileRemappingFile.empty() && !Opts.ExperimentalNewPassManager) { + if (!Opts.ProfileRemappingFile.empty() && Opts.LegacyPassManager) { Diags.Report(diag::err_drv_argument_only_allowed_with) - << Args.getLastArg(OPT_fprofile_remapping_file_EQ)->getAsString(Args) - << "-fexperimental-new-pass-manager"; + << Args.getLastArg(OPT_fprofile_remapping_file_EQ)->getAsString(Args) + << "-fno-legacy-pass-manager"; } Opts.CoverageMapping = @@ -1051,9 +1051,9 @@ static bool ParseCodeGenArgs(CodeGenOptions &Opts, ArgList &Args, InputKind IK, // -ftime-report= is only for new pass manager. if (A->getOption().getID() == OPT_ftime_report_EQ) { - if (!Opts.ExperimentalNewPassManager) + if (Opts.LegacyPassManager) Diags.Report(diag::err_drv_argument_only_allowed_with) - << A->getAsString(Args) << "-fexperimental-new-pass-manager"; + << A->getAsString(Args) << "-fno-legacy-pass-manager"; StringRef Val = A->getValue(); if (Val == "per-pass") -- cgit v1.1