Changes in directory llvm/lib/Target:
MRegisterInfo.cpp updated: 1.12 -> 1.13 --- Log message: Expose base register for DwarfWriter. Refactor code accordingly. --- Diffs of the changes: (+16 -0) MRegisterInfo.cpp | 16 ++++++++++++++++ 1 files changed, 16 insertions(+) Index: llvm/lib/Target/MRegisterInfo.cpp diff -u llvm/lib/Target/MRegisterInfo.cpp:1.12 llvm/lib/Target/MRegisterInfo.cpp:1.13 --- llvm/lib/Target/MRegisterInfo.cpp:1.12 Wed Feb 1 12:10:56 2006 +++ llvm/lib/Target/MRegisterInfo.cpp Tue Mar 28 07:48:33 2006 @@ -12,6 +12,11 @@ //===----------------------------------------------------------------------===// #include "llvm/Target/MRegisterInfo.h" + +#include "llvm/CodeGen/MachineFunction.h" +#include "llvm/CodeGen/MachineFrameInfo.h" +#include "llvm/CodeGen/MachineLocation.h" + using namespace llvm; MRegisterInfo::MRegisterInfo(const TargetRegisterDesc *D, unsigned NR, @@ -38,3 +43,14 @@ } return Allocatable; } + +/// 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 { + MachineFrameInfo *MFI = MF.getFrameInfo(); + ML.set(getFrameRegister(MF), + MFI->getObjectOffset(Index) + MFI->getStackSize()); +} _______________________________________________ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits