r245866 - [ARM] Error out on apple darwin platforms if float-abi is "hard".

Akira Hatanaka via cfe-commits cfe-commits at lists.llvm.org
Mon Aug 24 12:50:36 PDT 2015


Author: ahatanak
Date: Mon Aug 24 14:50:35 2015
New Revision: 245866

URL: http://llvm.org/viewvc/llvm-project?rev=245866&view=rev
Log:
[ARM] Error out on apple darwin platforms if float-abi is "hard".

Error out if the user tries to use float-abi="hard" since it isn't
supported on darwin platforms. Previously clang issued no warnings or
erros and just passed the option to the backend, which had no effect on
code generation for targets using apcs.

rdar://problem/22257950

Differential Revision: http://reviews.llvm.org/D12155

Added:
    cfe/trunk/test/Driver/arm-float-abi.c
Modified:
    cfe/trunk/lib/Driver/Tools.cpp

Modified: cfe/trunk/lib/Driver/Tools.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/Tools.cpp?rev=245866&r1=245865&r2=245866&view=diff
==============================================================================
--- cfe/trunk/lib/Driver/Tools.cpp (original)
+++ cfe/trunk/lib/Driver/Tools.cpp Mon Aug 24 14:50:35 2015
@@ -582,6 +582,10 @@ StringRef tools::arm::getARMFloatABI(con
         FloatABI = "soft";
       }
     }
+
+    if (Triple.isOSDarwin() && FloatABI == "hard")
+      D.Diag(diag::err_drv_unsupported_opt_for_target) << A->getAsString(Args)
+                                                       << Triple.getArchName();
   }
 
   // If unspecified, choose the default based on the platform.

Added: cfe/trunk/test/Driver/arm-float-abi.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/arm-float-abi.c?rev=245866&view=auto
==============================================================================
--- cfe/trunk/test/Driver/arm-float-abi.c (added)
+++ cfe/trunk/test/Driver/arm-float-abi.c Mon Aug 24 14:50:35 2015
@@ -0,0 +1,5 @@
+// RUN: not %clang %s -target armv7-apple-ios -mfloat-abi=hard 2>&1 | FileCheck -check-prefix=ARMV7-HARD %s
+// RUN: %clang %s -target armv7-apple-ios -mfloat-abi=softfp -### 2>&1 | FileCheck -check-prefix=ARMV7-SOFTFP %s
+
+// ARMV7-HARD: unsupported option '-mfloat-abi=hard' for target 'thumbv7'
+// ARMV7-SOFTFP-NOT: unsupported option




More information about the cfe-commits mailing list