Add 'shave' processor name to Triple

Based on ArchType, Clang's driver can select a non-Clang compiler.
String parsing in Clang would have sufficed if it were only that,
however this change anticipates true llvm support.

Differential Revision: http://reviews.llvm.org/D10413

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239631 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Douglas Katzman 2015-06-12 18:31:38 +00:00
parent d25af8c396
commit 2086b2e76a
2 changed files with 9 additions and 1 deletions

View File

@ -84,7 +84,8 @@ public:
spir, // SPIR: standard portable IR for OpenCL 32-bit version spir, // SPIR: standard portable IR for OpenCL 32-bit version
spir64, // SPIR: standard portable IR for OpenCL 64-bit version spir64, // SPIR: standard portable IR for OpenCL 64-bit version
kalimba, // Kalimba: generic kalimba kalimba, // Kalimba: generic kalimba
LastArchType = kalimba shave, // SHAVE: Movidius vector VLIW processors
LastArchType = shave
}; };
enum SubArchType { enum SubArchType {
NoSubArch, NoSubArch,

View File

@ -59,6 +59,7 @@ const char *Triple::getArchTypeName(ArchType Kind) {
case spir: return "spir"; case spir: return "spir";
case spir64: return "spir64"; case spir64: return "spir64";
case kalimba: return "kalimba"; case kalimba: return "kalimba";
case shave: return "shave";
} }
llvm_unreachable("Invalid ArchType!"); llvm_unreachable("Invalid ArchType!");
@ -120,6 +121,7 @@ const char *Triple::getArchTypePrefix(ArchType Kind) {
case spir: case spir:
case spir64: return "spir"; case spir64: return "spir";
case kalimba: return "kalimba"; case kalimba: return "kalimba";
case shave: return "shave";
} }
} }
@ -252,6 +254,7 @@ Triple::ArchType Triple::getArchTypeForLLVMName(StringRef Name) {
.Case("spir", spir) .Case("spir", spir)
.Case("spir64", spir64) .Case("spir64", spir64)
.Case("kalimba", kalimba) .Case("kalimba", kalimba)
.Case("shave", shave)
.Default(UnknownArch); .Default(UnknownArch);
} }
@ -356,6 +359,7 @@ static Triple::ArchType parseArch(StringRef ArchName) {
.Case("spir", Triple::spir) .Case("spir", Triple::spir)
.Case("spir64", Triple::spir64) .Case("spir64", Triple::spir64)
.StartsWith("kalimba", Triple::kalimba) .StartsWith("kalimba", Triple::kalimba)
.Case("shave", Triple::shave)
.Default(Triple::UnknownArch); .Default(Triple::UnknownArch);
} }
@ -1004,6 +1008,7 @@ static unsigned getArchPointerBitWidth(llvm::Triple::ArchType Arch) {
case llvm::Triple::hsail: case llvm::Triple::hsail:
case llvm::Triple::spir: case llvm::Triple::spir:
case llvm::Triple::kalimba: case llvm::Triple::kalimba:
case llvm::Triple::shave:
return 32; return 32;
case llvm::Triple::aarch64: case llvm::Triple::aarch64:
@ -1075,6 +1080,7 @@ Triple Triple::get32BitArchVariant() const {
case Triple::thumbeb: case Triple::thumbeb:
case Triple::x86: case Triple::x86:
case Triple::xcore: case Triple::xcore:
case Triple::shave:
// Already 32-bit. // Already 32-bit.
break; break;
@ -1107,6 +1113,7 @@ Triple Triple::get64BitArchVariant() const {
case Triple::thumbeb: case Triple::thumbeb:
case Triple::xcore: case Triple::xcore:
case Triple::sparcel: case Triple::sparcel:
case Triple::shave:
T.setArch(UnknownArch); T.setArch(UnknownArch);
break; break;