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

Make TargetData strings less redundant.

llvm-svn: 28423
This commit is contained in:
Owen Anderson 2006-05-20 23:28:54 +00:00
parent 1ddd46999b
commit 4a78af08aa
4 changed files with 3 additions and 10 deletions

View File

@ -54,7 +54,7 @@ public:
unsigned char ByteAl = 1, unsigned char BoolAl = 1); unsigned char ByteAl = 1, unsigned char BoolAl = 1);
/// Constructs a TargetData from a string of the following format: /// Constructs a TargetData from a string of the following format:
/// "E-p:64:64-d:64:64-f:32:32-l:64:64-i:32:32-s:16:16-b:8:8-B:8:8" /// "E-p:64:64-d:64-f:32-l:64-i:32-s:16-b:8-B:8"
/// The above string is considered the default, and any values not specified /// The above string is considered the default, and any values not specified
/// in the string will be assumed to be as above. /// in the string will be assumed to be as above.
TargetData(const std::string &TargetName, TargetData(const std::string &TargetName,

View File

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

View File

@ -157,31 +157,24 @@ TargetData::TargetData(const std::string &TargetName,
PointerAlignment = atoi(getToken(token,":").c_str()) / 8; PointerAlignment = atoi(getToken(token,":").c_str()) / 8;
break; break;
case 'd': case 'd':
getToken(token,":"); //Ignore the size
DoubleAlignment = atoi(getToken(token,":").c_str()) / 8; DoubleAlignment = atoi(getToken(token,":").c_str()) / 8;
break; break;
case 'f': case 'f':
getToken(token, ":"); //Ignore the size
FloatAlignment = atoi(getToken(token, ":").c_str()) / 8; FloatAlignment = atoi(getToken(token, ":").c_str()) / 8;
break; break;
case 'l': case 'l':
getToken(token, ":"); //Ignore the size
LongAlignment = atoi(getToken(token, ":").c_str()) / 8; LongAlignment = atoi(getToken(token, ":").c_str()) / 8;
break; break;
case 'i': case 'i':
getToken(token, ":"); //Ignore the size
IntAlignment = atoi(getToken(token, ":").c_str()) / 8; IntAlignment = atoi(getToken(token, ":").c_str()) / 8;
break; break;
case 's': case 's':
getToken(token, ":"); //Ignore the size
ShortAlignment = atoi(getToken(token, ":").c_str()) / 8; ShortAlignment = atoi(getToken(token, ":").c_str()) / 8;
break; break;
case 'b': case 'b':
getToken(token, ":"); //Ignore the size
ByteAlignment = atoi(getToken(token, ":").c_str()) / 8; ByteAlignment = atoi(getToken(token, ":").c_str()) / 8;
break; break;
case 'B': case 'B':
getToken(token, ":"); //Ignore the size
BoolAlignment = atoi(getToken(token, ":").c_str()) / 8; BoolAlignment = atoi(getToken(token, ":").c_str()) / 8;
break; break;
default: default:

View File

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