Frame index can be negative.
authorEvan Cheng <evan.cheng@apple.com>
Sat, 2 Feb 2008 00:17:00 +0000 (00:17 +0000)
committerEvan Cheng <evan.cheng@apple.com>
Sat, 2 Feb 2008 00:17:00 +0000 (00:17 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46655 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/Target/MRegisterInfo.h
lib/Target/MRegisterInfo.cpp
lib/Target/X86/X86RegisterInfo.cpp
lib/Target/X86/X86RegisterInfo.h

index 8a90f50c06de341e0a025dfd4a91e80df3db9e16..ae3f27bb3a15d5e9e040d03d3974041920860e6e 100644 (file)
@@ -588,7 +588,7 @@ public:
 
   /// getFrameIndexOffset - Returns the displacement from the frame register to
   /// the stack frame of the specified index.
-  virtual int getFrameIndexOffset(MachineFunction &MF, unsigned FI) const;
+  virtual int getFrameIndexOffset(MachineFunction &MF, int FI) const;
                            
   /// getRARegister - This method should return the register where the return
   /// address can be found.
index 0d14aeea55acfd0bd6c9bd768246ca5e91d96027..8c022cfca09b719e7de71d62e2ae9cb508b6b940 100644 (file)
@@ -74,7 +74,7 @@ BitVector MRegisterInfo::getAllocatableSet(MachineFunction &MF,
 /// getFrameIndexOffset - Returns the displacement from the frame register to
 /// the stack frame of the specified index. This is the default implementation
 /// which is likely incorrect for the target.
-int MRegisterInfo::getFrameIndexOffset(MachineFunction &MF, unsigned FI) const {
+int MRegisterInfo::getFrameIndexOffset(MachineFunction &MF, int FI) const {
   const TargetFrameInfo &TFI = *MF.getTarget().getFrameInfo();
   MachineFrameInfo *MFI = MF.getFrameInfo();
   return MFI->getObjectOffset(FI) + MFI->getStackSize() -
index a0ffd33b21fe454e174b8dada5e667a40e4a67b9..cebc10f4f71d1878196020ab7cf8e51a092a7f3f 100644 (file)
@@ -826,7 +826,7 @@ unsigned X86RegisterInfo::getFrameRegister(MachineFunction &MF) const {
 }
 
 int
-X86RegisterInfo::getFrameIndexOffset(MachineFunction &MF, unsigned FI) const {
+X86RegisterInfo::getFrameIndexOffset(MachineFunction &MF, int FI) const {
   int Offset = MF.getFrameInfo()->getObjectOffset(FI) + SlotSize;
   if (!hasFP(MF))
     return Offset + MF.getFrameInfo()->getStackSize();
index fd18c4135db52586c451b6ca589f0a734ac3beab..e36d5166c985b6037ed4957bda93a0b680c2678c 100644 (file)
@@ -122,7 +122,7 @@ public:
   // Debug information queries.
   unsigned getRARegister() const;
   unsigned getFrameRegister(MachineFunction &MF) const;
-  int getFrameIndexOffset(MachineFunction &MF, unsigned FI) const;
+  int getFrameIndexOffset(MachineFunction &MF, int FI) const;
   void getInitialFrameState(std::vector<MachineMove> &Moves) const;
 
   // Exception handling queries.