LLVM API Documentation

MachineFrameInfo.h
Go to the documentation of this file.
00001 //===-- CodeGen/MachineFrameInfo.h - Abstract Stack Frame Rep. --*- C++ -*-===//
00002 //
00003 //                     The LLVM Compiler Infrastructure
00004 //
00005 // This file is distributed under the University of Illinois Open Source
00006 // License. See LICENSE.TXT for details.
00007 //
00008 //===----------------------------------------------------------------------===//
00009 //
00010 // The file defines the MachineFrameInfo class.
00011 //
00012 //===----------------------------------------------------------------------===//
00013 
00014 #ifndef LLVM_CODEGEN_MACHINEFRAMEINFO_H
00015 #define LLVM_CODEGEN_MACHINEFRAMEINFO_H
00016 
00017 #include "llvm/ADT/SmallVector.h"
00018 #include "llvm/Support/DataTypes.h"
00019 #include <cassert>
00020 #include <vector>
00021 
00022 namespace llvm {
00023 class raw_ostream;
00024 class DataLayout;
00025 class TargetRegisterClass;
00026 class Type;
00027 class MachineFunction;
00028 class MachineBasicBlock;
00029 class TargetFrameLowering;
00030 class BitVector;
00031 class Value;
00032 class AllocaInst;
00033 
00034 /// The CalleeSavedInfo class tracks the information need to locate where a
00035 /// callee saved register is in the current frame.
00036 class CalleeSavedInfo {
00037   unsigned Reg;
00038   int FrameIdx;
00039 
00040 public:
00041   explicit CalleeSavedInfo(unsigned R, int FI = 0)
00042   : Reg(R), FrameIdx(FI) {}
00043 
00044   // Accessors.
00045   unsigned getReg()                        const { return Reg; }
00046   int getFrameIdx()                        const { return FrameIdx; }
00047   void setFrameIdx(int FI)                       { FrameIdx = FI; }
00048 };
00049 
00050 /// The MachineFrameInfo class represents an abstract stack frame until
00051 /// prolog/epilog code is inserted.  This class is key to allowing stack frame
00052 /// representation optimizations, such as frame pointer elimination.  It also
00053 /// allows more mundane (but still important) optimizations, such as reordering
00054 /// of abstract objects on the stack frame.
00055 ///
00056 /// To support this, the class assigns unique integer identifiers to stack
00057 /// objects requested clients.  These identifiers are negative integers for
00058 /// fixed stack objects (such as arguments passed on the stack) or nonnegative
00059 /// for objects that may be reordered.  Instructions which refer to stack
00060 /// objects use a special MO_FrameIndex operand to represent these frame
00061 /// indexes.
00062 ///
00063 /// Because this class keeps track of all references to the stack frame, it
00064 /// knows when a variable sized object is allocated on the stack.  This is the
00065 /// sole condition which prevents frame pointer elimination, which is an
00066 /// important optimization on register-poor architectures.  Because original
00067 /// variable sized alloca's in the source program are the only source of
00068 /// variable sized stack objects, it is safe to decide whether there will be
00069 /// any variable sized objects before all stack objects are known (for
00070 /// example, register allocator spill code never needs variable sized
00071 /// objects).
00072 ///
00073 /// When prolog/epilog code emission is performed, the final stack frame is
00074 /// built and the machine instructions are modified to refer to the actual
00075 /// stack offsets of the object, eliminating all MO_FrameIndex operands from
00076 /// the program.
00077 ///
00078 /// @brief Abstract Stack Frame Information
00079 class MachineFrameInfo {
00080 
00081   // StackObject - Represent a single object allocated on the stack.
00082   struct StackObject {
00083     // SPOffset - The offset of this object from the stack pointer on entry to
00084     // the function.  This field has no meaning for a variable sized element.
00085     int64_t SPOffset;
00086 
00087     // The size of this object on the stack. 0 means a variable sized object,
00088     // ~0ULL means a dead object.
00089     uint64_t Size;
00090 
00091     // Alignment - The required alignment of this stack slot.
00092     unsigned Alignment;
00093 
00094     // isImmutable - If true, the value of the stack object is set before
00095     // entering the function and is not modified inside the function. By
00096     // default, fixed objects are immutable unless marked otherwise.
00097     bool isImmutable;
00098 
00099     // isSpillSlot - If true the stack object is used as spill slot. It
00100     // cannot alias any other memory objects.
00101     bool isSpillSlot;
00102 
00103     // MayNeedSP - If true the stack object triggered the creation of the stack
00104     // protector. We should allocate this object right after the stack
00105     // protector.
00106     bool MayNeedSP;
00107 
00108     /// Alloca - If this stack object is originated from an Alloca instruction
00109     /// this value saves the original IR allocation. Can be NULL.
00110     const AllocaInst *Alloca;
00111 
00112     // PreAllocated - If true, the object was mapped into the local frame
00113     // block and doesn't need additional handling for allocation beyond that.
00114     bool PreAllocated;
00115 
00116     StackObject(uint64_t Sz, unsigned Al, int64_t SP, bool IM,
00117                 bool isSS, bool NSP, const AllocaInst *Val)
00118       : SPOffset(SP), Size(Sz), Alignment(Al), isImmutable(IM),
00119         isSpillSlot(isSS), MayNeedSP(NSP), Alloca(Val), PreAllocated(false) {}
00120   };
00121 
00122   /// Objects - The list of stack objects allocated...
00123   ///
00124   std::vector<StackObject> Objects;
00125 
00126   /// NumFixedObjects - This contains the number of fixed objects contained on
00127   /// the stack.  Because fixed objects are stored at a negative index in the
00128   /// Objects list, this is also the index to the 0th object in the list.
00129   ///
00130   unsigned NumFixedObjects;
00131 
00132   /// HasVarSizedObjects - This boolean keeps track of whether any variable
00133   /// sized objects have been allocated yet.
00134   ///
00135   bool HasVarSizedObjects;
00136 
00137   /// FrameAddressTaken - This boolean keeps track of whether there is a call
00138   /// to builtin \@llvm.frameaddress.
00139   bool FrameAddressTaken;
00140 
00141   /// ReturnAddressTaken - This boolean keeps track of whether there is a call
00142   /// to builtin \@llvm.returnaddress.
00143   bool ReturnAddressTaken;
00144 
00145   /// StackSize - The prolog/epilog code inserter calculates the final stack
00146   /// offsets for all of the fixed size objects, updating the Objects list
00147   /// above.  It then updates StackSize to contain the number of bytes that need
00148   /// to be allocated on entry to the function.
00149   ///
00150   uint64_t StackSize;
00151 
00152   /// OffsetAdjustment - The amount that a frame offset needs to be adjusted to
00153   /// have the actual offset from the stack/frame pointer.  The exact usage of
00154   /// this is target-dependent, but it is typically used to adjust between
00155   /// SP-relative and FP-relative offsets.  E.G., if objects are accessed via
00156   /// SP then OffsetAdjustment is zero; if FP is used, OffsetAdjustment is set
00157   /// to the distance between the initial SP and the value in FP.  For many
00158   /// targets, this value is only used when generating debug info (via
00159   /// TargetRegisterInfo::getFrameIndexOffset); when generating code, the
00160   /// corresponding adjustments are performed directly.
00161   int OffsetAdjustment;
00162 
00163   /// MaxAlignment - The prolog/epilog code inserter may process objects
00164   /// that require greater alignment than the default alignment the target
00165   /// provides. To handle this, MaxAlignment is set to the maximum alignment
00166   /// needed by the objects on the current frame.  If this is greater than the
00167   /// native alignment maintained by the compiler, dynamic alignment code will
00168   /// be needed.
00169   ///
00170   unsigned MaxAlignment;
00171 
00172   /// AdjustsStack - Set to true if this function adjusts the stack -- e.g.,
00173   /// when calling another function. This is only valid during and after
00174   /// prolog/epilog code insertion.
00175   bool AdjustsStack;
00176 
00177   /// HasCalls - Set to true if this function has any function calls.
00178   bool HasCalls;
00179 
00180   /// StackProtectorIdx - The frame index for the stack protector.
00181   int StackProtectorIdx;
00182 
00183   /// FunctionContextIdx - The frame index for the function context. Used for
00184   /// SjLj exceptions.
00185   int FunctionContextIdx;
00186 
00187   /// MaxCallFrameSize - This contains the size of the largest call frame if the
00188   /// target uses frame setup/destroy pseudo instructions (as defined in the
00189   /// TargetFrameInfo class).  This information is important for frame pointer
00190   /// elimination.  If is only valid during and after prolog/epilog code
00191   /// insertion.
00192   ///
00193   unsigned MaxCallFrameSize;
00194 
00195   /// CSInfo - The prolog/epilog code inserter fills in this vector with each
00196   /// callee saved register saved in the frame.  Beyond its use by the prolog/
00197   /// epilog code inserter, this data used for debug info and exception
00198   /// handling.
00199   std::vector<CalleeSavedInfo> CSInfo;
00200 
00201   /// CSIValid - Has CSInfo been set yet?
00202   bool CSIValid;
00203 
00204   /// TargetFrameLowering - Target information about frame layout.
00205   ///
00206   const TargetFrameLowering &TFI;
00207 
00208   /// LocalFrameObjects - References to frame indices which are mapped
00209   /// into the local frame allocation block. <FrameIdx, LocalOffset>
00210   SmallVector<std::pair<int, int64_t>, 32> LocalFrameObjects;
00211 
00212   /// LocalFrameSize - Size of the pre-allocated local frame block.
00213   int64_t LocalFrameSize;
00214 
00215   /// Required alignment of the local object blob, which is the strictest
00216   /// alignment of any object in it.
00217   unsigned LocalFrameMaxAlign;
00218 
00219   /// Whether the local object blob needs to be allocated together. If not,
00220   /// PEI should ignore the isPreAllocated flags on the stack objects and
00221   /// just allocate them normally.
00222   bool UseLocalStackAllocationBlock;
00223 
00224   /// Whether the "realign-stack" option is on.
00225   bool RealignOption;
00226 public:
00227     explicit MachineFrameInfo(const TargetFrameLowering &tfi, bool RealignOpt)
00228     : TFI(tfi), RealignOption(RealignOpt) {
00229     StackSize = NumFixedObjects = OffsetAdjustment = MaxAlignment = 0;
00230     HasVarSizedObjects = false;
00231     FrameAddressTaken = false;
00232     ReturnAddressTaken = false;
00233     AdjustsStack = false;
00234     HasCalls = false;
00235     StackProtectorIdx = -1;
00236     FunctionContextIdx = -1;
00237     MaxCallFrameSize = 0;
00238     CSIValid = false;
00239     LocalFrameSize = 0;
00240     LocalFrameMaxAlign = 0;
00241     UseLocalStackAllocationBlock = false;
00242   }
00243 
00244   /// hasStackObjects - Return true if there are any stack objects in this
00245   /// function.
00246   ///
00247   bool hasStackObjects() const { return !Objects.empty(); }
00248 
00249   /// hasVarSizedObjects - This method may be called any time after instruction
00250   /// selection is complete to determine if the stack frame for this function
00251   /// contains any variable sized objects.
00252   ///
00253   bool hasVarSizedObjects() const { return HasVarSizedObjects; }
00254 
00255   /// getStackProtectorIndex/setStackProtectorIndex - Return the index for the
00256   /// stack protector object.
00257   ///
00258   int getStackProtectorIndex() const { return StackProtectorIdx; }
00259   void setStackProtectorIndex(int I) { StackProtectorIdx = I; }
00260 
00261   /// getFunctionContextIndex/setFunctionContextIndex - Return the index for the
00262   /// function context object. This object is used for SjLj exceptions.
00263   int getFunctionContextIndex() const { return FunctionContextIdx; }
00264   void setFunctionContextIndex(int I) { FunctionContextIdx = I; }
00265 
00266   /// isFrameAddressTaken - This method may be called any time after instruction
00267   /// selection is complete to determine if there is a call to
00268   /// \@llvm.frameaddress in this function.
00269   bool isFrameAddressTaken() const { return FrameAddressTaken; }
00270   void setFrameAddressIsTaken(bool T) { FrameAddressTaken = T; }
00271 
00272   /// isReturnAddressTaken - This method may be called any time after
00273   /// instruction selection is complete to determine if there is a call to
00274   /// \@llvm.returnaddress in this function.
00275   bool isReturnAddressTaken() const { return ReturnAddressTaken; }
00276   void setReturnAddressIsTaken(bool s) { ReturnAddressTaken = s; }
00277 
00278   /// getObjectIndexBegin - Return the minimum frame object index.
00279   ///
00280   int getObjectIndexBegin() const { return -NumFixedObjects; }
00281 
00282   /// getObjectIndexEnd - Return one past the maximum frame object index.
00283   ///
00284   int getObjectIndexEnd() const { return (int)Objects.size()-NumFixedObjects; }
00285 
00286   /// getNumFixedObjects - Return the number of fixed objects.
00287   unsigned getNumFixedObjects() const { return NumFixedObjects; }
00288 
00289   /// getNumObjects - Return the number of objects.
00290   ///
00291   unsigned getNumObjects() const { return Objects.size(); }
00292 
00293   /// mapLocalFrameObject - Map a frame index into the local object block
00294   void mapLocalFrameObject(int ObjectIndex, int64_t Offset) {
00295     LocalFrameObjects.push_back(std::pair<int, int64_t>(ObjectIndex, Offset));
00296     Objects[ObjectIndex + NumFixedObjects].PreAllocated = true;
00297   }
00298 
00299   /// getLocalFrameObjectMap - Get the local offset mapping for a for an object
00300   std::pair<int, int64_t> getLocalFrameObjectMap(int i) {
00301     assert (i >= 0 && (unsigned)i < LocalFrameObjects.size() &&
00302             "Invalid local object reference!");
00303     return LocalFrameObjects[i];
00304   }
00305 
00306   /// getLocalFrameObjectCount - Return the number of objects allocated into
00307   /// the local object block.
00308   int64_t getLocalFrameObjectCount() { return LocalFrameObjects.size(); }
00309 
00310   /// setLocalFrameSize - Set the size of the local object blob.
00311   void setLocalFrameSize(int64_t sz) { LocalFrameSize = sz; }
00312 
00313   /// getLocalFrameSize - Get the size of the local object blob.
00314   int64_t getLocalFrameSize() const { return LocalFrameSize; }
00315 
00316   /// setLocalFrameMaxAlign - Required alignment of the local object blob,
00317   /// which is the strictest alignment of any object in it.
00318   void setLocalFrameMaxAlign(unsigned Align) { LocalFrameMaxAlign = Align; }
00319 
00320   /// getLocalFrameMaxAlign - Return the required alignment of the local
00321   /// object blob.
00322   unsigned getLocalFrameMaxAlign() const { return LocalFrameMaxAlign; }
00323 
00324   /// getUseLocalStackAllocationBlock - Get whether the local allocation blob
00325   /// should be allocated together or let PEI allocate the locals in it
00326   /// directly.
00327   bool getUseLocalStackAllocationBlock() {return UseLocalStackAllocationBlock;}
00328 
00329   /// setUseLocalStackAllocationBlock - Set whether the local allocation blob
00330   /// should be allocated together or let PEI allocate the locals in it
00331   /// directly.
00332   void setUseLocalStackAllocationBlock(bool v) {
00333     UseLocalStackAllocationBlock = v;
00334   }
00335 
00336   /// isObjectPreAllocated - Return true if the object was pre-allocated into
00337   /// the local block.
00338   bool isObjectPreAllocated(int ObjectIdx) const {
00339     assert(unsigned(ObjectIdx+NumFixedObjects) < Objects.size() &&
00340            "Invalid Object Idx!");
00341     return Objects[ObjectIdx+NumFixedObjects].PreAllocated;
00342   }
00343 
00344   /// getObjectSize - Return the size of the specified object.
00345   ///
00346   int64_t getObjectSize(int ObjectIdx) const {
00347     assert(unsigned(ObjectIdx+NumFixedObjects) < Objects.size() &&
00348            "Invalid Object Idx!");
00349     return Objects[ObjectIdx+NumFixedObjects].Size;
00350   }
00351 
00352   /// setObjectSize - Change the size of the specified stack object.
00353   void setObjectSize(int ObjectIdx, int64_t Size) {
00354     assert(unsigned(ObjectIdx+NumFixedObjects) < Objects.size() &&
00355            "Invalid Object Idx!");
00356     Objects[ObjectIdx+NumFixedObjects].Size = Size;
00357   }
00358 
00359   /// getObjectAlignment - Return the alignment of the specified stack object.
00360   unsigned getObjectAlignment(int ObjectIdx) const {
00361     assert(unsigned(ObjectIdx+NumFixedObjects) < Objects.size() &&
00362            "Invalid Object Idx!");
00363     return Objects[ObjectIdx+NumFixedObjects].Alignment;
00364   }
00365 
00366   /// setObjectAlignment - Change the alignment of the specified stack object.
00367   void setObjectAlignment(int ObjectIdx, unsigned Align) {
00368     assert(unsigned(ObjectIdx+NumFixedObjects) < Objects.size() &&
00369            "Invalid Object Idx!");
00370     Objects[ObjectIdx+NumFixedObjects].Alignment = Align;
00371     ensureMaxAlignment(Align);
00372   }
00373 
00374   /// getObjectAllocation - Return the underlying Alloca of the specified
00375   /// stack object if it exists. Returns 0 if none exists.
00376   const AllocaInst* getObjectAllocation(int ObjectIdx) const {
00377     assert(unsigned(ObjectIdx+NumFixedObjects) < Objects.size() &&
00378            "Invalid Object Idx!");
00379     return Objects[ObjectIdx+NumFixedObjects].Alloca;
00380   }
00381 
00382   /// NeedsStackProtector - Returns true if the object may need stack
00383   /// protectors.
00384   bool MayNeedStackProtector(int ObjectIdx) const {
00385     assert(unsigned(ObjectIdx+NumFixedObjects) < Objects.size() &&
00386            "Invalid Object Idx!");
00387     return Objects[ObjectIdx+NumFixedObjects].MayNeedSP;
00388   }
00389 
00390   /// getObjectOffset - Return the assigned stack offset of the specified object
00391   /// from the incoming stack pointer.
00392   ///
00393   int64_t getObjectOffset(int ObjectIdx) const {
00394     assert(unsigned(ObjectIdx+NumFixedObjects) < Objects.size() &&
00395            "Invalid Object Idx!");
00396     assert(!isDeadObjectIndex(ObjectIdx) &&
00397            "Getting frame offset for a dead object?");
00398     return Objects[ObjectIdx+NumFixedObjects].SPOffset;
00399   }
00400 
00401   /// setObjectOffset - Set the stack frame offset of the specified object.  The
00402   /// offset is relative to the stack pointer on entry to the function.
00403   ///
00404   void setObjectOffset(int ObjectIdx, int64_t SPOffset) {
00405     assert(unsigned(ObjectIdx+NumFixedObjects) < Objects.size() &&
00406            "Invalid Object Idx!");
00407     assert(!isDeadObjectIndex(ObjectIdx) &&
00408            "Setting frame offset for a dead object?");
00409     Objects[ObjectIdx+NumFixedObjects].SPOffset = SPOffset;
00410   }
00411 
00412   /// getStackSize - Return the number of bytes that must be allocated to hold
00413   /// all of the fixed size frame objects.  This is only valid after
00414   /// Prolog/Epilog code insertion has finalized the stack frame layout.
00415   ///
00416   uint64_t getStackSize() const { return StackSize; }
00417 
00418   /// setStackSize - Set the size of the stack...
00419   ///
00420   void setStackSize(uint64_t Size) { StackSize = Size; }
00421 
00422   /// Estimate and return the size of the stack frame.
00423   unsigned estimateStackSize(const MachineFunction &MF) const;
00424 
00425   /// getOffsetAdjustment - Return the correction for frame offsets.
00426   ///
00427   int getOffsetAdjustment() const { return OffsetAdjustment; }
00428 
00429   /// setOffsetAdjustment - Set the correction for frame offsets.
00430   ///
00431   void setOffsetAdjustment(int Adj) { OffsetAdjustment = Adj; }
00432 
00433   /// getMaxAlignment - Return the alignment in bytes that this function must be
00434   /// aligned to, which is greater than the default stack alignment provided by
00435   /// the target.
00436   ///
00437   unsigned getMaxAlignment() const { return MaxAlignment; }
00438 
00439   /// ensureMaxAlignment - Make sure the function is at least Align bytes
00440   /// aligned.
00441   void ensureMaxAlignment(unsigned Align);
00442 
00443   /// AdjustsStack - Return true if this function adjusts the stack -- e.g.,
00444   /// when calling another function. This is only valid during and after
00445   /// prolog/epilog code insertion.
00446   bool adjustsStack() const { return AdjustsStack; }
00447   void setAdjustsStack(bool V) { AdjustsStack = V; }
00448 
00449   /// hasCalls - Return true if the current function has any function calls.
00450   bool hasCalls() const { return HasCalls; }
00451   void setHasCalls(bool V) { HasCalls = V; }
00452 
00453   /// getMaxCallFrameSize - Return the maximum size of a call frame that must be
00454   /// allocated for an outgoing function call.  This is only available if
00455   /// CallFrameSetup/Destroy pseudo instructions are used by the target, and
00456   /// then only during or after prolog/epilog code insertion.
00457   ///
00458   unsigned getMaxCallFrameSize() const { return MaxCallFrameSize; }
00459   void setMaxCallFrameSize(unsigned S) { MaxCallFrameSize = S; }
00460 
00461   /// CreateFixedObject - Create a new object at a fixed location on the stack.
00462   /// All fixed objects should be created before other objects are created for
00463   /// efficiency. By default, fixed objects are immutable. This returns an
00464   /// index with a negative value.
00465   ///
00466   int CreateFixedObject(uint64_t Size, int64_t SPOffset, bool Immutable);
00467 
00468 
00469   /// isFixedObjectIndex - Returns true if the specified index corresponds to a
00470   /// fixed stack object.
00471   bool isFixedObjectIndex(int ObjectIdx) const {
00472     return ObjectIdx < 0 && (ObjectIdx >= -(int)NumFixedObjects);
00473   }
00474 
00475   /// isImmutableObjectIndex - Returns true if the specified index corresponds
00476   /// to an immutable object.
00477   bool isImmutableObjectIndex(int ObjectIdx) const {
00478     assert(unsigned(ObjectIdx+NumFixedObjects) < Objects.size() &&
00479            "Invalid Object Idx!");
00480     return Objects[ObjectIdx+NumFixedObjects].isImmutable;
00481   }
00482 
00483   /// isSpillSlotObjectIndex - Returns true if the specified index corresponds
00484   /// to a spill slot..
00485   bool isSpillSlotObjectIndex(int ObjectIdx) const {
00486     assert(unsigned(ObjectIdx+NumFixedObjects) < Objects.size() &&
00487            "Invalid Object Idx!");
00488     return Objects[ObjectIdx+NumFixedObjects].isSpillSlot;
00489   }
00490 
00491   /// isDeadObjectIndex - Returns true if the specified index corresponds to
00492   /// a dead object.
00493   bool isDeadObjectIndex(int ObjectIdx) const {
00494     assert(unsigned(ObjectIdx+NumFixedObjects) < Objects.size() &&
00495            "Invalid Object Idx!");
00496     return Objects[ObjectIdx+NumFixedObjects].Size == ~0ULL;
00497   }
00498 
00499   /// CreateStackObject - Create a new statically sized stack object, returning
00500   /// a nonnegative identifier to represent it.
00501   ///
00502   int CreateStackObject(uint64_t Size, unsigned Alignment, bool isSS,
00503                         bool MayNeedSP = false, const AllocaInst *Alloca = 0);
00504 
00505   /// CreateSpillStackObject - Create a new statically sized stack object that
00506   /// represents a spill slot, returning a nonnegative identifier to represent
00507   /// it.
00508   ///
00509   int CreateSpillStackObject(uint64_t Size, unsigned Alignment);
00510 
00511   /// RemoveStackObject - Remove or mark dead a statically sized stack object.
00512   ///
00513   void RemoveStackObject(int ObjectIdx) {
00514     // Mark it dead.
00515     Objects[ObjectIdx+NumFixedObjects].Size = ~0ULL;
00516   }
00517 
00518   /// CreateVariableSizedObject - Notify the MachineFrameInfo object that a
00519   /// variable sized object has been created.  This must be created whenever a
00520   /// variable sized object is created, whether or not the index returned is
00521   /// actually used.
00522   ///
00523   int CreateVariableSizedObject(unsigned Alignment);
00524 
00525   /// getCalleeSavedInfo - Returns a reference to call saved info vector for the
00526   /// current function.
00527   const std::vector<CalleeSavedInfo> &getCalleeSavedInfo() const {
00528     return CSInfo;
00529   }
00530 
00531   /// setCalleeSavedInfo - Used by prolog/epilog inserter to set the function's
00532   /// callee saved information.
00533   void setCalleeSavedInfo(const std::vector<CalleeSavedInfo> &CSI) {
00534     CSInfo = CSI;
00535   }
00536 
00537   /// isCalleeSavedInfoValid - Has the callee saved info been calculated yet?
00538   bool isCalleeSavedInfoValid() const { return CSIValid; }
00539 
00540   void setCalleeSavedInfoValid(bool v) { CSIValid = v; }
00541 
00542   /// getPristineRegs - Return a set of physical registers that are pristine on
00543   /// entry to the MBB.
00544   ///
00545   /// Pristine registers hold a value that is useless to the current function,
00546   /// but that must be preserved - they are callee saved registers that have not
00547   /// been saved yet.
00548   ///
00549   /// Before the PrologueEpilogueInserter has placed the CSR spill code, this
00550   /// method always returns an empty set.
00551   BitVector getPristineRegs(const MachineBasicBlock *MBB) const;
00552 
00553   /// print - Used by the MachineFunction printer to print information about
00554   /// stack objects. Implemented in MachineFunction.cpp
00555   ///
00556   void print(const MachineFunction &MF, raw_ostream &OS) const;
00557 
00558   /// dump - Print the function to stderr.
00559   void dump(const MachineFunction &MF) const;
00560 };
00561 
00562 } // End llvm namespace
00563 
00564 #endif