mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-11-02 07:11:49 +00:00
support > 4G stack objects
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36422 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
ab0e4d38f0
commit
a401b1e1c5
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user