diff options
author | Jim Laskey <jlaskey@mac.com> | 2006-08-25 19:45:51 +0000 |
---|---|---|
committer | Jim Laskey <jlaskey@mac.com> | 2006-08-25 19:45:51 +0000 |
commit | f3e4f0e615bb2c36c4a9d60bb908e08b76025c75 (patch) | |
tree | c709ef0817e501dcf12baaf93541ec7f7c7957ef /include/llvm/CodeGen/MachineFrameInfo.h | |
parent | 4c2c9031acd1314440cdd0952182fa39b4efe90d (diff) | |
download | llvm-f3e4f0e615bb2c36c4a9d60bb908e08b76025c75.tar.gz llvm-f3e4f0e615bb2c36c4a9d60bb908e08b76025c75.tar.bz2 llvm-f3e4f0e615bb2c36c4a9d60bb908e08b76025c75.tar.xz |
Consolidate callee saved register information so that it can me used by debug
information and exception handling.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29881 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/CodeGen/MachineFrameInfo.h')
-rw-r--r-- | include/llvm/CodeGen/MachineFrameInfo.h | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/include/llvm/CodeGen/MachineFrameInfo.h b/include/llvm/CodeGen/MachineFrameInfo.h index 870d2f1687..40ebcd3c31 100644 --- a/include/llvm/CodeGen/MachineFrameInfo.h +++ b/include/llvm/CodeGen/MachineFrameInfo.h @@ -20,6 +20,28 @@ class Type; 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 @@ class MachineFrameInfo { /// 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 @@ public: 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. |