llvm.org GIT mirror llvm / 9989322
ARM: deduplicate hard-float detection code. NFC. ARMSubtarget had a copy/pasted block to determine whether the target was hard-float, but it just delegated to triple features anyway so it's better at the TargetMachine level. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@337384 91177308-0d34-0410-b5e6-96231b3b80d8 Tim Northover 2 years ago
4 changed file(s) with 12 addition(s) and 12 deletion(s). Raw diff Collapse all Expand all
301301 }
302302 }
303303
304 bool ARMSubtarget::isTargetHardFloat() const { return TM.isTargetHardFloat(); }
305
304306 bool ARMSubtarget::isAPCS_ABI() const {
305307 assert(TM.TargetABI != ARMBaseTargetMachine::ARM_ABI_UNKNOWN);
306308 return TM.TargetABI == ARMBaseTargetMachine::ARM_ABI_APCS;
665665 !isTargetDarwin() && !isTargetWindows();
666666 }
667667
668 bool isTargetHardFloat() const {
669 // FIXME: this is invalid for WindowsCE
670 return TargetTriple.getEnvironment() == Triple::GNUEABIHF ||
671 TargetTriple.getEnvironment() == Triple::MuslEABIHF ||
672 TargetTriple.getEnvironment() == Triple::EABIHF ||
673 isTargetWindows() || isAAPCS16_ABI();
674 }
668 bool isTargetHardFloat() const;
675669
676670 bool isTargetAndroid() const { return TargetTriple.isAndroid(); }
677671
214214
215215 // Default to triple-appropriate float ABI
216216 if (Options.FloatABIType == FloatABI::Default) {
217 if (TargetTriple.getEnvironment() == Triple::GNUEABIHF ||
218 TargetTriple.getEnvironment() == Triple::MuslEABIHF ||
219 TargetTriple.getEnvironment() == Triple::EABIHF ||
220 TargetTriple.isOSWindows() ||
221 TargetABI == ARMBaseTargetMachine::ARM_ABI_AAPCS16)
217 if (isTargetHardFloat())
222218 this->Options.FloatABIType = FloatABI::Hard;
223219 else
224220 this->Options.FloatABIType = FloatABI::Soft;
6060 TargetLoweringObjectFile *getObjFileLowering() const override {
6161 return TLOF.get();
6262 }
63
64 bool isTargetHardFloat() const {
65 return TargetTriple.getEnvironment() == Triple::GNUEABIHF ||
66 TargetTriple.getEnvironment() == Triple::MuslEABIHF ||
67 TargetTriple.getEnvironment() == Triple::EABIHF ||
68 TargetTriple.isOSWindows() ||
69 TargetABI == ARMBaseTargetMachine::ARM_ABI_AAPCS16;
70 }
6371 };
6472
6573 /// ARM/Thumb little endian target machine.