[llvm-commits] CVS: llvm/include/llvm/CodeGen/MachineFrameInfo.h

Jim Laskey jlaskey at apple.com
Fri Aug 25 12:46:08 PDT 2006



Changes in directory llvm/include/llvm/CodeGen:

MachineFrameInfo.h updated: 1.18 -> 1.19
---
Log message:

Consolidate callee saved register information so that it can me used by debug
information and exception handling.


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

 MachineFrameInfo.h |   32 ++++++++++++++++++++++++++++++++
 1 files changed, 32 insertions(+)


Index: llvm/include/llvm/CodeGen/MachineFrameInfo.h
diff -u llvm/include/llvm/CodeGen/MachineFrameInfo.h:1.18 llvm/include/llvm/CodeGen/MachineFrameInfo.h:1.19
--- llvm/include/llvm/CodeGen/MachineFrameInfo.h:1.18	Tue May 23 10:32:15 2006
+++ llvm/include/llvm/CodeGen/MachineFrameInfo.h	Fri Aug 25 14:45:51 2006
@@ -20,6 +20,28 @@
 class MachineDebugInfo;
 class MachineFunction;
 
+/// The CalleeSavedInfo class tracks the information need to locate where a
+/// callee saved register in the current frame.  
+class CalleeSavedInfo {
+
+private:
+  unsigned Reg;
+  const TargetRegisterClass *RegClass;
+  int FrameIdx;
+  
+public:
+  CalleeSavedInfo(unsigned R, const TargetRegisterClass *RC, int FI = 0)
+  : Reg(R)
+  , RegClass(RC)
+  , FrameIdx(FI)
+  {}
+  
+  // Accessors.
+  unsigned getReg()                        const { return Reg; }
+  const TargetRegisterClass *getRegClass() const { return RegClass; }
+  int getFrameIdx()                        const { return FrameIdx; }
+  void setFrameIdx(int FI)                       { FrameIdx = FI; }
+};
 
 /// The MachineFrameInfo class represents an abstract stack frame until
 /// prolog/epilog code is inserted.  This class is key to allowing stack frame
@@ -111,6 +133,12 @@
   ///
   unsigned MaxCallFrameSize;
   
+  /// CSInfo - The prolog/epilog code inserter fills in this vector with each
+  /// callee saved register saved in the frame.  Beyond it's use by the prolog/
+  /// epilog code inserter, this data used for debug info and exception
+  /// handling.
+  std::vector<CalleeSavedInfo> CSInfo;
+  
   /// DebugInfo - This field is set (via setMachineDebugInfo) by a debug info
   /// consumer (ex. DwarfWriter) to indicate that frame layout information
   /// should be acquired.  Typically, it's the responsibility of the target's
@@ -242,6 +270,10 @@
     Objects.push_back(StackObject(0, 1, -1));
     return Objects.size()-NumFixedObjects-1;
   }
+  
+  /// getCalleeSavedInfo - Returns a reference to call saved info vector for the
+  /// current function.
+  std::vector<CalleeSavedInfo> &getCalleeSavedInfo() { return CSInfo; }
 
   /// getMachineDebugInfo - Used by a prologue/epilogue emitter (MRegisterInfo)
   /// to provide frame layout information. 






More information about the llvm-commits mailing list