mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-27 05:10:41 +00:00
Simplify this logic of creating a default Features object.
llvm-svn: 103507
This commit is contained in:
parent
e27902ac68
commit
4769f124cd
@ -370,32 +370,14 @@ void SubtargetFeatures::getDefaultSubtargetFeatures(const std::string &CPU,
|
||||
const Triple& Triple) {
|
||||
setCPU(CPU);
|
||||
|
||||
const char *Attrs = 0;
|
||||
|
||||
switch (Triple.getVendor()) {
|
||||
case Triple::Apple:
|
||||
switch (Triple.getArch()) {
|
||||
case Triple::ppc: // powerpc-apple-*
|
||||
Attrs = "altivec";
|
||||
break;
|
||||
case Triple::ppc64: // powerpc64-apple-*
|
||||
Attrs = "64bit,altivec";
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
if (Triple.getVendor() == Triple::Apple) {
|
||||
if (Triple.getArch() == Triple::ppc) {
|
||||
// powerpc-apple-*
|
||||
AddFeature("altivec");
|
||||
} else if (Triple.getArch() == Triple::ppc64) {
|
||||
// powerpc64-apple-*
|
||||
AddFeature("64bit");
|
||||
AddFeature("altivec");
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
if (!Attrs) return;
|
||||
|
||||
StringRef SR(Attrs);
|
||||
|
||||
while (!SR.empty()) {
|
||||
std::pair<StringRef, StringRef> Res = SR.split(',');
|
||||
AddFeature(Res.first);
|
||||
SR = Res.second;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user