[llvm-commits] CVS: llvm/lib/Target/PowerPC/PPCRegisterInfo.cpp PPCRegisterInfo.h

Jim Laskey jlaskey at apple.com
Thu Mar 23 10:13:14 PST 2006



Changes in directory llvm/lib/Target/PowerPC:

PPCRegisterInfo.cpp updated: 1.49 -> 1.50
PPCRegisterInfo.h updated: 1.10 -> 1.11
---
Log message:

Add support to locate local variables in frames (early version.)


---
Diffs of the changes:  (+15 -0)

 PPCRegisterInfo.cpp |   12 ++++++++++++
 PPCRegisterInfo.h   |    3 +++
 2 files changed, 15 insertions(+)


Index: llvm/lib/Target/PowerPC/PPCRegisterInfo.cpp
diff -u llvm/lib/Target/PowerPC/PPCRegisterInfo.cpp:1.49 llvm/lib/Target/PowerPC/PPCRegisterInfo.cpp:1.50
--- llvm/lib/Target/PowerPC/PPCRegisterInfo.cpp:1.49	Tue Mar 21 23:30:33 2006
+++ llvm/lib/Target/PowerPC/PPCRegisterInfo.cpp	Thu Mar 23 12:12:57 2006
@@ -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"
@@ -446,5 +447,16 @@
   }
 }
 
+void PPCRegisterInfo::getLocation(MachineFunction &MF, unsigned Index,
+                                  MachineLocation &ML) const {
+  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 ? PPC::R31 : PPC::R1) - PPC::R0,
+         MFI->getObjectOffset(Index) + MFI->getStackSize());
+}
+
 #include "PPCGenRegisterInfo.inc"
 


Index: llvm/lib/Target/PowerPC/PPCRegisterInfo.h
diff -u llvm/lib/Target/PowerPC/PPCRegisterInfo.h:1.10 llvm/lib/Target/PowerPC/PPCRegisterInfo.h:1.11
--- llvm/lib/Target/PowerPC/PPCRegisterInfo.h:1.10	Thu Feb  2 14:12:32 2006
+++ llvm/lib/Target/PowerPC/PPCRegisterInfo.h	Thu Mar 23 12:12:57 2006
@@ -55,6 +55,9 @@
 
   void emitPrologue(MachineFunction &MF) const;
   void emitEpilogue(MachineFunction &MF, MachineBasicBlock &MBB) const;
+
+  void getLocation(MachineFunction &MF, unsigned Index,
+                   MachineLocation &ML) const;
 };
 
 } // end namespace llvm






More information about the llvm-commits mailing list