[cfe-commits] r81732 - in /cfe/trunk: lib/Basic/Targets.cpp test/Sema/align-arm-apcs.c
Daniel Dunbar
daniel at zuster.org
Sun Sep 13 17:02:24 PDT 2009
Author: ddunbar
Date: Sun Sep 13 19:02:24 2009
New Revision: 81732
URL: http://llvm.org/viewvc/llvm-project?rev=81732&view=rev
Log:
ARM target tweaks.
- Change TargetData string to match llvm-gcc.
- Some -target-abi support for 'apcs-gnu', most importantly the alignment of double and long long changes.
Added:
cfe/trunk/test/Sema/align-arm-apcs.c
Modified:
cfe/trunk/lib/Basic/Targets.cpp
Modified: cfe/trunk/lib/Basic/Targets.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Basic/Targets.cpp?rev=81732&r1=81731&r2=81732&view=diff
==============================================================================
--- cfe/trunk/lib/Basic/Targets.cpp (original)
+++ cfe/trunk/lib/Basic/Targets.cpp Sun Sep 13 19:02:24 2009
@@ -994,8 +994,11 @@
public:
ARMTargetInfo(const std::string& triple) : TargetInfo(triple) {
// FIXME: Are the defaults correct for ARM?
- DescriptionString = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-"
- "i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:64:64";
+ DescriptionString = ("e-p:32:32:32-i1:8:32-i8:8:32-i16:16:32-i32:32:32-"
+ "i64:32:32-f32:32:32-f64:32:32-"
+ "v64:64:64-v128:128:128-a0:0:32");
+ SizeType = UnsignedInt;
+ PtrDiffType = SignedInt;
if (triple.find("armv7-") == 0)
ArmArch = Armv7a;
else if (triple.find("arm-") == 0 || triple.find("armv6-") == 0)
@@ -1013,6 +1016,25 @@
ArmArch = Armv6;
}
}
+ virtual bool setABI(const std::string &Name) {
+ // The defaults (above) are for AAPCS, check if we need to change them.
+ //
+ // FIXME: We need support for -meabi... we could just mangle it into the
+ // name.
+ if (Name == "apcs-gnu") {
+ DoubleAlign = LongLongAlign = 32;
+ SizeType = UnsignedLong;
+
+ // FIXME: Override "preferred align" for double and long long.
+ } else if (Name == "aapcs") {
+ // FIXME: Enumerated types are variable width in straight AAPCS.
+ } else if (Name == "aapcs-linux") {
+ ;
+ } else
+ return false;
+
+ return true;
+ }
virtual void getTargetDefines(const LangOptions &Opts,
std::vector<char> &Defs) const {
// Target identification.
Added: cfe/trunk/test/Sema/align-arm-apcs.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Sema/align-arm-apcs.c?rev=81732&view=auto
==============================================================================
--- cfe/trunk/test/Sema/align-arm-apcs.c (added)
+++ cfe/trunk/test/Sema/align-arm-apcs.c Sun Sep 13 19:02:24 2009
@@ -0,0 +1,4 @@
+// RUN: clang-cc -triple arm-unknown-unknown -target-abi=apcs-gnu -fsyntax-only -verify %s
+
+struct s0 { double f0; int f1; };
+char chk0[__alignof__(struct s0) == 4 ? 1 : -1];
More information about the cfe-commits
mailing list