OSDN Git Service

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 7474ac8..28256b3 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 de1095b..51bb435 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 2e328cb..3c95760 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 a679749..5d4b32d 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 1d41665..6191819 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 215aa40..b048427 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 f5e10fc..3d4bfdc 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";