Make all of the TargetMachine subclasses use the new string TargetData methods.

This is part of the on-going work on PR 761.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28414 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Owen Anderson 2006-05-20 00:24:56 +00:00
parent a831a6c1c5
commit d988b32aba
7 changed files with 11 additions and 7 deletions

View File

@ -33,7 +33,7 @@ namespace {
///
ARMTargetMachine::ARMTargetMachine(const Module &M, const std::string &FS)
: TargetMachine("ARM"),
DataLayout("ARM", false, 4, 4),
DataLayout(std::string("ARM"), std::string("E-p:32:32")),
InstrInfo(),
FrameInfo(TargetFrameInfo::StackGrowsDown, 8, 0) {
}

View File

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

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("IA64", true),
: TargetMachine("IA64"), DataLayout(std::string("IA64"), std::string("e")),
FrameInfo(TargetFrameInfo::StackGrowsDown, 16, 0),
TLInfo(*this) { // FIXME? check this stuff
}

View File

@ -59,7 +59,7 @@ unsigned PPCTargetMachine::getModuleMatchQuality(const Module &M) {
PPCTargetMachine::PPCTargetMachine(const Module &M, const std::string &FS)
: TargetMachine("PowerPC"),
DataLayout("PowerPC", false, 4, 4, 4, 4, 4),
DataLayout(std::string("PowerPC"), std::string("E-p:32:32-d:64:32-l:64:32")),
Subtarget(M, FS), FrameInfo(*this, false), JITInfo(*this),
TLInfo(*this), InstrItins(Subtarget.getInstrItineraryData()) {
if (TargetDefault == PPCTarget) {

View File

@ -32,7 +32,7 @@ namespace {
///
SparcTargetMachine::SparcTargetMachine(const Module &M, const std::string &FS)
: TargetMachine("Sparc"),
DataLayout("Sparc", false, 4, 4),
DataLayout(std::string("Sparc"), std::string("e-p:32:32")),
Subtarget(M, FS), InstrInfo(Subtarget),
FrameInfo(TargetFrameInfo::StackGrowsDown, 8, 0) {
}

View File

@ -123,6 +123,10 @@ TargetData::TargetData(const std::string &TargetName,
TargetData::TargetData(const std::string &TargetName,
const std::string &TargetDescription) {
assert(!TargetName.empty() &&
"ERROR: Tool did not specify a target data to use!");
std::string temp = TargetDescription;
LittleEndian = false;
@ -136,7 +140,7 @@ TargetData::TargetData(const std::string &TargetName,
ByteAlignment = 1;
BoolAlignment = 1;
while (temp.length() > 0) {
while (!temp.empty()) {
std::string token = getToken(temp, "-");
char signal = getToken(token, ":")[0];

View File

@ -69,7 +69,7 @@ unsigned X86TargetMachine::getModuleMatchQuality(const Module &M) {
///
X86TargetMachine::X86TargetMachine(const Module &M, const std::string &FS)
: TargetMachine("X86"),
DataLayout("X86", true, 4, 4, 4, 4, 4),
DataLayout(std::string("X86"), std::string("e-p:32:32-d:64:32-l:64:32")),
Subtarget(M, FS),
FrameInfo(TargetFrameInfo::StackGrowsDown,
Subtarget.getStackAlignment(), -4),