summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Support/Triple.cpp
diff options
context:
space:
mode:
authorNick Lewycky <nicholas@mxc.ca>2010-09-07 18:14:24 +0000
committerNick Lewycky <nicholas@mxc.ca>2010-09-07 18:14:24 +0000
commit4c82c6c6fe784822d03d7554ebeae6812272cd90 (patch)
tree51df10fe42bf0be08fb217c33867d3a9146a2650 /llvm/lib/Support/Triple.cpp
parent2002e1f1bf7e9f6078fc789bbead3b63d04fe33f (diff)
downloadbcm5719-llvm-4c82c6c6fe784822d03d7554ebeae6812272cd90.tar.gz
bcm5719-llvm-4c82c6c6fe784822d03d7554ebeae6812272cd90.zip
Create PTX backend. Patch by Che-Liang Chiou!
llvm-svn: 113235
Diffstat (limited to 'llvm/lib/Support/Triple.cpp')
-rw-r--r--llvm/lib/Support/Triple.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/llvm/lib/Support/Triple.cpp b/llvm/lib/Support/Triple.cpp
index 3a95b65e690..365c0836953 100644
--- a/llvm/lib/Support/Triple.cpp
+++ b/llvm/lib/Support/Triple.cpp
@@ -41,6 +41,7 @@ const char *Triple::getArchTypeName(ArchType Kind) {
case x86_64: return "x86_64";
case xcore: return "xcore";
case mblaze: return "mblaze";
+ case ptx: return "ptx";
}
return "<invalid>";
@@ -70,7 +71,10 @@ const char *Triple::getArchTypePrefix(ArchType Kind) {
case x86:
case x86_64: return "x86";
+
case xcore: return "xcore";
+
+ case ptx: return "ptx";
}
}
@@ -149,6 +153,8 @@ Triple::ArchType Triple::getArchTypeForLLVMName(StringRef Name) {
return x86_64;
if (Name == "xcore")
return xcore;
+ if (Name == "ptx")
+ return ptx;
return UnknownArch;
}
@@ -187,6 +193,9 @@ Triple::ArchType Triple::getArchTypeForDarwinArchName(StringRef Str) {
Str == "armv6" || Str == "armv7")
return Triple::arm;
+ if (Str == "ptx")
+ return Triple::ptx;
+
return Triple::UnknownArch;
}
@@ -216,6 +225,8 @@ const char *Triple::getArchNameForAssembler() {
return "armv6";
if (Str == "armv7" || Str == "thumbv7")
return "armv7";
+ if (Str == "ptx")
+ return "ptx";
return NULL;
}
@@ -266,6 +277,8 @@ Triple::ArchType Triple::ParseArch(StringRef ArchName) {
return tce;
else if (ArchName == "xcore")
return xcore;
+ else if (ArchName == "ptx")
+ return ptx;
else
return UnknownArch;
}
OpenPOWER on IntegriCloud