summaryrefslogtreecommitdiffstats
path: root/clang/lib/Basic
diff options
context:
space:
mode:
authorDan Gohman <dan433584@gmail.com>2015-09-14 21:49:41 +0000
committerDan Gohman <dan433584@gmail.com>2015-09-14 21:49:41 +0000
commitab0e31fa351660c2a537c5fe99bbc7b5929016c3 (patch)
tree59d9c29e44c1df0a54104bd4d20ebfbc5c888011 /clang/lib/Basic
parent798f3079d4d24e71b3c2b61ad1c2e6f807d308c0 (diff)
downloadbcm5719-llvm-ab0e31fa351660c2a537c5fe99bbc7b5929016c3.tar.gz
bcm5719-llvm-ab0e31fa351660c2a537c5fe99bbc7b5929016c3.zip
[WebAssembly] Use "long long" for int_fast64_t and int_least64_t on wasm64
This makes int_fast64_t and int_least64_t the same type as int64_t, and eliminates a difference between wasm32 and wasm64. Differential Revision: http://reviews.llvm.org/D12861 llvm-svn: 247622
Diffstat (limited to 'clang/lib/Basic')
-rw-r--r--clang/lib/Basic/Targets.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/clang/lib/Basic/Targets.cpp b/clang/lib/Basic/Targets.cpp
index 16593b9b224..2007f01c2ad 100644
--- a/clang/lib/Basic/Targets.cpp
+++ b/clang/lib/Basic/Targets.cpp
@@ -7069,6 +7069,19 @@ private:
const char *getClobbers() const final { return ""; }
bool isCLZForZeroUndef() const final { return false; }
bool hasInt128Type() const final { return true; }
+ IntType getIntTypeByWidth(unsigned BitWidth,
+ bool IsSigned) const final {
+ // WebAssembly prefers long long for explicitly 64-bit integers.
+ return BitWidth == 64 ? (IsSigned ? SignedLongLong : UnsignedLongLong)
+ : TargetInfo::getIntTypeByWidth(BitWidth, IsSigned);
+ }
+ IntType getLeastIntTypeByWidth(unsigned BitWidth,
+ bool IsSigned) const final {
+ // WebAssembly uses long long for int_least64_t and int_fast64_t.
+ return BitWidth == 64
+ ? (IsSigned ? SignedLongLong : UnsignedLongLong)
+ : TargetInfo::getLeastIntTypeByWidth(BitWidth, IsSigned);
+ }
};
const Builtin::Info WebAssemblyTargetInfo::BuiltinInfo[] = {
OpenPOWER on IntegriCloud