From 7ad409a3e93c6237a89f956aa47b4a4f50529795 Mon Sep 17 00:00:00 2001 From: Joerg Sonnenberger Date: Sun, 15 Dec 2013 00:12:52 +0000 Subject: [PATCH] Replace string matching with a switch on Triple::getEnvironment. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@197332 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Target/ARM/ARMSubtarget.cpp | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/lib/Target/ARM/ARMSubtarget.cpp b/lib/Target/ARM/ARMSubtarget.cpp index 09b3ed641e3..e15872b56a6 100644 --- a/lib/Target/ARM/ARMSubtarget.cpp +++ b/lib/Target/ARM/ARMSubtarget.cpp @@ -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; -- 2.34.1