support > 4G stack objects
authorChris Lattner <sabre@nondot.org>
Wed, 25 Apr 2007 04:20:54 +0000 (04:20 +0000)
committerChris Lattner <sabre@nondot.org>
Wed, 25 Apr 2007 04:20:54 +0000 (04:20 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36422 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/CodeGen/MachineFrameInfo.h
lib/CodeGen/MachineFunction.cpp
lib/CodeGen/PrologEpilogInserter.cpp

index ae2c816e9498121217391e01aed9a0ce0ed2c025..76b9d9b7e3c21b6c89da5545b0434e53ae5d397d 100644 (file)
@@ -84,9 +84,9 @@ class MachineFrameInfo {
 
     // SPOffset - The offset of this object from the stack pointer on entry to
     // the function.  This field has no meaning for a variable sized element.
-    int SPOffset;
+    int64_t SPOffset;
 
-    StackObject(uint64_t Sz, unsigned Al, int SP)
+    StackObject(uint64_t Sz, unsigned Al, int64_t SP)
       : Size(Sz), Alignment(Al), SPOffset(SP) {}
   };
 
@@ -184,7 +184,7 @@ public:
 
   /// getObjectSize - Return the size of the specified object
   ///
-  int getObjectSize(int ObjectIdx) const {
+  int64_t getObjectSize(int ObjectIdx) const {
     assert(ObjectIdx+NumFixedObjects < Objects.size() && "Invalid Object Idx!");
     return Objects[ObjectIdx+NumFixedObjects].Size;
   }
@@ -198,7 +198,7 @@ public:
   /// getObjectOffset - Return the assigned stack offset of the specified object
   /// from the incoming stack pointer.
   ///
-  int getObjectOffset(int ObjectIdx) const {
+  int64_t getObjectOffset(int ObjectIdx) const {
     assert(ObjectIdx+NumFixedObjects < Objects.size() && "Invalid Object Idx!");
     return Objects[ObjectIdx+NumFixedObjects].SPOffset;
   }
@@ -206,7 +206,7 @@ public:
   /// setObjectOffset - Set the stack frame offset of the specified object.  The
   /// offset is relative to the stack pointer on entry to the function.
   ///
-  void setObjectOffset(int ObjectIdx, int SPOffset) {
+  void setObjectOffset(int ObjectIdx, int64_t SPOffset) {
     assert(ObjectIdx+NumFixedObjects < Objects.size() && "Invalid Object Idx!");
     Objects[ObjectIdx+NumFixedObjects].SPOffset = SPOffset;
   }
@@ -257,7 +257,7 @@ public:
   /// All fixed objects should be created before other objects are created for
   /// efficiency.  This returns an index with a negative value.
   ///
-  int CreateFixedObject(uint64_t Size, int SPOffset) {
+  int CreateFixedObject(uint64_t Size, int64_t SPOffset) {
     assert(Size != 0 && "Cannot allocate zero size fixed stack objects!");
     Objects.insert(Objects.begin(), StackObject(Size, 1, SPOffset));
     return -++NumFixedObjects;
index 5ae73ca40a017598267cd3c362fd2d6dba05e4f6..4453be80c1c0aa21d405e80734304a371604a0a3 100644 (file)
@@ -342,7 +342,7 @@ void MachineFrameInfo::print(const MachineFunction &MF, std::ostream &OS) const{
     if (i < NumFixedObjects)
       OS << " fixed";
     if (i < NumFixedObjects || SO.SPOffset != -1) {
-      int Off = SO.SPOffset - ValOffset;
+      int64_t Off = SO.SPOffset - ValOffset;
       OS << " at location [SP";
       if (Off > 0)
         OS << "+" << Off;
index b6e909507a4d522036cf62250bb267d839ec3ca7..a79ba2972eaa8ba269406486dbc1d1e66213240c 100644 (file)
@@ -305,7 +305,7 @@ void PEI::calculateFrameObjectOffsets(MachineFunction &Fn) {
   // Start at the beginning of the local area.
   // The Offset is the distance from the stack top in the direction
   // of stack growth -- so it's always positive.
-  int Offset = TFI.getOffsetOfLocalArea();
+  int64_t Offset = TFI.getOffsetOfLocalArea();
   if (StackGrowsDown)
     Offset = -Offset;
   assert(Offset >= 0
@@ -317,7 +317,7 @@ void PEI::calculateFrameObjectOffsets(MachineFunction &Fn) {
   // so we adjust 'Offset' to point to the end of last fixed sized
   // preallocated object.
   for (int i = FFI->getObjectIndexBegin(); i != 0; ++i) {
-    int FixedOff;
+    int64_t FixedOff;
     if (StackGrowsDown) {
       // The maximum distance from the stack pointer is at lower address of
       // the object -- which is given by offset. For down growing stack