//
//===----------------------------------------------------------------------===//
+#include "llvm/Target/TargetMachine.h"
#include "llvm/Target/MRegisterInfo.h"
+#include "llvm/Target/TargetFrameInfo.h"
#include "llvm/CodeGen/MachineFunction.h"
#include "llvm/CodeGen/MachineFrameInfo.h"
return Allocatable;
}
-/// getStackDirection - This method should return the factor by which stacks
-/// grow. The tyical value is -4 which is the grows negatively in 4 byte
-/// increments.
-int MRegisterInfo::getStackDirection() const {
- return -sizeof(int32_t);
-}
-
/// getLocation - This method should return the actual location of a frame
/// variable given the frame index. The location is returned in ML.
/// Subclasses should override this method for special handling of frame
/// variables and then call MRegisterInfo::getLocation for the default action.
void MRegisterInfo::getLocation(MachineFunction &MF, unsigned Index,
MachineLocation &ML) const {
+ const TargetFrameInfo &TFI = *MF.getTarget().getFrameInfo();
MachineFrameInfo *MFI = MF.getFrameInfo();
ML.set(getFrameRegister(MF),
- MFI->getObjectOffset(Index) + MFI->getStackSize());
+ MFI->getObjectOffset(Index) +
+ MFI->getStackSize() -
+ TFI.getOffsetOfLocalArea());
}
/// getInitialFrameState - Returns a list of machine moves that are assumed