[llvm-commits] [llvm] r77124 - in /llvm/trunk: include/llvm/ADT/Triple.h lib/Support/Triple.cpp
Daniel Dunbar
daniel at zuster.org
Sat Jul 25 21:23:04 PDT 2009
Author: ddunbar
Date: Sat Jul 25 23:23:03 2009
New Revision: 77124
URL: http://llvm.org/viewvc/llvm-project?rev=77124&view=rev
Log:
Update for API change.
Modified:
llvm/trunk/include/llvm/ADT/Triple.h
llvm/trunk/lib/Support/Triple.cpp
Modified: llvm/trunk/include/llvm/ADT/Triple.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ADT/Triple.h?rev=77124&r1=77123&r2=77124&view=diff
==============================================================================
--- llvm/trunk/include/llvm/ADT/Triple.h (original)
+++ llvm/trunk/include/llvm/ADT/Triple.h Sat Jul 25 23:23:03 2009
@@ -36,10 +36,19 @@
enum ArchType {
UnknownArch,
- x86, // i?86
- ppc, // powerpc
- ppc64, // powerpc64
- x86_64, // amd64, x86_64
+ alpha, // alpha
+ arm, // arm, armv.*
+ cellspu, // spu, cellspu
+ mips, // mips, mipsallegrex
+ mipsel, // mipsel, mipsallegrexel, psp
+ msp430, // msp430
+ ppc, // powerpc
+ ppc64, // powerpc64
+ sparc, // sparc
+ systemz, // s390x
+ thumb, // thumb, thumbv.*
+ x86, // i[3-9]86
+ x86_64, // amd64, x86_64
InvalidArch
};
@@ -53,12 +62,15 @@
UnknownOS,
AuroraUX,
+ Cygwin,
Darwin,
DragonFly,
FreeBSD,
Linux,
+ MinGW32,
NetBSD,
- OpenBSD
+ OpenBSD,
+ Win32
};
private:
Modified: llvm/trunk/lib/Support/Triple.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/Triple.cpp?rev=77124&r1=77123&r2=77124&view=diff
==============================================================================
--- llvm/trunk/lib/Support/Triple.cpp (original)
+++ llvm/trunk/lib/Support/Triple.cpp Sat Jul 25 23:23:03 2009
@@ -20,11 +20,20 @@
switch (Kind) {
case InvalidArch: return "<invalid>";
case UnknownArch: return "unknown";
-
- case x86: return "i386";
- case x86_64: return "x86_64";
- case ppc: return "powerpc";
- case ppc64: return "powerpc64";
+
+ case alpha: return "alpha";
+ case arm: return "arm";
+ case cellspu: return "cellspu";
+ case mips: return "mips";
+ case mipsel: return "mipsel";
+ case msp430: return "msp430";
+ case sparc: return "sparc";
+ case systemz: return "s390x";
+ case thumb: return "thumb";
+ case x86: return "i386";
+ case x86_64: return "x86_64";
+ case ppc: return "powerpc";
+ case ppc64: return "powerpc64";
}
return "<invalid>";
@@ -46,12 +55,15 @@
case UnknownOS: return "unknown";
case AuroraUX: return "auroraux";
+ case Cygwin: return "cygwin";
case Darwin: return "darwin";
case DragonFly: return "dragonfly";
case FreeBSD: return "freebsd";
case Linux: return "linux";
+ case MinGW32: return "mingw32";
case NetBSD: return "netbsd";
case OpenBSD: return "openbsd";
+ case Win32: return "win32";
}
return "<invalid>";
@@ -64,7 +76,8 @@
StringRef ArchName = getArchName();
if (ArchName.size() == 4 && ArchName[0] == 'i' &&
- ArchName[2] == '8' && ArchName[3] == '6')
+ ArchName[2] == '8' && ArchName[3] == '6' &&
+ ArchName[1] - '3' < 6) // i[3-9]86
Arch = x86;
else if (ArchName == "amd64" || ArchName == "x86_64")
Arch = x86_64;
@@ -72,6 +85,27 @@
Arch = ppc;
else if (ArchName == "powerpc64")
Arch = ppc64;
+ else if (ArchName == "arm" ||
+ ArchName.startswith("armv"))
+ Arch = arm;
+ else if (ArchName == "thumb" ||
+ ArchName.startswith("thumbv"))
+ Arch = thumb;
+ else if (ArchName.startswith("alpha"))
+ Arch = alpha;
+ else if (ArchName == "spu" || ArchName == "cellspu")
+ Arch = cellspu;
+ else if (ArchName == "msp430")
+ Arch = msp430;
+ else if (ArchName == "mips" || ArchName == "mipsallegrex")
+ Arch = mips;
+ else if (ArchName == "mipsel" || ArchName == "mipsallegrexel" ||
+ ArchName == "psp")
+ Arch = mipsel;
+ else if (ArchName == "sparc")
+ Arch = sparc;
+ else if (ArchName == "s390x")
+ Arch = systemz;
else
Arch = UnknownArch;
@@ -86,6 +120,8 @@
StringRef OSName = getOSName();
if (OSName.startswith("auroraux"))
OS = AuroraUX;
+ else if (OSName.startswith("cygwin"))
+ OS = Cygwin;
else if (OSName.startswith("darwin"))
OS = Darwin;
else if (OSName.startswith("dragonfly"))
@@ -94,10 +130,14 @@
OS = FreeBSD;
else if (OSName.startswith("linux"))
OS = Linux;
+ else if (OSName.startswith("mingw32"))
+ OS = MinGW32;
else if (OSName.startswith("netbsd"))
OS = NetBSD;
else if (OSName.startswith("openbsd"))
OS = OpenBSD;
+ else if (OSName.startswith("win32"))
+ OS = Win32;
else
OS = UnknownOS;
More information about the llvm-commits
mailing list