aboutsummaryrefslogtreecommitdiff
path: root/lib
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 /lib
parenta1df0ec9355e389c9152ddee8798f5774feb1f4e (diff)
Introduce the asmjs-unknown-emscripten target triple.
Diffstat (limited to 'lib')
-rw-r--r--lib/Support/Triple.cpp11
1 files changed, 11 insertions, 0 deletions
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: