aboutsummaryrefslogtreecommitdiff
path: root/lib/Target/Mips/MipsMachineFunction.h
diff options
context:
space:
mode:
authorBruno Cardoso Lopes <bruno.cardoso@gmail.com>2007-11-05 03:02:32 +0000
committerBruno Cardoso Lopes <bruno.cardoso@gmail.com>2007-11-05 03:02:32 +0000
commitc7db5618f9e5e708b87d9ae6595b3fd510a2a0c0 (patch)
tree9cec3321f14a2ac587bc43aa4f2c0114a373377d /lib/Target/Mips/MipsMachineFunction.h
parent90a52145aba097dffcf92080975749778201f16c (diff)
Added support for PIC code with "explicit relocations" *only*.
Removed all macro code for PIC (goodbye "la"). Support tested with shootout bench. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43697 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/Mips/MipsMachineFunction.h')
-rw-r--r--lib/Target/Mips/MipsMachineFunction.h20
1 files changed, 12 insertions, 8 deletions
diff --git a/lib/Target/Mips/MipsMachineFunction.h b/lib/Target/Mips/MipsMachineFunction.h
index 2515aa0438..d4f4312058 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) ?