aboutsummaryrefslogtreecommitdiff
path: root/lib/Target/Sparc/SparcRegisterInfo.cpp
diff options
context:
space:
mode:
authorJim Laskey <jlaskey@mac.com>2006-03-23 18:12:57 +0000
committerJim Laskey <jlaskey@mac.com>2006-03-23 18:12:57 +0000
commitf1d78e83356a412e525c30ac90dabf090a8cfc99 (patch)
treea677891241e018bdeffde44fe544bab3a683877c /lib/Target/Sparc/SparcRegisterInfo.cpp
parent4ca9757a39a1bf3bd1264a77e52db62e02cc85fb (diff)
Add support to locate local variables in frames (early version.)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26994 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/Sparc/SparcRegisterInfo.cpp')
-rw-r--r--lib/Target/Sparc/SparcRegisterInfo.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/lib/Target/Sparc/SparcRegisterInfo.cpp b/lib/Target/Sparc/SparcRegisterInfo.cpp
index ff9c5a3ec3..21a0cd85d8 100644
--- a/lib/Target/Sparc/SparcRegisterInfo.cpp
+++ b/lib/Target/Sparc/SparcRegisterInfo.cpp
@@ -17,6 +17,7 @@
#include "llvm/CodeGen/MachineInstrBuilder.h"
#include "llvm/CodeGen/MachineFunction.h"
#include "llvm/CodeGen/MachineFrameInfo.h"
+#include "llvm/CodeGen/MachineLocation.h"
#include "llvm/Type.h"
#include "llvm/ADT/STLExtras.h"
#include <iostream>
@@ -199,5 +200,16 @@ void SparcRegisterInfo::emitEpilogue(MachineFunction &MF,
BuildMI(MBB, MBBI, SP::RESTORErr, 2, SP::G0).addReg(SP::G0).addReg(SP::G0);
}
+void SparcRegisterInfo::getLocation(MachineFunction &MF, unsigned Index,
+ MachineLocation &ML) const {
+ assert(0 && "Needs to be defined for target");
+ MachineFrameInfo *MFI = MF.getFrameInfo();
+
+ // FIXME - Needs to handle register variables.
+ // FIXME - Faking that llvm number is same as gcc numbering.
+ ML.set(SP::G1 - SP::G0,
+ MFI->getObjectOffset(Index) + MFI->getStackSize());
+}
+
#include "SparcGenRegisterInfo.inc"