[llvm-branch-commits] [llvm] 10f4057 - [clang][cli] Don't always emit -f[no-]legacy-pass-manager

Jan Svoboda via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Sat Dec 12 01:16:36 PST 2020


Author: Jan Svoboda
Date: 2020-12-12T10:11:23+01:00
New Revision: 10f40576f7b482dc55b9a0ba780c294c4e45817c

URL: https://github.com/llvm/llvm-project/commit/10f40576f7b482dc55b9a0ba780c294c4e45817c
DIFF: https://github.com/llvm/llvm-project/commit/10f40576f7b482dc55b9a0ba780c294c4e45817c.diff

LOG: [clang][cli] Don't always emit -f[no-]legacy-pass-manager

We don't need to always generate `-f[no-]experimental-new-pass-manager`.

This patch does not change the behavior of any other command line flag. (For example `-triple` is still being always generated.)

Reviewed By: dexonsmith, Bigcheese

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

Added: 
    

Modified: 
    clang/unittests/Frontend/CompilerInvocationTest.cpp
    llvm/include/llvm/Option/OptParser.td

Removed: 
    


################################################################################
diff  --git a/clang/unittests/Frontend/CompilerInvocationTest.cpp b/clang/unittests/Frontend/CompilerInvocationTest.cpp
index c2dc35ce5d32..d5b5d15b1071 100644
--- a/clang/unittests/Frontend/CompilerInvocationTest.cpp
+++ b/clang/unittests/Frontend/CompilerInvocationTest.cpp
@@ -198,7 +198,7 @@ TEST_F(CommandLineTest, BoolOptionDefaultArbitraryTwoFlagsPresentNone) {
 
   Invocation.generateCC1CommandLine(GeneratedArgs, *this);
 
-  ASSERT_THAT(GeneratedArgs, Contains(StrEq(PassManagerResetByFlag)));
+  ASSERT_THAT(GeneratedArgs, Not(Contains(StrEq(PassManagerResetByFlag))));
   ASSERT_THAT(GeneratedArgs, Not(Contains(StrEq(PassManagerChangedByFlag))));
 }
 
@@ -222,7 +222,7 @@ TEST_F(CommandLineTest, BoolOptionDefaultArbitraryTwoFlagsPresentReset) {
   ASSERT_EQ(Invocation.getCodeGenOpts().LegacyPassManager, PassManagerDefault);
 
   Invocation.generateCC1CommandLine(GeneratedArgs, *this);
-  ASSERT_THAT(GeneratedArgs, Contains(StrEq(PassManagerResetByFlag)));
+  ASSERT_THAT(GeneratedArgs, Not(Contains(StrEq(PassManagerResetByFlag))));
   ASSERT_THAT(GeneratedArgs, Not(Contains(StrEq(PassManagerChangedByFlag))));
 }
 

diff  --git a/llvm/include/llvm/Option/OptParser.td b/llvm/include/llvm/Option/OptParser.td
index 9a935b5d9e6e..f08dfd3ccf04 100644
--- a/llvm/include/llvm/Option/OptParser.td
+++ b/llvm/include/llvm/Option/OptParser.td
@@ -173,7 +173,6 @@ class MarshallingInfoBitfieldFlag<code keypath, code value>
 
 class MarshallingInfoBooleanFlag<code keypath, code defaultvalue, code neg_name, string neg_spelling>
   : MarshallingInfoFlag<keypath, defaultvalue> {
-  bit ShouldAlwaysEmit = 1;
   code Normalizer = "makeBooleanFlagNormalizer(OPT_"#neg_name#")";
   code Denormalizer = "makeBooleanFlagDenormalizer(\""#neg_spelling#"\")";
 }


        


More information about the llvm-branch-commits mailing list