[cfe-commits] r90873 - in /cfe/trunk: include/clang/Driver/CC1Options.td lib/Driver/Tools.cpp test/Driver/clang-translation.c

Daniel Dunbar daniel at zuster.org
Tue Dec 8 11:49:51 PST 2009


Author: ddunbar
Date: Tue Dec  8 13:49:51 2009
New Revision: 90873

URL: http://llvm.org/viewvc/llvm-project?rev=90873&view=rev
Log:
Unbreak clang-cc handling of -msoft-float / -mfloat-abi=, which I borked.

Modified:
    cfe/trunk/include/clang/Driver/CC1Options.td
    cfe/trunk/lib/Driver/Tools.cpp
    cfe/trunk/test/Driver/clang-translation.c

Modified: cfe/trunk/include/clang/Driver/CC1Options.td
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Driver/CC1Options.td?rev=90873&r1=90872&r2=90873&view=diff

==============================================================================
--- cfe/trunk/include/clang/Driver/CC1Options.td (original)
+++ cfe/trunk/include/clang/Driver/CC1Options.td Tue Dec  8 13:49:51 2009
@@ -119,13 +119,13 @@
   HelpText<"Enable additional debug output">;
 def mdisable_fp_elim : Flag<"-mdisable-fp-elim">,
   HelpText<"Disable frame pointer elimination optimization">;
-def mfloat_abi : Flag<"-mfloat-abi">,
+def mfloat_abi : Separate<"-mfloat-abi">,
   HelpText<"The float ABI to use">;
 def mlimit_float_precision : Separate<"-mlimit-float-precision">,
   HelpText<"Limit float precision to the given value">;
 def mno_zero_initialized_in_bss : Flag<"-mno-zero-initialized-in-bss">,
   HelpText<"Do not put zero initialized data in the BSS">;
-def msoft_float : Separate<"-msoft-float">,
+def msoft_float : Flag<"-msoft-float">,
   HelpText<"Use software floating point">;
 def mrelocation_model : Separate<"-mrelocation-model">,
   HelpText<"The relocation model to use">;

Modified: cfe/trunk/lib/Driver/Tools.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/Tools.cpp?rev=90873&r1=90872&r2=90873&view=diff

==============================================================================
--- cfe/trunk/lib/Driver/Tools.cpp (original)
+++ cfe/trunk/lib/Driver/Tools.cpp Tue Dec  8 13:49:51 2009
@@ -419,14 +419,17 @@
     //
     // FIXME: This changes CPP defines, we need -target-soft-float.
     CmdArgs.push_back("-msoft-float");
-    CmdArgs.push_back("-mfloat-abi=soft");
+    CmdArgs.push_back("-mfloat-abi");
+    CmdArgs.push_back("soft");
   } else if (FloatABI == "softfp") {
     // Floating point operations are hard, but argument passing is soft.
-    CmdArgs.push_back("-mfloat-abi=soft");
+    CmdArgs.push_back("-mfloat-abi");
+    CmdArgs.push_back("soft");
   } else {
     // Floating point operations and argument passing are hard.
     assert(FloatABI == "hard" && "Invalid float abi!");
-    CmdArgs.push_back("-mfloat-abi=hard");
+    CmdArgs.push_back("-mfloat-abi");
+    CmdArgs.push_back("hard");
   }
 }
 

Modified: cfe/trunk/test/Driver/clang-translation.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/clang-translation.c?rev=90873&r1=90872&r2=90873&view=diff

==============================================================================
--- cfe/trunk/test/Driver/clang-translation.c (original)
+++ cfe/trunk/test/Driver/clang-translation.c Tue Dec  8 13:49:51 2009
@@ -13,3 +13,29 @@
 // RUN: grep '"-mcpu" "yonah"' %t.log
 // RUN: clang -ccc-host-triple x86_64-apple-darwin9 -### -S %s -o %t.s 2> %t.log
 // RUN: grep '"-mcpu" "core2"' %t.log
+
+// RUN: clang -ccc-host-triple x86_64-apple-darwin10 -### -S %s 2> %t.log \
+// RUN:   -arch armv7
+// RUN: FileCheck -check-prefix=ARMV7_DEFAULT %s < %t.log
+// ARMV7_DEFAULT: clang-cc"
+// ARMV7_DEFAULT-NOT: "-msoft-float"
+// ARMV7_DEFAULT: "-mfloat-abi" "soft"
+// ARMV7_DEFAULT-NOT: "-msoft-float"
+// ARMV7_DEFAULT: "-x" "c"
+
+// RUN: clang -ccc-host-triple x86_64-apple-darwin10 -### -S %s 2> %t.log \
+// RUN:   -arch armv7 -msoft-float
+// RUN: FileCheck -check-prefix=ARMV7_SOFTFLOAT %s < %t.log
+// ARMV7_SOFTFLOAT: clang-cc"
+// ARMV7_SOFTFLOAT: "-msoft-float"
+// ARMV7_SOFTFLOAT: "-mfloat-abi" "soft"
+// ARMV7_SOFTFLOAT: "-x" "c"
+
+// RUN: clang -ccc-host-triple x86_64-apple-darwin10 -### -S %s 2> %t.log \
+// RUN:   -arch armv7 -mhard-float
+// RUN: FileCheck -check-prefix=ARMV7_HARDFLOAT %s < %t.log
+// ARMV7_HARDFLOAT: clang-cc"
+// ARMV7_HARDFLOAT-NOT: "-msoft-float"
+// ARMV7_HARDFLOAT: "-mfloat-abi" "hard"
+// ARMV7_HARDFLOAT-NOT: "-msoft-float"
+// ARMV7_HARDFLOAT: "-x" "c"





More information about the cfe-commits mailing list