Skip to content

Commit bbede73

Browse files
committedAug 24, 2015
[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 llvm-svn: 245866
1 parent 87da150 commit bbede73

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed
 

‎clang/lib/Driver/Tools.cpp

+4
Original file line numberDiff line numberDiff line change
@@ -582,6 +582,10 @@ StringRef tools::arm::getARMFloatABI(const Driver &D, const ArgList &Args,
582582
FloatABI = "soft";
583583
}
584584
}
585+
586+
if (Triple.isOSDarwin() && FloatABI == "hard")
587+
D.Diag(diag::err_drv_unsupported_opt_for_target) << A->getAsString(Args)
588+
<< Triple.getArchName();
585589
}
586590

587591
// If unspecified, choose the default based on the platform.

‎clang/test/Driver/arm-float-abi.c

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
// RUN: not %clang %s -target armv7-apple-ios -mfloat-abi=hard 2>&1 | FileCheck -check-prefix=ARMV7-HARD %s
2+
// RUN: %clang %s -target armv7-apple-ios -mfloat-abi=softfp -### 2>&1 | FileCheck -check-prefix=ARMV7-SOFTFP %s
3+
4+
// ARMV7-HARD: unsupported option '-mfloat-abi=hard' for target 'thumbv7'
5+
// ARMV7-SOFTFP-NOT: unsupported option

0 commit comments

Comments
 (0)