aboutsummaryrefslogtreecommitdiff
path: root/lib/Support/Triple.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Support/Triple.cpp')
-rw-r--r--lib/Support/Triple.cpp35
1 files changed, 35 insertions, 0 deletions
diff --git a/lib/Support/Triple.cpp b/lib/Support/Triple.cpp
index 391c98656d..1cdaac0c2b 100644
--- a/lib/Support/Triple.cpp
+++ b/lib/Support/Triple.cpp
@@ -71,6 +71,41 @@ const char *Triple::getOSTypeName(OSType Kind) {
return "<invalid>";
}
+Triple::ArchType Triple::getArchTypeForLLVMName(const StringRef &Name) {
+ if (Name == "alpha")
+ return alpha;
+ if (Name == "arm")
+ return arm;
+ if (Name == "bfin")
+ return bfin;
+ if (Name == "cellspu")
+ return cellspu;
+ if (Name == "mips")
+ return mips;
+ if (Name == "mipsel")
+ return mipsel;
+ if (Name == "msp430")
+ return msp430;
+ if (Name == "ppc64")
+ return ppc64;
+ if (Name == "ppc")
+ return ppc;
+ if (Name == "sparc")
+ return sparc;
+ if (Name == "systemz")
+ return systemz;
+ if (Name == "thumb")
+ return thumb;
+ if (Name == "x86")
+ return x86;
+ if (Name == "x86_64")
+ return x86_64;
+ if (Name == "xcore")
+ return xcore;
+
+ return UnknownArch;
+}
+
//
void Triple::Parse() const {