[PATCH] D24245: [ARM] ARM-specific attributes should be accepted for big-endian

Oliver Stannard via cfe-commits cfe-commits at lists.llvm.org
Tue Sep 6 02:21:09 PDT 2016


olista01 created this revision.
olista01 added reviewers: rengolin, t.p.northover.
olista01 added a subscriber: cfe-commits.
olista01 set the repository for this revision to rL LLVM.
Herald added subscribers: samparker, rengolin, aemerson.

The ARM-specific C attributes (currently just interrupt) need to check
for both the big- and little-endian versions of the triples, so that
they are accepted for both big and little endian targets.

TargetWindows and TargetMicrosoftCXXABI also only use the little-endian
triples, but this is correct as windows is not supported on big-endian
ARM targets (and this is asserted in lib/Basic/Targets.cpp).

Repository:
  rL LLVM

https://reviews.llvm.org/D24245

Files:
  include/clang/Basic/Attr.td
  test/Sema/arm-interrupt-attr.c

Index: test/Sema/arm-interrupt-attr.c
===================================================================
--- test/Sema/arm-interrupt-attr.c
+++ test/Sema/arm-interrupt-attr.c
@@ -1,4 +1,7 @@
 // RUN: %clang_cc1 %s -triple arm-apple-darwin -verify -fsyntax-only
+// RUN: %clang_cc1 %s -triple thumb-apple-darwin -verify -fsyntax-only
+// RUN: %clang_cc1 %s -triple armeb-none-eabi -verify -fsyntax-only
+// RUN: %clang_cc1 %s -triple thumbeb-none-eabi -verify -fsyntax-only
 
 __attribute__((interrupt(IRQ))) void foo() {} // expected-error {{'interrupt' attribute requires a string}}
 __attribute__((interrupt("irq"))) void foo1() {} // expected-warning {{'interrupt' attribute argument not supported: irq}}
Index: include/clang/Basic/Attr.td
===================================================================
--- include/clang/Basic/Attr.td
+++ include/clang/Basic/Attr.td
@@ -254,7 +254,7 @@
   list<string> OSes;
   list<string> CXXABIs;
 }
-def TargetARM : TargetArch<["arm", "thumb"]>;
+def TargetARM : TargetArch<["arm", "thumb", "armeb", "thumbeb"]>;
 def TargetMips : TargetArch<["mips", "mipsel"]>;
 def TargetMSP430 : TargetArch<["msp430"]>;
 def TargetX86 : TargetArch<["x86"]>;


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D24245.70364.patch
Type: text/x-patch
Size: 1192 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20160906/c2daa376/attachment.bin>


More information about the cfe-commits mailing list