1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-19 11:02:59 +02:00

support > 4G stack objects

llvm-svn: 36422
This commit is contained in:
Chris Lattner 2007-04-25 04:20:54 +00:00
parent d0af582609
commit a2b590fff8
3 changed files with 9 additions and 9 deletions

View 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;

View 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;

View 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