Add Triple matching for pic16 arch and solaris OS.

- Patch by Yonggang Luo.

llvm-svn: 79314
This commit is contained in:
Daniel Dunbar 2009-08-18 04:43:27 +00:00
parent 63d3fa5f3b
commit 781f94d7fe
2 changed files with 10 additions and 2 deletions

View File

@ -43,6 +43,7 @@ public:
mips, // MIPS: mips, mipsallegrex mips, // MIPS: mips, mipsallegrex
mipsel, // MIPSEL: mipsel, mipsallegrexel, psp mipsel, // MIPSEL: mipsel, mipsallegrexel, psp
msp430, // MPS430: msp430 msp430, // MPS430: msp430
pic16, // PIC16: pic16
ppc, // PPC: powerpc ppc, // PPC: powerpc
ppc64, // PPC64: powerpc64 ppc64, // PPC64: powerpc64
sparc, // Sparc: sparc sparc, // Sparc: sparc
@ -73,6 +74,7 @@ public:
MinGW64, MinGW64,
NetBSD, NetBSD,
OpenBSD, OpenBSD,
Solaris,
Win32 Win32
}; };

View File

@ -28,6 +28,7 @@ const char *Triple::getArchTypeName(ArchType Kind) {
case mips: return "mips"; case mips: return "mips";
case mipsel: return "mipsel"; case mipsel: return "mipsel";
case msp430: return "msp430"; case msp430: return "msp430";
case pic16: return "pic16";
case ppc64: return "powerpc64"; case ppc64: return "powerpc64";
case ppc: return "powerpc"; case ppc: return "powerpc";
case sparc: return "sparc"; case sparc: return "sparc";
@ -66,6 +67,7 @@ const char *Triple::getOSTypeName(OSType Kind) {
case MinGW64: return "mingw64"; case MinGW64: return "mingw64";
case NetBSD: return "netbsd"; case NetBSD: return "netbsd";
case OpenBSD: return "openbsd"; case OpenBSD: return "openbsd";
case Solaris: return "solaris";
case Win32: return "win32"; case Win32: return "win32";
} }
@ -87,6 +89,8 @@ Triple::ArchType Triple::getArchTypeForLLVMName(const StringRef &Name) {
return mipsel; return mipsel;
if (Name == "msp430") if (Name == "msp430")
return msp430; return msp430;
if (Name == "pic16")
return pic16;
if (Name == "ppc64") if (Name == "ppc64")
return ppc64; return ppc64;
if (Name == "ppc") if (Name == "ppc")
@ -119,6 +123,8 @@ void Triple::Parse() const {
Arch = x86; Arch = x86;
else if (ArchName == "amd64" || ArchName == "x86_64") else if (ArchName == "amd64" || ArchName == "x86_64")
Arch = x86_64; Arch = x86_64;
else if (ArchName == "pic16")
Arch = pic16;
else if (ArchName == "powerpc") else if (ArchName == "powerpc")
Arch = ppc; Arch = ppc;
else if (ArchName == "powerpc64") else if (ArchName == "powerpc64")
@ -144,8 +150,6 @@ void Triple::Parse() const {
Arch = sparc; Arch = sparc;
else if (ArchName == "s390x") else if (ArchName == "s390x")
Arch = systemz; Arch = systemz;
else if (ArchName == "bfin")
Arch = bfin;
else else
Arch = UnknownArch; Arch = UnknownArch;
@ -178,6 +182,8 @@ void Triple::Parse() const {
OS = NetBSD; OS = NetBSD;
else if (OSName.startswith("openbsd")) else if (OSName.startswith("openbsd"))
OS = OpenBSD; OS = OpenBSD;
else if (OSName.startswith("solaris"))
OS = Solaris;
else if (OSName.startswith("win32")) else if (OSName.startswith("win32"))
OS = Win32; OS = Win32;
else else