diff options
author | Bruno Cardoso Lopes <bruno.cardoso@gmail.com> | 2007-11-05 03:02:32 +0000 |
---|---|---|
committer | Bruno Cardoso Lopes <bruno.cardoso@gmail.com> | 2007-11-05 03:02:32 +0000 |
commit | 3e0d030dadf726acc0d7db09ba9c8017283c8ee1 (patch) | |
tree | 8de0c2d84857e233020fcdcf5eb171ffbb315e24 /llvm/lib/Target/Mips/MipsMachineFunction.h | |
parent | 2657b218eae2e022a1a504a342d7acb22b561da6 (diff) | |
download | bcm5719-llvm-3e0d030dadf726acc0d7db09ba9c8017283c8ee1.tar.gz bcm5719-llvm-3e0d030dadf726acc0d7db09ba9c8017283c8ee1.zip |
Added support for PIC code with "explicit relocations" *only*.
Removed all macro code for PIC (goodbye "la").
Support tested with shootout bench.
llvm-svn: 43697
Diffstat (limited to 'llvm/lib/Target/Mips/MipsMachineFunction.h')
-rw-r--r-- | llvm/lib/Target/Mips/MipsMachineFunction.h | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/llvm/lib/Target/Mips/MipsMachineFunction.h b/llvm/lib/Target/Mips/MipsMachineFunction.h index 2515aa0438a..d4f4312058a 100644 --- a/llvm/lib/Target/Mips/MipsMachineFunction.h +++ b/llvm/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) ? |