[Driver] Error if ARM mode was selected explicitly for M-profile CPUs.
authorFlorian Hahn <florian.hahn@arm.com>
Fri, 4 Aug 2017 10:40:18 +0000 (10:40 +0000)
committerFlorian Hahn <florian.hahn@arm.com>
Fri, 4 Aug 2017 10:40:18 +0000 (10:40 +0000)
commit83e57c2327028e39ef9b6e9cb3c85c85556e6c92
tree41f32de0d19153fa132cfcad8229f61941b6bf16
parentce6080819ce8fe0f9cd77f327814574eb68c0d49
[Driver] Error if ARM mode was selected explicitly for M-profile CPUs.

Summary:
M-class profiles do not support ARM execution mode, so providing
-marm/-mno-thumb does not make sense in combination with -mcpu/-march
options that support the M-profile.

This is a follow-up patch to D35569 and it seemed pretty clear that we
should emit an error in the driver in this case.

We probably also should warn/error if the provided -mcpu/-march options
do not match, e.g. -mcpu=cortex-m0 -march=armv8-a is invalid, as
cortex-m0 does not support armv8-a. But that should be a separate patch
I think.

Reviewers: echristo, richard.barton.arm, rengolin, labrinea, charles.baylis

Reviewed By: rengolin

Subscribers: aemerson, javed.absar, kristof.beyls, cfe-commits

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

llvm-svn: 310047
clang/include/clang/Basic/DiagnosticDriverKinds.td
clang/lib/Driver/ToolChain.cpp
clang/test/Driver/arm-thumb-only-cores.c [new file with mode: 0644]