diff options
author | Eli Friedman <eli.friedman@gmail.com> | 2009-07-01 03:36:11 +0000 |
---|---|---|
committer | Eli Friedman <eli.friedman@gmail.com> | 2009-07-01 03:36:11 +0000 |
commit | 3c7b6e46c5f9bdbe0676c52d80df98b68b02be99 (patch) | |
tree | 9f9f2a42bdd98e934d8f2df6e856de6b2109ef0c /lib/Basic/Targets.cpp | |
parent | 5ff8e8cd5114214f47e0066224bcfe6183330fe2 (diff) |
Fix for PR4192: fix the definition of int64_t on x86_64 Linux.
Note that I'm guessing that *BSD and Solaris do the same thing as Linux
here, but it's quite possible I'm wrong; if the following testcase
gives an error on x86-64 with gcc for any of those operating systems, please
tell me:
#include <stdint.h>
int64_t x; long x;
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74583 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Basic/Targets.cpp')
-rw-r--r-- | lib/Basic/Targets.cpp | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/lib/Basic/Targets.cpp b/lib/Basic/Targets.cpp index 286b2e166b..88dd6f797b 100644 --- a/lib/Basic/Targets.cpp +++ b/lib/Basic/Targets.cpp @@ -549,6 +549,9 @@ class PPC64TargetInfo : public PPCTargetInfo { public: PPC64TargetInfo(const std::string& triple) : PPCTargetInfo(triple) { LongWidth = LongAlign = PointerWidth = PointerAlign = 64; + IntMaxType = SignedLong; + UIntMaxType = UnsignedLong; + Int64Type = SignedLong; DescriptionString = "E-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-" "i64:64:64-f32:32:32-f64:64:64-v128:128:128"; } @@ -940,11 +943,11 @@ class X86_64TargetInfo : public X86TargetInfo { public: X86_64TargetInfo(const std::string &triple) : X86TargetInfo(triple) { LongWidth = LongAlign = PointerWidth = PointerAlign = 64; - DoubleAlign = LongLongAlign = 64; LongDoubleWidth = 128; LongDoubleAlign = 128; IntMaxType = SignedLong; UIntMaxType = UnsignedLong; + Int64Type = SignedLong; RegParmMax = 6; DescriptionString = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-" @@ -963,6 +966,16 @@ public: } // end anonymous namespace namespace { +class DarwinX86_64TargetInfo : public DarwinTargetInfo<X86_64TargetInfo> { +public: + DarwinX86_64TargetInfo(const std::string& triple) + : DarwinTargetInfo<X86_64TargetInfo>(triple) { + Int64Type = SignedLongLong; + } +}; +} // end anonymous namespace + +namespace { class ARMTargetInfo : public TargetInfo { enum { Armv4t, @@ -1363,7 +1376,7 @@ TargetInfo* TargetInfo::CreateTargetInfo(const std::string &T) { if (T.find("x86_64-") == 0 || T.find("amd64-") == 0) { if (isDarwin) - return new DarwinTargetInfo<X86_64TargetInfo>(T); + return new DarwinX86_64TargetInfo(T); if (isLinux) return new LinuxTargetInfo<X86_64TargetInfo>(T); if (isOpenBSD) |