Replace string matching with a switch on Triple::getEnvironment.

llvm-svn: 197332
This commit is contained in:
Joerg Sonnenberger 2013-12-15 00:12:52 +00:00
parent 6de6da603e
commit 7466979f20
1 changed files with 10 additions and 4 deletions

View File

@ -189,11 +189,17 @@ void ARMSubtarget::resetSubtargetFeatures(StringRef CPU, StringRef FS) {
// Initialize scheduling itinerary for the specified CPU.
InstrItins = getInstrItineraryForCPU(CPUString);
if ((TargetTriple.getTriple().find("eabi") != std::string::npos) ||
(isTargetIOS() && isMClass()))
// FIXME: We might want to separate AAPCS and EABI. Some systems, e.g.
// Darwin-EABI conforms to AACPS but not the rest of EABI.
switch (TargetTriple.getEnvironment()) {
case Triple::EABI:
case Triple::GNUEABI:
case Triple::GNUEABIHF:
TargetABI = ARM_ABI_AAPCS;
break;
default:
if (isTargetIOS() && isMClass())
TargetABI = ARM_ABI_AAPCS;
break;
}
if (isAAPCS_ABI())
stackAlignment = 8;