mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-12 13:30:51 +00:00
Where Triple has a suitable predicate, use it rather than the enum values. NFC.
Reviewers: mcrosier Subscribers: llvm-commits, rengolin Differential Revision: http://reviews.llvm.org/D10960 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241469 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
a71390ff3b
commit
24a1fec2a7
@ -199,7 +199,7 @@ MCELFStreamer *createAArch64ELFStreamer(MCContext &Context, MCAsmBackend &TAB,
|
||||
MCTargetStreamer *
|
||||
createAArch64ObjectTargetStreamer(MCStreamer &S, const MCSubtargetInfo &STI) {
|
||||
const Triple &TT = STI.getTargetTriple();
|
||||
if (TT.getObjectFormat() == Triple::ELF)
|
||||
if (TT.isOSBinFormatELF())
|
||||
return new AArch64TargetELFStreamer(S);
|
||||
return nullptr;
|
||||
}
|
||||
|
@ -1230,8 +1230,7 @@ ARMBaseInstrInfo::expandPostRAPseudo(MachineBasicBlock::iterator MI) const {
|
||||
Reloc::Model RM = MF.getTarget().getRelocationModel();
|
||||
|
||||
if (MI->getOpcode() == TargetOpcode::LOAD_STACK_GUARD) {
|
||||
assert(getSubtarget().getTargetTriple().getObjectFormat() ==
|
||||
Triple::MachO &&
|
||||
assert(getSubtarget().getTargetTriple().isOSBinFormatMachO() &&
|
||||
"LOAD_STACK_GUARD currently supported only for MachO.");
|
||||
expandLoadStackGuard(MI, RM);
|
||||
MI->getParent()->erase(MI);
|
||||
|
@ -80,8 +80,7 @@ computeTargetABI(const Triple &TT, StringRef CPU,
|
||||
// FIXME: This is duplicated code from the front end and should be unified.
|
||||
if (TT.isOSBinFormatMachO()) {
|
||||
if (TT.getEnvironment() == llvm::Triple::EABI ||
|
||||
(TT.getOS() == llvm::Triple::UnknownOS &&
|
||||
TT.getObjectFormat() == llvm::Triple::MachO) ||
|
||||
(TT.getOS() == llvm::Triple::UnknownOS && TT.isOSBinFormatMachO()) ||
|
||||
CPU.startswith("cortex-m")) {
|
||||
TargetABI = ARMBaseTargetMachine::ARM_ABI_AAPCS;
|
||||
} else {
|
||||
@ -104,7 +103,7 @@ computeTargetABI(const Triple &TT, StringRef CPU,
|
||||
TargetABI = ARMBaseTargetMachine::ARM_ABI_APCS;
|
||||
break;
|
||||
default:
|
||||
if (TT.getOS() == llvm::Triple::NetBSD)
|
||||
if (TT.isOSNetBSD())
|
||||
TargetABI = ARMBaseTargetMachine::ARM_ABI_APCS;
|
||||
else
|
||||
TargetABI = ARMBaseTargetMachine::ARM_ABI_AAPCS;
|
||||
|
@ -1362,7 +1362,7 @@ MCTargetStreamer *createARMNullTargetStreamer(MCStreamer &S) {
|
||||
MCTargetStreamer *createARMObjectTargetStreamer(MCStreamer &S,
|
||||
const MCSubtargetInfo &STI) {
|
||||
const Triple &TT = STI.getTargetTriple();
|
||||
if (TT.getObjectFormat() == Triple::ELF)
|
||||
if (TT.isOSBinFormatELF())
|
||||
return new ARMTargetELFStreamer(S);
|
||||
return new ARMTargetStreamer(S);
|
||||
}
|
||||
|
@ -231,7 +231,7 @@ static MCTargetStreamer *createAsmTargetStreamer(MCStreamer &S,
|
||||
static MCTargetStreamer *
|
||||
createObjectTargetStreamer(MCStreamer &S, const MCSubtargetInfo &STI) {
|
||||
const Triple &TT = STI.getTargetTriple();
|
||||
if (TT.getObjectFormat() == Triple::ELF)
|
||||
if (TT.isOSBinFormatELF())
|
||||
return new PPCTargetELFStreamer(S);
|
||||
return new PPCTargetMachOStreamer(S);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user