Clean up assignment of CalleeSaveStackSlotSize: get rid of the default and explicitly set this in every target that needs to change it from the default.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173270 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Eli Bendersky 2013-01-23 16:22:04 +00:00
parent e735945ad7
commit e752feee52
7 changed files with 15 additions and 16 deletions

View File

@ -351,11 +351,6 @@ namespace llvm {
/// getCalleeSaveStackSlotSize - Get the callee-saved register stack slot /// getCalleeSaveStackSlotSize - Get the callee-saved register stack slot
/// size in bytes. /// size in bytes.
unsigned getCalleeSaveStackSlotSize() const { unsigned getCalleeSaveStackSlotSize() const {
// If a target doesn't explicitly initialize this member, PointerSize is
// used by default.
if (CalleeSaveStackSlotSize == 0)
return PointerSize;
else
return CalleeSaveStackSlotSize; return CalleeSaveStackSlotSize;
} }

View File

@ -24,7 +24,7 @@ using namespace llvm;
MCAsmInfo::MCAsmInfo() { MCAsmInfo::MCAsmInfo() {
PointerSize = 4; PointerSize = 4;
CalleeSaveStackSlotSize = 0; // 0 means PointerSize is used in getter. CalleeSaveStackSlotSize = 4;
IsLittleEndian = true; IsLittleEndian = true;
StackGrowsUp = false; StackGrowsUp = false;

View File

@ -18,7 +18,7 @@ using namespace llvm;
void MSP430MCAsmInfo::anchor() { } void MSP430MCAsmInfo::anchor() { }
MSP430MCAsmInfo::MSP430MCAsmInfo(const Target &T, StringRef TT) { MSP430MCAsmInfo::MSP430MCAsmInfo(const Target &T, StringRef TT) {
PointerSize = 2; PointerSize = CalleeSaveStackSlotSize = 2;
PrivateGlobalPrefix = ".L"; PrivateGlobalPrefix = ".L";
WeakRefDirective ="\t.weak\t"; WeakRefDirective ="\t.weak\t";

View File

@ -25,8 +25,9 @@ MipsMCAsmInfo::MipsMCAsmInfo(const Target &T, StringRef TT) {
IsLittleEndian = false; IsLittleEndian = false;
if ((TheTriple.getArch() == Triple::mips64el) || if ((TheTriple.getArch() == Triple::mips64el) ||
(TheTriple.getArch() == Triple::mips64)) (TheTriple.getArch() == Triple::mips64)) {
PointerSize = 8; PointerSize = CalleeSaveStackSlotSize = 8;
}
AlignmentIsInBytes = false; AlignmentIsInBytes = false;
Data16bitsDirective = "\t.2byte\t"; Data16bitsDirective = "\t.2byte\t";

View File

@ -30,8 +30,9 @@ void NVPTXMCAsmInfo::anchor() { }
NVPTXMCAsmInfo::NVPTXMCAsmInfo(const Target &T, const StringRef &TT) { NVPTXMCAsmInfo::NVPTXMCAsmInfo(const Target &T, const StringRef &TT) {
Triple TheTriple(TT); Triple TheTriple(TT);
if (TheTriple.getArch() == Triple::nvptx64) if (TheTriple.getArch() == Triple::nvptx64) {
PointerSize = 8; PointerSize = CalleeSaveStackSlotSize = 8;
}
CommentString = "//"; CommentString = "//";

View File

@ -17,8 +17,9 @@ using namespace llvm;
void PPCMCAsmInfoDarwin::anchor() { } void PPCMCAsmInfoDarwin::anchor() { }
PPCMCAsmInfoDarwin::PPCMCAsmInfoDarwin(bool is64Bit) { PPCMCAsmInfoDarwin::PPCMCAsmInfoDarwin(bool is64Bit) {
if (is64Bit) if (is64Bit) {
PointerSize = 8; PointerSize = CalleeSaveStackSlotSize = 8;
}
IsLittleEndian = false; IsLittleEndian = false;
PCSymbol = "."; PCSymbol = ".";

View File

@ -21,8 +21,9 @@ void SparcELFMCAsmInfo::anchor() { }
SparcELFMCAsmInfo::SparcELFMCAsmInfo(const Target &T, StringRef TT) { SparcELFMCAsmInfo::SparcELFMCAsmInfo(const Target &T, StringRef TT) {
IsLittleEndian = false; IsLittleEndian = false;
Triple TheTriple(TT); Triple TheTriple(TT);
if (TheTriple.getArch() == Triple::sparcv9) if (TheTriple.getArch() == Triple::sparcv9) {
PointerSize = 8; PointerSize = CalleeSaveStackSlotSize = 8;
}
Data16bitsDirective = "\t.half\t"; Data16bitsDirective = "\t.half\t";
Data32bitsDirective = "\t.word\t"; Data32bitsDirective = "\t.word\t";