diff options
author | David Woodhouse <dwmw2@infradead.org> | 2014-01-08 00:08:50 +0000 |
---|---|---|
committer | David Woodhouse <dwmw2@infradead.org> | 2014-01-08 00:08:50 +0000 |
commit | 1c3996abc7201af3e2041527a3e1fb3d4d4774c1 (patch) | |
tree | c56c9db37db0e979d7adefe04d466ee865e9a71e /llvm/lib/Target/X86/X86TargetMachine.cpp | |
parent | 65b320f783f409f80de90538719b212131b9e90f (diff) | |
download | llvm-1c3996abc7201af3e2041527a3e1fb3d4d4774c1.zip llvm-1c3996abc7201af3e2041527a3e1fb3d4d4774c1.tar.gz llvm-1c3996abc7201af3e2041527a3e1fb3d4d4774c1.tar.bz2 |
[x86] Kill gratuitous X86_{32,64}TargetMachine subclasses, use X86TargetMachine
llvm-svn: 198720
Diffstat (limited to 'llvm/lib/Target/X86/X86TargetMachine.cpp')
-rw-r--r-- | llvm/lib/Target/X86/X86TargetMachine.cpp | 51 |
1 files changed, 13 insertions, 38 deletions
diff --git a/llvm/lib/Target/X86/X86TargetMachine.cpp b/llvm/lib/Target/X86/X86TargetMachine.cpp index 9fa2481..462dae3 100644 --- a/llvm/lib/Target/X86/X86TargetMachine.cpp +++ b/llvm/lib/Target/X86/X86TargetMachine.cpp @@ -24,11 +24,11 @@ using namespace llvm; extern "C" void LLVMInitializeX86Target() { // Register the target. - RegisterTargetMachine<X86_32TargetMachine> X(TheX86_32Target); - RegisterTargetMachine<X86_64TargetMachine> Y(TheX86_64Target); + RegisterTargetMachine<X86TargetMachine> X(TheX86_32Target); + RegisterTargetMachine<X86TargetMachine> Y(TheX86_64Target); } -void X86_32TargetMachine::anchor() { } +void X86TargetMachine::anchor() { } static std::string computeDataLayout(const X86Subtarget &ST) { // X86 is little endian @@ -69,49 +69,22 @@ static std::string computeDataLayout(const X86Subtarget &ST) { return Ret; } -X86_32TargetMachine::X86_32TargetMachine(const Target &T, StringRef TT, - StringRef CPU, StringRef FS, - const TargetOptions &Options, - Reloc::Model RM, CodeModel::Model CM, - CodeGenOpt::Level OL) - : X86TargetMachine(T, TT, CPU, FS, Options, RM, CM, OL, false), - DL(computeDataLayout(*getSubtargetImpl())), - InstrInfo(*this), - TLInfo(*this), - TSInfo(*this), - JITInfo(*this) { - initAsmInfo(); -} - -void X86_64TargetMachine::anchor() { } - -X86_64TargetMachine::X86_64TargetMachine(const Target &T, StringRef TT, - StringRef CPU, StringRef FS, - const TargetOptions &Options, - Reloc::Model RM, CodeModel::Model CM, - CodeGenOpt::Level OL) - : X86TargetMachine(T, TT, CPU, FS, Options, RM, CM, OL, true), - // The x32 ABI dictates the ILP32 programming model for x64. - DL(computeDataLayout(*getSubtargetImpl())), - InstrInfo(*this), - TLInfo(*this), - TSInfo(*this), - JITInfo(*this) { - initAsmInfo(); -} - /// X86TargetMachine ctor - Create an X86 target. /// X86TargetMachine::X86TargetMachine(const Target &T, StringRef TT, StringRef CPU, StringRef FS, const TargetOptions &Options, Reloc::Model RM, CodeModel::Model CM, - CodeGenOpt::Level OL, - bool is64Bit) + CodeGenOpt::Level OL) : LLVMTargetMachine(T, TT, CPU, FS, Options, RM, CM, OL), - Subtarget(TT, CPU, FS, Options.StackAlignmentOverride, is64Bit), + Subtarget(TT, CPU, FS, Options.StackAlignmentOverride), FrameLowering(*this, Subtarget), - InstrItins(Subtarget.getInstrItineraryData()){ + InstrItins(Subtarget.getInstrItineraryData()), + DL(computeDataLayout(*getSubtargetImpl())), + InstrInfo(*this), + TLInfo(*this), + TSInfo(*this), + JITInfo(*this) { // Determine the PICStyle based on the target selected. if (getRelocationModel() == Reloc::Static) { // Unless we're in PIC or DynamicNoPIC mode, set the PIC style to None. @@ -135,6 +108,8 @@ X86TargetMachine::X86TargetMachine(const Target &T, StringRef TT, // default to hard float ABI if (Options.FloatABIType == FloatABI::Default) this->Options.FloatABIType = FloatABI::Hard; + + initAsmInfo(); } //===----------------------------------------------------------------------===// |