aboutsummaryrefslogtreecommitdiff
path: root/lib/Target/Alpha/AlphaRegisterInfo.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/Alpha/AlphaRegisterInfo.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/Alpha/AlphaRegisterInfo.cpp')
-rw-r--r--lib/Target/Alpha/AlphaRegisterInfo.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/lib/Target/Alpha/AlphaRegisterInfo.cpp b/lib/Target/Alpha/AlphaRegisterInfo.cpp
index 31b20da392..f5c6dd67f5 100644
--- a/lib/Target/Alpha/AlphaRegisterInfo.cpp
+++ b/lib/Target/Alpha/AlphaRegisterInfo.cpp
@@ -21,6 +21,7 @@
#include "llvm/CodeGen/MachineInstrBuilder.h"
#include "llvm/CodeGen/MachineFunction.h"
#include "llvm/CodeGen/MachineFrameInfo.h"
+#include "llvm/CodeGen/MachineLocation.h"
#include "llvm/Target/TargetFrameInfo.h"
#include "llvm/Target/TargetMachine.h"
#include "llvm/Target/TargetOptions.h"
@@ -353,6 +354,18 @@ void AlphaRegisterInfo::emitEpilogue(MachineFunction &MF,
}
}
+void AlphaRegisterInfo::getLocation(MachineFunction &MF, unsigned Index,
+ MachineLocation &ML) const {
+ assert(0 && "Needs to be defined for target");
+ MachineFrameInfo *MFI = MF.getFrameInfo();
+ bool FP = hasFP(MF);
+
+ // FIXME - Needs to handle register variables.
+ // FIXME - Faking that llvm number is same as gcc numbering.
+ ML.set((FP ? Alpha::R15 : Alpha::R30) - Alpha::R0,
+ MFI->getObjectOffset(Index) + MFI->getStackSize());
+}
+
#include "AlphaGenRegisterInfo.inc"
std::string AlphaRegisterInfo::getPrettyName(unsigned reg)