Clean up assignment of CalleeSaveStackSlotSize: get rid of the default and explicitly...
authorEli Bendersky <eliben@google.com>
Wed, 23 Jan 2013 16:22:04 +0000 (16:22 +0000)
committerEli Bendersky <eliben@google.com>
Wed, 23 Jan 2013 16:22:04 +0000 (16:22 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173270 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/MC/MCAsmInfo.h
lib/MC/MCAsmInfo.cpp
lib/Target/MSP430/MCTargetDesc/MSP430MCAsmInfo.cpp
lib/Target/Mips/MCTargetDesc/MipsMCAsmInfo.cpp
lib/Target/NVPTX/MCTargetDesc/NVPTXMCAsmInfo.cpp
lib/Target/PowerPC/MCTargetDesc/PPCMCAsmInfo.cpp
lib/Target/Sparc/MCTargetDesc/SparcMCAsmInfo.cpp

index 7474ac8d0fccac4c66a48609295055a76638def1..28256b3677ef77d26e60d542c1eb80405c6ca1d3 100644 (file)
@@ -351,12 +351,7 @@ namespace llvm {
     /// getCalleeSaveStackSlotSize - Get the callee-saved register stack slot
     /// size in bytes.
     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;
     }
 
     /// isLittleEndian - True if the target is little endian.
index de1095bf8acb2a19ad2016fc61e3d05861b5eb16..51bb4357102ebec2a49360b569b1115c7c0bdb77 100644 (file)
@@ -24,7 +24,7 @@ using namespace llvm;
 
 MCAsmInfo::MCAsmInfo() {
   PointerSize = 4;
-  CalleeSaveStackSlotSize = 0; // 0 means PointerSize is used in getter.
+  CalleeSaveStackSlotSize = 4;
 
   IsLittleEndian = true;
   StackGrowsUp = false;
index 2e328cb5d6ac56c40e88dc71d7ce4ca787d2dc2a..3c9576056946df9221f31cfa87e114a2671e9719 100644 (file)
@@ -18,7 +18,7 @@ using namespace llvm;
 void MSP430MCAsmInfo::anchor() { }
 
 MSP430MCAsmInfo::MSP430MCAsmInfo(const Target &T, StringRef TT) {
-  PointerSize = 2;
+  PointerSize = CalleeSaveStackSlotSize = 2;
 
   PrivateGlobalPrefix = ".L";
   WeakRefDirective ="\t.weak\t";
index a6797492d88c963d09e3daa91d4e4522c326e586..5d4b32d30578312126ff1f00819e56f5bbbf2ff3 100644 (file)
@@ -25,8 +25,9 @@ MipsMCAsmInfo::MipsMCAsmInfo(const Target &T, StringRef TT) {
     IsLittleEndian = false;
 
   if ((TheTriple.getArch() == Triple::mips64el) ||
-      (TheTriple.getArch() == Triple::mips64))
-    PointerSize = 8;
+      (TheTriple.getArch() == Triple::mips64)) {
+    PointerSize = CalleeSaveStackSlotSize = 8;
+  }
 
   AlignmentIsInBytes          = false;
   Data16bitsDirective         = "\t.2byte\t";
index 1d4166575da594b73dc979f01bdd31b7723131d4..619181994ae8a4f5af4054fdee9d63d22169d985 100644 (file)
@@ -30,8 +30,9 @@ void NVPTXMCAsmInfo::anchor() { }
 
 NVPTXMCAsmInfo::NVPTXMCAsmInfo(const Target &T, const StringRef &TT) {
   Triple TheTriple(TT);
-  if (TheTriple.getArch() == Triple::nvptx64)
-    PointerSize = 8;
+  if (TheTriple.getArch() == Triple::nvptx64) {
+    PointerSize = CalleeSaveStackSlotSize = 8;
+  }
 
   CommentString = "//";
 
index 215aa40c4afd546e99be5d2010ef282dc42a0707..b04842782aeb57ac2af8ec20d9037d98b3207ae0 100644 (file)
@@ -17,8 +17,9 @@ using namespace llvm;
 void PPCMCAsmInfoDarwin::anchor() { }
 
 PPCMCAsmInfoDarwin::PPCMCAsmInfoDarwin(bool is64Bit) {
-  if (is64Bit)
-    PointerSize = 8;
+  if (is64Bit) {
+    PointerSize = CalleeSaveStackSlotSize = 8;
+  }
   IsLittleEndian = false;
 
   PCSymbol = ".";
index f5e10fc3a465ec61bb3746b462d3c120ef2d98aa..3d4bfdcd5e6da9fdeb29b3abe4fa4bb2b9646a69 100644 (file)
@@ -21,8 +21,9 @@ void SparcELFMCAsmInfo::anchor() { }
 SparcELFMCAsmInfo::SparcELFMCAsmInfo(const Target &T, StringRef TT) {
   IsLittleEndian = false;
   Triple TheTriple(TT);
-  if (TheTriple.getArch() == Triple::sparcv9)
-    PointerSize = 8;
+  if (TheTriple.getArch() == Triple::sparcv9) {
+    PointerSize = CalleeSaveStackSlotSize = 8;
+  }
 
   Data16bitsDirective = "\t.half\t";
   Data32bitsDirective = "\t.word\t";