mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-18 13:34:04 +00:00
Have the TLOF creation take a Triple rather than needing a subtarget.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@209937 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
1726e2ff15
commit
c55e193cdd
@ -67,15 +67,15 @@ EnableAArch64SlrGeneration("aarch64-shift-insert-generation", cl::Hidden,
|
||||
//===----------------------------------------------------------------------===//
|
||||
// AArch64 Lowering public interface.
|
||||
//===----------------------------------------------------------------------===//
|
||||
static TargetLoweringObjectFile *createTLOF(TargetMachine &TM) {
|
||||
if (TM.getSubtarget<AArch64Subtarget>().isTargetDarwin())
|
||||
static TargetLoweringObjectFile *createTLOF(const Triple &TT) {
|
||||
if (TT.isOSBinFormatMachO())
|
||||
return new AArch64_MachoTargetObjectFile();
|
||||
|
||||
return new AArch64_ELFTargetObjectFile();
|
||||
}
|
||||
|
||||
AArch64TargetLowering::AArch64TargetLowering(AArch64TargetMachine &TM)
|
||||
: TargetLowering(TM, createTLOF(TM)) {
|
||||
: TargetLowering(TM, createTLOF(Triple(TM.getTargetTriple()))) {
|
||||
Subtarget = &TM.getSubtarget<AArch64Subtarget>();
|
||||
|
||||
// AArch64 doesn't have comparisons which set GPRs or setcc instructions, so
|
||||
|
@ -155,16 +155,16 @@ void ARMTargetLowering::addQRTypeForNEON(MVT VT) {
|
||||
addTypeForNEON(VT, MVT::v2f64, MVT::v4i32);
|
||||
}
|
||||
|
||||
static TargetLoweringObjectFile *createTLOF(TargetMachine &TM) {
|
||||
if (TM.getSubtarget<ARMSubtarget>().isTargetMachO())
|
||||
static TargetLoweringObjectFile *createTLOF(const Triple &TT) {
|
||||
if (TT.isOSBinFormatMachO())
|
||||
return new TargetLoweringObjectFileMachO();
|
||||
if (TM.getSubtarget<ARMSubtarget>().isTargetWindows())
|
||||
if (TT.isOSWindows())
|
||||
return new TargetLoweringObjectFileCOFF();
|
||||
return new ARMElfTargetObjectFile();
|
||||
}
|
||||
|
||||
ARMTargetLowering::ARMTargetLowering(TargetMachine &TM)
|
||||
: TargetLowering(TM, createTLOF(TM)) {
|
||||
: TargetLowering(TM, createTLOF(Triple(TM.getTargetTriple()))) {
|
||||
Subtarget = &TM.getSubtarget<ARMSubtarget>();
|
||||
RegInfo = TM.getRegisterInfo();
|
||||
Itins = TM.getInstrItineraryData();
|
||||
|
@ -19,6 +19,7 @@
|
||||
#include "PPCTargetObjectFile.h"
|
||||
#include "llvm/ADT/STLExtras.h"
|
||||
#include "llvm/ADT/StringSwitch.h"
|
||||
#include "llvm/ADT/Triple.h"
|
||||
#include "llvm/CodeGen/CallingConvLower.h"
|
||||
#include "llvm/CodeGen/MachineFrameInfo.h"
|
||||
#include "llvm/CodeGen/MachineFunction.h"
|
||||
@ -50,15 +51,16 @@ cl::desc("disable unaligned load/store generation on PPC"), cl::Hidden);
|
||||
// FIXME: Remove this once the bug has been fixed!
|
||||
extern cl::opt<bool> ANDIGlueBug;
|
||||
|
||||
static TargetLoweringObjectFile *createTLOF(const PPCTargetMachine &TM) {
|
||||
if (TM.getSubtargetImpl()->isDarwin())
|
||||
static TargetLoweringObjectFile *createTLOF(const Triple &TT) {
|
||||
if (TT.isOSDarwin())
|
||||
return new TargetLoweringObjectFileMachO();
|
||||
else
|
||||
return new PPC64LinuxTargetObjectFile();
|
||||
}
|
||||
|
||||
PPCTargetLowering::PPCTargetLowering(PPCTargetMachine &TM)
|
||||
: TargetLowering(TM, createTLOF(TM)), PPCSubTarget(*TM.getSubtargetImpl()) {
|
||||
: TargetLowering(TM, createTLOF(Triple(TM.getTargetTriple()))),
|
||||
PPCSubTarget(*TM.getSubtargetImpl()) {
|
||||
const PPCSubtarget *Subtarget = &TM.getSubtarget<PPCSubtarget>();
|
||||
|
||||
setPow2DivIsCheap();
|
||||
|
@ -178,29 +178,26 @@ static SDValue Concat256BitVectors(SDValue V1, SDValue V2, EVT VT,
|
||||
return Insert256BitVector(V, V2, NumElems/2, DAG, dl);
|
||||
}
|
||||
|
||||
static TargetLoweringObjectFile *createTLOF(X86TargetMachine &TM) {
|
||||
const X86Subtarget *Subtarget = &TM.getSubtarget<X86Subtarget>();
|
||||
bool is64Bit = Subtarget->is64Bit();
|
||||
|
||||
if (Subtarget->isTargetMacho()) {
|
||||
if (is64Bit)
|
||||
static TargetLoweringObjectFile *createTLOF(const Triple &TT) {
|
||||
if (TT.isOSBinFormatMachO()) {
|
||||
if (TT.getArch() == Triple::x86_64)
|
||||
return new X86_64MachoTargetObjectFile();
|
||||
return new TargetLoweringObjectFileMachO();
|
||||
}
|
||||
|
||||
if (Subtarget->isTargetLinux())
|
||||
if (TT.isOSLinux())
|
||||
return new X86LinuxTargetObjectFile();
|
||||
if (Subtarget->isTargetELF())
|
||||
if (TT.isOSBinFormatELF())
|
||||
return new TargetLoweringObjectFileELF();
|
||||
if (Subtarget->isTargetKnownWindowsMSVC())
|
||||
if (TT.isKnownWindowsMSVCEnvironment())
|
||||
return new X86WindowsTargetObjectFile();
|
||||
if (Subtarget->isTargetCOFF())
|
||||
if (TT.isOSBinFormatCOFF())
|
||||
return new TargetLoweringObjectFileCOFF();
|
||||
llvm_unreachable("unknown subtarget type");
|
||||
}
|
||||
|
||||
X86TargetLowering::X86TargetLowering(X86TargetMachine &TM)
|
||||
: TargetLowering(TM, createTLOF(TM)) {
|
||||
: TargetLowering(TM, createTLOF(Triple(TM.getTargetTriple()))) {
|
||||
Subtarget = &TM.getSubtarget<X86Subtarget>();
|
||||
X86ScalarSSEf64 = Subtarget->hasSSE2();
|
||||
X86ScalarSSEf32 = Subtarget->hasSSE1();
|
||||
|
Loading…
x
Reference in New Issue
Block a user