]> granicus.if.org Git - clang/commit
[ARM] Add support for target("arm") and target("thumb").
authorFlorian Hahn <florian.hahn@arm.com>
Tue, 6 Jun 2017 09:26:15 +0000 (09:26 +0000)
committerFlorian Hahn <florian.hahn@arm.com>
Tue, 6 Jun 2017 09:26:15 +0000 (09:26 +0000)
commit84aa45a35c5cb99743e562fe81cd74c05458f1e6
tree1c9cca575fef98b3efc7afc8a45f96e5409c9584
parentc5df31ab20e56149bd4eca175e53ff2c380cd4ac
[ARM] Add support for target("arm") and target("thumb").

Summary:
This patch adds support for the target("arm") and target("thumb")
attributes, which can be used to force the compiler to generated ARM or
Thumb code for a function.

In LLVM, ARM or Thumb code generation can be controlled by the
thumb-mode target feature. But GCC already uses target("arm") and
target("thumb"), so we have to substitute "arm" with -thumb-mode and
"thumb" with +thumb-mode.

Reviewers: echristo, pcc, kristof.beyls

Reviewed By: echristo

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

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@304781 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Basic/Targets.cpp
test/CodeGen/arm-target-attr.c [new file with mode: 0644]