Ver Fonte

Add -mcrbits/-mno-crbits to control the PowerPC CR-bit-tracking feature

The backend currently enables CR-bit tracking by default at -O2 and higher.
These flags allow the user to override that default.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@202453 91177308-0d34-0410-b5e6-96231b3b80d8
Hal Finkel há 11 anos atrás
pai
commit
c2606cec74
2 ficheiros alterados com 8 adições e 0 exclusões
  1. 2 0
      include/clang/Driver/Options.td
  2. 6 0
      test/Driver/ppc-features.cpp

+ 2 - 0
include/clang/Driver/Options.td

@@ -1090,6 +1090,8 @@ def mpopcntd : Flag<["-"], "mpopcntd">, Group<m_ppc_Features_Group>;
 def mno_popcntd : Flag<["-"], "mno-popcntd">, Group<m_ppc_Features_Group>;
 def mqpx : Flag<["-"], "mqpx">, Group<m_ppc_Features_Group>;
 def mno_qpx : Flag<["-"], "mno-qpx">, Group<m_ppc_Features_Group>;
+def mcrbits : Flag<["-"], "mcrbits">, Group<m_ppc_Features_Group>;
+def mno_crbits : Flag<["-"], "mno-crbits">, Group<m_ppc_Features_Group>;
 
 def faltivec : Flag<["-"], "faltivec">, Group<f_Group>, Flags<[CC1Option]>,
   HelpText<"Enable AltiVec vector initializer syntax">;

+ 6 - 0
test/Driver/ppc-features.cpp

@@ -92,3 +92,9 @@
 // RUN: %clang -target powerpc64-unknown-linux-gnu %s -mno-vsx -mvsx -### -o %t.o 2>&1 | FileCheck -check-prefix=CHECK-VSX %s
 // CHECK-VSX: "-target-feature" "+vsx"
 
+// RUN: %clang -target powerpc64-unknown-linux-gnu %s -mno-crbits -### -o %t.o 2>&1 | FileCheck -check-prefix=CHECK-NOCRBITS %s
+// CHECK-NOCRBITS: "-target-feature" "-crbits"
+
+// RUN: %clang -target powerpc64-unknown-linux-gnu %s -mno-crbits -mcrbits -### -o %t.o 2>&1 | FileCheck -check-prefix=CHECK-CRBITS %s
+// CHECK-CRBITS: "-target-feature" "+crbits"
+