1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-24 03:33:20 +01:00

Don't pass target name into TargetData anymore, it is never used or needed.

Remove explicit casts to std::string now that there is no overload resolution
issues in the TargetData ctors.

llvm-svn: 28830
This commit is contained in:
Chris Lattner 2006-06-16 18:22:52 +00:00
parent c6a5850ceb
commit 6a9ec7e80e
8 changed files with 8 additions and 14 deletions

View File

@ -32,9 +32,7 @@ namespace {
/// TargetMachine ctor - Create an ILP32 architecture model
///
ARMTargetMachine::ARMTargetMachine(const Module &M, const std::string &FS)
: TargetMachine("ARM"),
DataLayout(std::string("ARM"), std::string("E-p:32:32")),
InstrInfo(),
: TargetMachine("ARM"), DataLayout("E-p:32:32"),
FrameInfo(TargetFrameInfo::StackGrowsDown, 8, 0) {
}

View File

@ -54,8 +54,7 @@ unsigned AlphaTargetMachine::getJITMatchQuality() {
}
AlphaTargetMachine::AlphaTargetMachine(const Module &M, const std::string &FS)
: TargetMachine("alpha"),
DataLayout(std::string("alpha"), std::string("e")),
: TargetMachine("alpha"), DataLayout("e"),
FrameInfo(TargetFrameInfo::StackGrowsDown, 16, 0),
JITInfo(*this),
Subtarget(M, FS)

View File

@ -23,8 +23,7 @@ struct CTargetMachine : public TargetMachine {
const TargetData DataLayout; // Calculates type size & alignment
CTargetMachine(const Module &M, const std::string &FS)
: TargetMachine("CBackend", M),
DataLayout("CBackend", &M) {}
: TargetMachine("CBackend", M), DataLayout(&M) {}
// This is the only thing that actually does anything here.
virtual bool addPassesToEmitFile(PassManager &PM, std::ostream &Out,

View File

@ -76,7 +76,7 @@ unsigned IA64TargetMachine::getModuleMatchQuality(const Module &M) {
/// IA64TargetMachine ctor - Create an LP64 architecture model
///
IA64TargetMachine::IA64TargetMachine(const Module &M, const std::string &FS)
: TargetMachine("IA64"), DataLayout(std::string("IA64"), std::string("e")),
: TargetMachine("IA64"), DataLayout("e"),
FrameInfo(TargetFrameInfo::StackGrowsDown, 16, 0),
TLInfo(*this) { // FIXME? check this stuff
}

View File

@ -87,8 +87,7 @@ unsigned PPC64TargetMachine::getModuleMatchQuality(const Module &M) {
PPCTargetMachine::PPCTargetMachine(const Module &M, const std::string &FS,
bool is64Bit)
: TargetMachine("PowerPC"), Subtarget(M, FS, is64Bit),
DataLayout(std::string("PowerPC"),
std::string(Subtarget.getTargetDataString())),
DataLayout(Subtarget.getTargetDataString()),
FrameInfo(*this, false), JITInfo(*this), TLInfo(*this),
InstrItins(Subtarget.getInstrItineraryData()) {

View File

@ -31,8 +31,7 @@ namespace {
/// SparcTargetMachine ctor - Create an ILP32 architecture model
///
SparcTargetMachine::SparcTargetMachine(const Module &M, const std::string &FS)
: TargetMachine("Sparc"),
DataLayout(std::string("Sparc"), std::string("E-p:32:32")),
: TargetMachine("Sparc"), DataLayout("E-p:32:32"),
Subtarget(M, FS), InstrInfo(Subtarget),
FrameInfo(TargetFrameInfo::StackGrowsDown, 8, 0) {
}

View File

@ -152,7 +152,7 @@ void TargetData::init(const std::string &TargetDescription) {
}
}
TargetData::TargetData(const std::string &ToolName, const Module *M) {
TargetData::TargetData(const Module *M) {
LittleEndian = M->getEndianness() != Module::BigEndian;
PointerSize = M->getPointerSize() != Module::Pointer64 ? 4 : 8;
PointerAlignment = PointerSize;

View File

@ -70,7 +70,7 @@ unsigned X86TargetMachine::getModuleMatchQuality(const Module &M) {
X86TargetMachine::X86TargetMachine(const Module &M, const std::string &FS)
: TargetMachine("X86"),
Subtarget(M, FS),
DataLayout(std::string("X86"), std::string("e-p:32:32-d:32-l:32")),
DataLayout("e-p:32:32-d:32-l:32"),
FrameInfo(TargetFrameInfo::StackGrowsDown,
Subtarget.getStackAlignment(), -4),
InstrInfo(*this), JITInfo(*this), TLInfo(*this) {