diff options
Diffstat (limited to 'lib/Target/Mips/MipsMachineFunction.h')
-rw-r--r-- | lib/Target/Mips/MipsMachineFunction.h | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/lib/Target/Mips/MipsMachineFunction.h b/lib/Target/Mips/MipsMachineFunction.h index 2515aa0..d4f4312 100644 --- a/lib/Target/Mips/MipsMachineFunction.h +++ b/lib/Target/Mips/MipsMachineFunction.h @@ -33,11 +33,6 @@ private: /// the Return Address must be saved int RAStackOffset; - /// When PIC is used the GP must be saved on the stack - /// on the function prologue, so a reference to its stack - /// location must be kept. - int GPStackOffset; - /// MipsFIHolder - Holds a FrameIndex and it's Stack Pointer Offset struct MipsFIHolder { @@ -48,6 +43,13 @@ private: : FI(FrameIndex), SPOffset(StackPointerOffset) {} }; + /// When PIC is used the GP must be saved on the stack + /// on the function prologue and must be reloaded from this + /// stack location after every call. A reference to its stack + /// location and frame index must be kept to be used on + /// emitPrologue and processFunctionBeforeFrameFinalized. + MipsFIHolder GPHolder; + // On LowerFORMAL_ARGUMENTS the stack size is unknown, // so the Stack Pointer Offset calculation of "not in // register arguments" must be postponed to emitPrologue. @@ -64,7 +66,7 @@ private: public: MipsFunctionInfo(MachineFunction& MF) - : FPStackOffset(0), RAStackOffset(0), + : FPStackOffset(0), RAStackOffset(0), GPHolder(-1,-1), HasLoadArgs(false), HasStoreVarArgs(false) {} @@ -74,8 +76,10 @@ public: int getRAStackOffset() const { return RAStackOffset; } void setRAStackOffset(int Off) { RAStackOffset = Off; } - int getGPStackOffset() const { return GPStackOffset; } - void setGPStackOffset(int Off) { GPStackOffset = Off; } + int getGPStackOffset() const { return GPHolder.SPOffset; } + int getGPFI() const { return GPHolder.FI; } + void setGPStackOffset(int Off) { GPHolder.SPOffset = Off; } + void setGPFI(int FI) { GPHolder.FI = FI; } int getTopSavedRegOffset() const { return (RAStackOffset > FPStackOffset) ? |