[llvm-commits] CVS: llvm/lib/Target/Sparc/SparcRegisterInfo.cpp SparcRegisterInfo.h

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



Changes in directory llvm/lib/Target/Sparc:

SparcRegisterInfo.cpp updated: 1.37 -> 1.38
SparcRegisterInfo.h updated: 1.9 -> 1.10
---
Log message:

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


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

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


Index: llvm/lib/Target/Sparc/SparcRegisterInfo.cpp
diff -u llvm/lib/Target/Sparc/SparcRegisterInfo.cpp:1.37 llvm/lib/Target/Sparc/SparcRegisterInfo.cpp:1.38
--- llvm/lib/Target/Sparc/SparcRegisterInfo.cpp:1.37	Sat Feb  4 23:50:24 2006
+++ llvm/lib/Target/Sparc/SparcRegisterInfo.cpp	Thu Mar 23 12:12:57 2006
@@ -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 @@
   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"
 


Index: llvm/lib/Target/Sparc/SparcRegisterInfo.h
diff -u llvm/lib/Target/Sparc/SparcRegisterInfo.h:1.9 llvm/lib/Target/Sparc/SparcRegisterInfo.h:1.10
--- llvm/lib/Target/Sparc/SparcRegisterInfo.h:1.9	Sat Feb  4 23:50:24 2006
+++ llvm/lib/Target/Sparc/SparcRegisterInfo.h	Thu Mar 23 12:12:57 2006
@@ -56,6 +56,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