llvm.org GIT mirror llvm / a401b1e
support > 4G stack objects git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36422 91177308-0d34-0410-b5e6-96231b3b80d8 Chris Lattner 13 years ago
3 changed file(s) with 10 addition(s) and 10 deletion(s). Raw diff Collapse all Expand all
8383
8484 // SPOffset - The offset of this object from the stack pointer on entry to
8585 // the function. This field has no meaning for a variable sized element.
86 int SPOffset;
87
88 StackObject(uint64_t Sz, unsigned Al, int SP)
86 int64_t SPOffset;
87
88 StackObject(uint64_t Sz, unsigned Al, int64_t SP)
8989 : Size(Sz), Alignment(Al), SPOffset(SP) {}
9090 };
9191
183183
184184 /// getObjectSize - Return the size of the specified object
185185 ///
186 int getObjectSize(int ObjectIdx) const {
186 int64_t getObjectSize(int ObjectIdx) const {
187187 assert(ObjectIdx+NumFixedObjects < Objects.size() && "Invalid Object Idx!");
188188 return Objects[ObjectIdx+NumFixedObjects].Size;
189189 }
197197 /// getObjectOffset - Return the assigned stack offset of the specified object
198198 /// from the incoming stack pointer.
199199 ///
200 int getObjectOffset(int ObjectIdx) const {
200 int64_t getObjectOffset(int ObjectIdx) const {
201201 assert(ObjectIdx+NumFixedObjects < Objects.size() && "Invalid Object Idx!");
202202 return Objects[ObjectIdx+NumFixedObjects].SPOffset;
203203 }
205205 /// setObjectOffset - Set the stack frame offset of the specified object. The
206206 /// offset is relative to the stack pointer on entry to the function.
207207 ///
208 void setObjectOffset(int ObjectIdx, int SPOffset) {
208 void setObjectOffset(int ObjectIdx, int64_t SPOffset) {
209209 assert(ObjectIdx+NumFixedObjects < Objects.size() && "Invalid Object Idx!");
210210 Objects[ObjectIdx+NumFixedObjects].SPOffset = SPOffset;
211211 }
256256 /// All fixed objects should be created before other objects are created for
257257 /// efficiency. This returns an index with a negative value.
258258 ///
259 int CreateFixedObject(uint64_t Size, int SPOffset) {
259 int CreateFixedObject(uint64_t Size, int64_t SPOffset) {
260260 assert(Size != 0 && "Cannot allocate zero size fixed stack objects!");
261261 Objects.insert(Objects.begin(), StackObject(Size, 1, SPOffset));
262262 return -++NumFixedObjects;
341341 if (i < NumFixedObjects)
342342 OS << " fixed";
343343 if (i < NumFixedObjects || SO.SPOffset != -1) {
344 int Off = SO.SPOffset - ValOffset;
344 int64_t Off = SO.SPOffset - ValOffset;
345345 OS << " at location [SP";
346346 if (Off > 0)
347347 OS << "+" << Off;
304304 // Start at the beginning of the local area.
305305 // The Offset is the distance from the stack top in the direction
306306 // of stack growth -- so it's always positive.
307 int Offset = TFI.getOffsetOfLocalArea();
307 int64_t Offset = TFI.getOffsetOfLocalArea();
308308 if (StackGrowsDown)
309309 Offset = -Offset;
310310 assert(Offset >= 0
316316 // so we adjust 'Offset' to point to the end of last fixed sized
317317 // preallocated object.
318318 for (int i = FFI->getObjectIndexBegin(); i != 0; ++i) {
319 int FixedOff;
319 int64_t FixedOff;
320320 if (StackGrowsDown) {
321321 // The maximum distance from the stack pointer is at lower address of
322322 // the object -- which is given by offset. For down growing stack