From 2c30970b22112b0fe7a603005ea2b26d11e69b95 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Tue, 11 Aug 2009 20:42:37 +0000 Subject: [PATCH] pass the TargetTriple down from each target ctor to the LLVMTargetMachine ctor. It is currently unused. llvm-svn: 78711 --- llvm/include/llvm/Target/TargetMachine.h | 4 +++- llvm/lib/Target/ARM/ARMTargetMachine.cpp | 2 +- llvm/lib/Target/Alpha/AlphaTargetMachine.cpp | 2 +- llvm/lib/Target/Blackfin/BlackfinTargetMachine.cpp | 2 +- llvm/lib/Target/CellSPU/SPUTargetMachine.cpp | 2 +- llvm/lib/Target/MSP430/MSP430TargetMachine.cpp | 2 +- llvm/lib/Target/Mips/MipsTargetMachine.cpp | 5 ++--- llvm/lib/Target/PIC16/PIC16TargetMachine.cpp | 2 +- llvm/lib/Target/PowerPC/PPCTargetMachine.cpp | 7 +++---- llvm/lib/Target/Sparc/SparcTargetMachine.cpp | 2 +- llvm/lib/Target/SystemZ/SystemZTargetMachine.cpp | 2 +- llvm/lib/Target/X86/X86TargetMachine.cpp | 2 +- llvm/lib/Target/XCore/XCoreTargetMachine.cpp | 2 +- 13 files changed, 18 insertions(+), 18 deletions(-) diff --git a/llvm/include/llvm/Target/TargetMachine.h b/llvm/include/llvm/Target/TargetMachine.h index 1120df6e833f..5328a49234e6 100644 --- a/llvm/include/llvm/Target/TargetMachine.h +++ b/llvm/include/llvm/Target/TargetMachine.h @@ -16,6 +16,7 @@ #include "llvm/Target/TargetInstrItineraries.h" #include +#include namespace llvm { @@ -290,7 +291,8 @@ public: /// class LLVMTargetMachine : public TargetMachine { protected: // Can only create subclasses. - LLVMTargetMachine(const Target &T) : TargetMachine(T) { } + LLVMTargetMachine(const Target &T, const std::string &TargetTriple) + : TargetMachine(T) { } /// addCommonCodeGenPasses - Add standard LLVM codegen passes used for /// both emitting to assembly files or machine code output. diff --git a/llvm/lib/Target/ARM/ARMTargetMachine.cpp b/llvm/lib/Target/ARM/ARMTargetMachine.cpp index fd6e765d9381..c66570b2e3cb 100644 --- a/llvm/lib/Target/ARM/ARMTargetMachine.cpp +++ b/llvm/lib/Target/ARM/ARMTargetMachine.cpp @@ -39,7 +39,7 @@ ARMBaseTargetMachine::ARMBaseTargetMachine(const Target &T, const std::string &TT, const std::string &FS, bool isThumb) - : LLVMTargetMachine(T), + : LLVMTargetMachine(T, TT), Subtarget(TT, FS, isThumb), FrameInfo(Subtarget), JITInfo(), diff --git a/llvm/lib/Target/Alpha/AlphaTargetMachine.cpp b/llvm/lib/Target/Alpha/AlphaTargetMachine.cpp index 5c61b6d7c55e..bb140dca9232 100644 --- a/llvm/lib/Target/Alpha/AlphaTargetMachine.cpp +++ b/llvm/lib/Target/Alpha/AlphaTargetMachine.cpp @@ -31,7 +31,7 @@ const TargetAsmInfo *AlphaTargetMachine::createTargetAsmInfo() const { AlphaTargetMachine::AlphaTargetMachine(const Target &T, const std::string &TT, const std::string &FS) - : LLVMTargetMachine(T), + : LLVMTargetMachine(T, TT), DataLayout("e-f128:128:128"), FrameInfo(TargetFrameInfo::StackGrowsDown, 16, 0), JITInfo(*this), diff --git a/llvm/lib/Target/Blackfin/BlackfinTargetMachine.cpp b/llvm/lib/Target/Blackfin/BlackfinTargetMachine.cpp index 943ce17d4f7f..35dba2568d85 100644 --- a/llvm/lib/Target/Blackfin/BlackfinTargetMachine.cpp +++ b/llvm/lib/Target/Blackfin/BlackfinTargetMachine.cpp @@ -29,7 +29,7 @@ const TargetAsmInfo* BlackfinTargetMachine::createTargetAsmInfo() const { BlackfinTargetMachine::BlackfinTargetMachine(const Target &T, const std::string &TT, const std::string &FS) - : LLVMTargetMachine(T), + : LLVMTargetMachine(T, TT), DataLayout("e-p:32:32-i64:32-f64:32"), Subtarget(TT, FS), TLInfo(*this), diff --git a/llvm/lib/Target/CellSPU/SPUTargetMachine.cpp b/llvm/lib/Target/CellSPU/SPUTargetMachine.cpp index 4b803a0fdc8a..85dda310d288 100644 --- a/llvm/lib/Target/CellSPU/SPUTargetMachine.cpp +++ b/llvm/lib/Target/CellSPU/SPUTargetMachine.cpp @@ -39,7 +39,7 @@ const TargetAsmInfo *SPUTargetMachine::createTargetAsmInfo() const { SPUTargetMachine::SPUTargetMachine(const Target &T, const std::string &TT, const std::string &FS) - : LLVMTargetMachine(T), + : LLVMTargetMachine(T, TT), Subtarget(TT, FS), DataLayout(Subtarget.getTargetDataString()), InstrInfo(*this), diff --git a/llvm/lib/Target/MSP430/MSP430TargetMachine.cpp b/llvm/lib/Target/MSP430/MSP430TargetMachine.cpp index 2d6af85bbcb8..f34e3db32b9e 100644 --- a/llvm/lib/Target/MSP430/MSP430TargetMachine.cpp +++ b/llvm/lib/Target/MSP430/MSP430TargetMachine.cpp @@ -22,7 +22,7 @@ using namespace llvm; MSP430TargetMachine::MSP430TargetMachine(const Target &T, const std::string &TT, const std::string &FS) : - LLVMTargetMachine(T), + LLVMTargetMachine(T, TT), Subtarget(TT, FS), // FIXME: Check TargetData string. DataLayout("e-p:16:8:8-i8:8:8-i16:8:8-i32:8:8"), diff --git a/llvm/lib/Target/Mips/MipsTargetMachine.cpp b/llvm/lib/Target/Mips/MipsTargetMachine.cpp index a39775608782..546c834c0808 100644 --- a/llvm/lib/Target/Mips/MipsTargetMachine.cpp +++ b/llvm/lib/Target/Mips/MipsTargetMachine.cpp @@ -38,14 +38,13 @@ const TargetAsmInfo *MipsTargetMachine::createTargetAsmInfo() const { MipsTargetMachine:: MipsTargetMachine(const Target &T, const std::string &TT, const std::string &FS, bool isLittle=false): - LLVMTargetMachine(T), + LLVMTargetMachine(T, TT), Subtarget(TT, FS, isLittle), DataLayout(isLittle ? std::string("e-p:32:32:32-i8:8:32-i16:16:32") : std::string("E-p:32:32:32-i8:8:32-i16:16:32")), InstrInfo(*this), FrameInfo(TargetFrameInfo::StackGrowsUp, 8, 0), - TLInfo(*this) -{ + TLInfo(*this) { // Abicall enables PIC by default if (getRelocationModel() == Reloc::Default) { if (Subtarget.isABI_O32()) diff --git a/llvm/lib/Target/PIC16/PIC16TargetMachine.cpp b/llvm/lib/Target/PIC16/PIC16TargetMachine.cpp index f2d8aab9b993..d09097c17f39 100644 --- a/llvm/lib/Target/PIC16/PIC16TargetMachine.cpp +++ b/llvm/lib/Target/PIC16/PIC16TargetMachine.cpp @@ -23,7 +23,7 @@ using namespace llvm; // PIC16TargetMachine - Traditional PIC16 Machine. PIC16TargetMachine::PIC16TargetMachine(const Target &T, const std::string &TT, const std::string &FS, bool Cooper) -: LLVMTargetMachine(T), +: LLVMTargetMachine(T, TT), Subtarget(TT, FS, Cooper), DataLayout("e-p:16:8:8-i8:8:8-i16:8:8-i32:8:8"), InstrInfo(*this), TLInfo(*this), diff --git a/llvm/lib/Target/PowerPC/PPCTargetMachine.cpp b/llvm/lib/Target/PowerPC/PPCTargetMachine.cpp index 251be7679b28..d08c81957b37 100644 --- a/llvm/lib/Target/PowerPC/PPCTargetMachine.cpp +++ b/llvm/lib/Target/PowerPC/PPCTargetMachine.cpp @@ -29,13 +29,12 @@ extern "C" void LLVMInitializePowerPCTarget() { const TargetAsmInfo *PPCTargetMachine::createTargetAsmInfo() const { if (Subtarget.isDarwin()) return new PPCDarwinTargetAsmInfo(*this); - else - return new PPCLinuxTargetAsmInfo(*this); + return new PPCLinuxTargetAsmInfo(*this); } -PPCTargetMachine::PPCTargetMachine(const Target&T, const std::string &TT, +PPCTargetMachine::PPCTargetMachine(const Target &T, const std::string &TT, const std::string &FS, bool is64Bit) - : LLVMTargetMachine(T), + : LLVMTargetMachine(T, TT), Subtarget(TT, FS, is64Bit), DataLayout(Subtarget.getTargetDataString()), InstrInfo(*this), FrameInfo(*this, is64Bit), JITInfo(*this, is64Bit), TLInfo(*this), diff --git a/llvm/lib/Target/Sparc/SparcTargetMachine.cpp b/llvm/lib/Target/Sparc/SparcTargetMachine.cpp index f7c172216afc..c9a3cdd6c7bc 100644 --- a/llvm/lib/Target/Sparc/SparcTargetMachine.cpp +++ b/llvm/lib/Target/Sparc/SparcTargetMachine.cpp @@ -31,7 +31,7 @@ const TargetAsmInfo *SparcTargetMachine::createTargetAsmInfo() const { /// SparcTargetMachine::SparcTargetMachine(const Target &T, const std::string &TT, const std::string &FS) - : LLVMTargetMachine(T), + : LLVMTargetMachine(T, TT), DataLayout("E-p:32:32-f128:128:128"), Subtarget(TT, FS), TLInfo(*this), InstrInfo(Subtarget), FrameInfo(TargetFrameInfo::StackGrowsDown, 8, 0) { diff --git a/llvm/lib/Target/SystemZ/SystemZTargetMachine.cpp b/llvm/lib/Target/SystemZ/SystemZTargetMachine.cpp index 51b31a96098a..cfd1f39cd353 100644 --- a/llvm/lib/Target/SystemZ/SystemZTargetMachine.cpp +++ b/llvm/lib/Target/SystemZ/SystemZTargetMachine.cpp @@ -31,7 +31,7 @@ const TargetAsmInfo *SystemZTargetMachine::createTargetAsmInfo() const { SystemZTargetMachine::SystemZTargetMachine(const Target &T, const std::string &TT, const std::string &FS) - : LLVMTargetMachine(T), + : LLVMTargetMachine(T, TT), Subtarget(TT, FS), DataLayout("E-p:64:64:64-i8:8:16-i16:16:16-i32:32:32-i64:64:64-f32:32:32" "-f64:64:64-f128:128:128-a0:16:16"), diff --git a/llvm/lib/Target/X86/X86TargetMachine.cpp b/llvm/lib/Target/X86/X86TargetMachine.cpp index 5719a35318c3..76d0165c86ed 100644 --- a/llvm/lib/Target/X86/X86TargetMachine.cpp +++ b/llvm/lib/Target/X86/X86TargetMachine.cpp @@ -58,7 +58,7 @@ X86_64TargetMachine::X86_64TargetMachine(const Target &T, const std::string &TT, /// X86TargetMachine::X86TargetMachine(const Target &T, const std::string &TT, const std::string &FS, bool is64Bit) - : LLVMTargetMachine(T), + : LLVMTargetMachine(T, TT), Subtarget(TT, FS, is64Bit), DataLayout(Subtarget.getDataLayout()), FrameInfo(TargetFrameInfo::StackGrowsDown, diff --git a/llvm/lib/Target/XCore/XCoreTargetMachine.cpp b/llvm/lib/Target/XCore/XCoreTargetMachine.cpp index 8847809408be..0a5daf8792e2 100644 --- a/llvm/lib/Target/XCore/XCoreTargetMachine.cpp +++ b/llvm/lib/Target/XCore/XCoreTargetMachine.cpp @@ -25,7 +25,7 @@ const TargetAsmInfo *XCoreTargetMachine::createTargetAsmInfo() const { /// XCoreTargetMachine::XCoreTargetMachine(const Target &T, const std::string &TT, const std::string &FS) - : LLVMTargetMachine(T), + : LLVMTargetMachine(T, TT), Subtarget(TT, FS), DataLayout("e-p:32:32:32-a0:0:32-f32:32:32-f64:32:32-i1:8:32-i8:8:32-" "i16:16:32-i32:32:32-i64:32:32"),