aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Gohman <sunfish@google.com>2014-02-20 17:23:43 -0800
committerDan Gohman <sunfish@google.com>2014-02-25 11:58:56 -0800
commit5653eb58d0b0068f0ef341c8928aa06d1d0ea3f7 (patch)
treee6b0e4f21406b7d07b5f0987dcfc58b791f09e98
parenta1df0ec9355e389c9152ddee8798f5774feb1f4e (diff)
Introduce the asmjs-unknown-emscripten target triple.
-rw-r--r--include/llvm/ADT/Triple.h4
-rw-r--r--lib/Support/Triple.cpp11
2 files changed, 14 insertions, 1 deletions
diff --git a/include/llvm/ADT/Triple.h b/include/llvm/ADT/Triple.h
index 7ee1d724e8..394dcb59c7 100644
--- a/include/llvm/ADT/Triple.h
+++ b/include/llvm/ADT/Triple.h
@@ -45,6 +45,7 @@ public:
arm, // ARM: arm, armv.*, xscale
aarch64, // AArch64: aarch64
+ asmjs, // asm.js: asmjs
hexagon, // Hexagon: hexagon
mips, // MIPS: mips, mipsallegrex
mipsel, // MIPSEL: mipsel, mipsallegrexel
@@ -65,7 +66,7 @@ public:
mblaze, // MBlaze: mblaze
nvptx, // NVPTX: 32-bit
nvptx64, // NVPTX: 64-bit
- le32, // le32: generic little-endian 32-bit CPU (PNaCl / Emscripten)
+ le32, // le32: generic little-endian 32-bit CPU (PNaCl)
amdil, // amdil: amd IL
spir, // SPIR: standard portable IR for OpenCL 32-bit version
spir64 // SPIR: standard portable IR for OpenCL 64-bit version
@@ -102,6 +103,7 @@ public:
Haiku,
Minix,
RTEMS,
+ Emscripten, // Emscripten
NaCl, // Native Client
CNK, // BG/P Compute-Node Kernel
Bitrig,
diff --git a/lib/Support/Triple.cpp b/lib/Support/Triple.cpp
index 412e34ccc5..4f17ded2ce 100644
--- a/lib/Support/Triple.cpp
+++ b/lib/Support/Triple.cpp
@@ -21,6 +21,7 @@ const char *Triple::getArchTypeName(ArchType Kind) {
case aarch64: return "aarch64";
case arm: return "arm";
+ case asmjs: return "asmjs";
case hexagon: return "hexagon";
case mips: return "mips";
case mipsel: return "mipsel";
@@ -57,6 +58,8 @@ const char *Triple::getArchTypePrefix(ArchType Kind) {
case aarch64: return "aarch64";
+ case asmjs: return "asmjs";
+
case arm:
case thumb: return "arm";
@@ -117,6 +120,7 @@ const char *Triple::getOSTypeName(OSType Kind) {
case Cygwin: return "cygwin";
case Darwin: return "darwin";
case DragonFly: return "dragonfly";
+ case Emscripten: return "emscripten";
case FreeBSD: return "freebsd";
case IOS: return "ios";
case KFreeBSD: return "kfreebsd";
@@ -182,6 +186,7 @@ Triple::ArchType Triple::getArchTypeForLLVMName(StringRef Name) {
.Case("nvptx", nvptx)
.Case("nvptx64", nvptx64)
.Case("le32", le32)
+ .Case("asmjs", asmjs)
.Case("amdil", amdil)
.Case("spir", spir)
.Case("spir64", spir64)
@@ -208,6 +213,7 @@ const char *Triple::getArchNameForAssembler() {
.Case("nvptx", "nvptx")
.Case("nvptx64", "nvptx64")
.Case("le32", "le32")
+ .Case("asmjs", "asmjs")
.Case("amdil", "amdil")
.Case("spir", "spir")
.Case("spir64", "spir64")
@@ -245,6 +251,7 @@ static Triple::ArchType parseArch(StringRef ArchName) {
.Case("nvptx", Triple::nvptx)
.Case("nvptx64", Triple::nvptx64)
.Case("le32", Triple::le32)
+ .Case("asmjs", Triple::asmjs)
.Case("amdil", Triple::amdil)
.Case("spir", Triple::spir)
.Case("spir64", Triple::spir64)
@@ -287,6 +294,7 @@ static Triple::OSType parseOS(StringRef OSName) {
.StartsWith("cnk", Triple::CNK)
.StartsWith("bitrig", Triple::Bitrig)
.StartsWith("aix", Triple::AIX)
+ .StartsWith("emscripten", Triple::Emscripten)
.Default(Triple::UnknownOS);
}
@@ -670,6 +678,7 @@ static unsigned getArchPointerBitWidth(llvm::Triple::ArchType Arch) {
case llvm::Triple::amdil:
case llvm::Triple::arm:
+ case llvm::Triple::asmjs:
case llvm::Triple::hexagon:
case llvm::Triple::le32:
case llvm::Triple::mblaze:
@@ -725,6 +734,7 @@ Triple Triple::get32BitArchVariant() const {
case Triple::amdil:
case Triple::spir:
case Triple::arm:
+ case Triple::asmjs:
case Triple::hexagon:
case Triple::le32:
case Triple::mblaze:
@@ -758,6 +768,7 @@ Triple Triple::get64BitArchVariant() const {
case Triple::UnknownArch:
case Triple::amdil:
case Triple::arm:
+ case Triple::asmjs:
case Triple::hexagon:
case Triple::le32:
case Triple::mblaze: