forked from OSchip/llvm-project
pass the TargetTriple down from each target ctor to the
LLVMTargetMachine ctor. It is currently unused. llvm-svn: 78711
This commit is contained in:
parent
67e5ea2726
commit
2c30970b22
|
@ -16,6 +16,7 @@
|
||||||
|
|
||||||
#include "llvm/Target/TargetInstrItineraries.h"
|
#include "llvm/Target/TargetInstrItineraries.h"
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
|
#include <string>
|
||||||
|
|
||||||
namespace llvm {
|
namespace llvm {
|
||||||
|
|
||||||
|
@ -290,7 +291,8 @@ public:
|
||||||
///
|
///
|
||||||
class LLVMTargetMachine : public TargetMachine {
|
class LLVMTargetMachine : public TargetMachine {
|
||||||
protected: // Can only create subclasses.
|
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
|
/// addCommonCodeGenPasses - Add standard LLVM codegen passes used for
|
||||||
/// both emitting to assembly files or machine code output.
|
/// both emitting to assembly files or machine code output.
|
||||||
|
|
|
@ -39,7 +39,7 @@ ARMBaseTargetMachine::ARMBaseTargetMachine(const Target &T,
|
||||||
const std::string &TT,
|
const std::string &TT,
|
||||||
const std::string &FS,
|
const std::string &FS,
|
||||||
bool isThumb)
|
bool isThumb)
|
||||||
: LLVMTargetMachine(T),
|
: LLVMTargetMachine(T, TT),
|
||||||
Subtarget(TT, FS, isThumb),
|
Subtarget(TT, FS, isThumb),
|
||||||
FrameInfo(Subtarget),
|
FrameInfo(Subtarget),
|
||||||
JITInfo(),
|
JITInfo(),
|
||||||
|
|
|
@ -31,7 +31,7 @@ const TargetAsmInfo *AlphaTargetMachine::createTargetAsmInfo() const {
|
||||||
|
|
||||||
AlphaTargetMachine::AlphaTargetMachine(const Target &T, const std::string &TT,
|
AlphaTargetMachine::AlphaTargetMachine(const Target &T, const std::string &TT,
|
||||||
const std::string &FS)
|
const std::string &FS)
|
||||||
: LLVMTargetMachine(T),
|
: LLVMTargetMachine(T, TT),
|
||||||
DataLayout("e-f128:128:128"),
|
DataLayout("e-f128:128:128"),
|
||||||
FrameInfo(TargetFrameInfo::StackGrowsDown, 16, 0),
|
FrameInfo(TargetFrameInfo::StackGrowsDown, 16, 0),
|
||||||
JITInfo(*this),
|
JITInfo(*this),
|
||||||
|
|
|
@ -29,7 +29,7 @@ const TargetAsmInfo* BlackfinTargetMachine::createTargetAsmInfo() const {
|
||||||
BlackfinTargetMachine::BlackfinTargetMachine(const Target &T,
|
BlackfinTargetMachine::BlackfinTargetMachine(const Target &T,
|
||||||
const std::string &TT,
|
const std::string &TT,
|
||||||
const std::string &FS)
|
const std::string &FS)
|
||||||
: LLVMTargetMachine(T),
|
: LLVMTargetMachine(T, TT),
|
||||||
DataLayout("e-p:32:32-i64:32-f64:32"),
|
DataLayout("e-p:32:32-i64:32-f64:32"),
|
||||||
Subtarget(TT, FS),
|
Subtarget(TT, FS),
|
||||||
TLInfo(*this),
|
TLInfo(*this),
|
||||||
|
|
|
@ -39,7 +39,7 @@ const TargetAsmInfo *SPUTargetMachine::createTargetAsmInfo() const {
|
||||||
|
|
||||||
SPUTargetMachine::SPUTargetMachine(const Target &T, const std::string &TT,
|
SPUTargetMachine::SPUTargetMachine(const Target &T, const std::string &TT,
|
||||||
const std::string &FS)
|
const std::string &FS)
|
||||||
: LLVMTargetMachine(T),
|
: LLVMTargetMachine(T, TT),
|
||||||
Subtarget(TT, FS),
|
Subtarget(TT, FS),
|
||||||
DataLayout(Subtarget.getTargetDataString()),
|
DataLayout(Subtarget.getTargetDataString()),
|
||||||
InstrInfo(*this),
|
InstrInfo(*this),
|
||||||
|
|
|
@ -22,7 +22,7 @@ using namespace llvm;
|
||||||
MSP430TargetMachine::MSP430TargetMachine(const Target &T,
|
MSP430TargetMachine::MSP430TargetMachine(const Target &T,
|
||||||
const std::string &TT,
|
const std::string &TT,
|
||||||
const std::string &FS) :
|
const std::string &FS) :
|
||||||
LLVMTargetMachine(T),
|
LLVMTargetMachine(T, TT),
|
||||||
Subtarget(TT, FS),
|
Subtarget(TT, FS),
|
||||||
// FIXME: Check TargetData string.
|
// FIXME: Check TargetData string.
|
||||||
DataLayout("e-p:16:8:8-i8:8:8-i16:8:8-i32:8:8"),
|
DataLayout("e-p:16:8:8-i8:8:8-i16:8:8-i32:8:8"),
|
||||||
|
|
|
@ -38,14 +38,13 @@ const TargetAsmInfo *MipsTargetMachine::createTargetAsmInfo() const {
|
||||||
MipsTargetMachine::
|
MipsTargetMachine::
|
||||||
MipsTargetMachine(const Target &T, const std::string &TT, const std::string &FS,
|
MipsTargetMachine(const Target &T, const std::string &TT, const std::string &FS,
|
||||||
bool isLittle=false):
|
bool isLittle=false):
|
||||||
LLVMTargetMachine(T),
|
LLVMTargetMachine(T, TT),
|
||||||
Subtarget(TT, FS, isLittle),
|
Subtarget(TT, FS, isLittle),
|
||||||
DataLayout(isLittle ? std::string("e-p:32:32:32-i8:8:32-i16:16:32") :
|
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")),
|
std::string("E-p:32:32:32-i8:8:32-i16:16:32")),
|
||||||
InstrInfo(*this),
|
InstrInfo(*this),
|
||||||
FrameInfo(TargetFrameInfo::StackGrowsUp, 8, 0),
|
FrameInfo(TargetFrameInfo::StackGrowsUp, 8, 0),
|
||||||
TLInfo(*this)
|
TLInfo(*this) {
|
||||||
{
|
|
||||||
// Abicall enables PIC by default
|
// Abicall enables PIC by default
|
||||||
if (getRelocationModel() == Reloc::Default) {
|
if (getRelocationModel() == Reloc::Default) {
|
||||||
if (Subtarget.isABI_O32())
|
if (Subtarget.isABI_O32())
|
||||||
|
|
|
@ -23,7 +23,7 @@ using namespace llvm;
|
||||||
// PIC16TargetMachine - Traditional PIC16 Machine.
|
// PIC16TargetMachine - Traditional PIC16 Machine.
|
||||||
PIC16TargetMachine::PIC16TargetMachine(const Target &T, const std::string &TT,
|
PIC16TargetMachine::PIC16TargetMachine(const Target &T, const std::string &TT,
|
||||||
const std::string &FS, bool Cooper)
|
const std::string &FS, bool Cooper)
|
||||||
: LLVMTargetMachine(T),
|
: LLVMTargetMachine(T, TT),
|
||||||
Subtarget(TT, FS, Cooper),
|
Subtarget(TT, FS, Cooper),
|
||||||
DataLayout("e-p:16:8:8-i8:8:8-i16:8:8-i32:8:8"),
|
DataLayout("e-p:16:8:8-i8:8:8-i16:8:8-i32:8:8"),
|
||||||
InstrInfo(*this), TLInfo(*this),
|
InstrInfo(*this), TLInfo(*this),
|
||||||
|
|
|
@ -29,13 +29,12 @@ extern "C" void LLVMInitializePowerPCTarget() {
|
||||||
const TargetAsmInfo *PPCTargetMachine::createTargetAsmInfo() const {
|
const TargetAsmInfo *PPCTargetMachine::createTargetAsmInfo() const {
|
||||||
if (Subtarget.isDarwin())
|
if (Subtarget.isDarwin())
|
||||||
return new PPCDarwinTargetAsmInfo(*this);
|
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)
|
const std::string &FS, bool is64Bit)
|
||||||
: LLVMTargetMachine(T),
|
: LLVMTargetMachine(T, TT),
|
||||||
Subtarget(TT, FS, is64Bit),
|
Subtarget(TT, FS, is64Bit),
|
||||||
DataLayout(Subtarget.getTargetDataString()), InstrInfo(*this),
|
DataLayout(Subtarget.getTargetDataString()), InstrInfo(*this),
|
||||||
FrameInfo(*this, is64Bit), JITInfo(*this, is64Bit), TLInfo(*this),
|
FrameInfo(*this, is64Bit), JITInfo(*this, is64Bit), TLInfo(*this),
|
||||||
|
|
|
@ -31,7 +31,7 @@ const TargetAsmInfo *SparcTargetMachine::createTargetAsmInfo() const {
|
||||||
///
|
///
|
||||||
SparcTargetMachine::SparcTargetMachine(const Target &T, const std::string &TT,
|
SparcTargetMachine::SparcTargetMachine(const Target &T, const std::string &TT,
|
||||||
const std::string &FS)
|
const std::string &FS)
|
||||||
: LLVMTargetMachine(T),
|
: LLVMTargetMachine(T, TT),
|
||||||
DataLayout("E-p:32:32-f128:128:128"),
|
DataLayout("E-p:32:32-f128:128:128"),
|
||||||
Subtarget(TT, FS), TLInfo(*this), InstrInfo(Subtarget),
|
Subtarget(TT, FS), TLInfo(*this), InstrInfo(Subtarget),
|
||||||
FrameInfo(TargetFrameInfo::StackGrowsDown, 8, 0) {
|
FrameInfo(TargetFrameInfo::StackGrowsDown, 8, 0) {
|
||||||
|
|
|
@ -31,7 +31,7 @@ const TargetAsmInfo *SystemZTargetMachine::createTargetAsmInfo() const {
|
||||||
SystemZTargetMachine::SystemZTargetMachine(const Target &T,
|
SystemZTargetMachine::SystemZTargetMachine(const Target &T,
|
||||||
const std::string &TT,
|
const std::string &TT,
|
||||||
const std::string &FS)
|
const std::string &FS)
|
||||||
: LLVMTargetMachine(T),
|
: LLVMTargetMachine(T, TT),
|
||||||
Subtarget(TT, FS),
|
Subtarget(TT, FS),
|
||||||
DataLayout("E-p:64:64:64-i8:8:16-i16:16:16-i32:32:32-i64:64:64-f32:32:32"
|
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"),
|
"-f64:64:64-f128:128:128-a0:16:16"),
|
||||||
|
|
|
@ -58,7 +58,7 @@ X86_64TargetMachine::X86_64TargetMachine(const Target &T, const std::string &TT,
|
||||||
///
|
///
|
||||||
X86TargetMachine::X86TargetMachine(const Target &T, const std::string &TT,
|
X86TargetMachine::X86TargetMachine(const Target &T, const std::string &TT,
|
||||||
const std::string &FS, bool is64Bit)
|
const std::string &FS, bool is64Bit)
|
||||||
: LLVMTargetMachine(T),
|
: LLVMTargetMachine(T, TT),
|
||||||
Subtarget(TT, FS, is64Bit),
|
Subtarget(TT, FS, is64Bit),
|
||||||
DataLayout(Subtarget.getDataLayout()),
|
DataLayout(Subtarget.getDataLayout()),
|
||||||
FrameInfo(TargetFrameInfo::StackGrowsDown,
|
FrameInfo(TargetFrameInfo::StackGrowsDown,
|
||||||
|
|
|
@ -25,7 +25,7 @@ const TargetAsmInfo *XCoreTargetMachine::createTargetAsmInfo() const {
|
||||||
///
|
///
|
||||||
XCoreTargetMachine::XCoreTargetMachine(const Target &T, const std::string &TT,
|
XCoreTargetMachine::XCoreTargetMachine(const Target &T, const std::string &TT,
|
||||||
const std::string &FS)
|
const std::string &FS)
|
||||||
: LLVMTargetMachine(T),
|
: LLVMTargetMachine(T, TT),
|
||||||
Subtarget(TT, FS),
|
Subtarget(TT, FS),
|
||||||
DataLayout("e-p:32:32:32-a0:0:32-f32:32:32-f64:32:32-i1:8:32-i8:8:32-"
|
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"),
|
"i16:16:32-i32:32:32-i64:32:32"),
|
||||||
|
|
Loading…
Reference in New Issue