diff options
Diffstat (limited to 'include/llvm/CodeGen/MachineFrameInfo.h')
-rw-r--r-- | include/llvm/CodeGen/MachineFrameInfo.h | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/include/llvm/CodeGen/MachineFrameInfo.h b/include/llvm/CodeGen/MachineFrameInfo.h index 8f8a852480..6720758e64 100644 --- a/include/llvm/CodeGen/MachineFrameInfo.h +++ b/include/llvm/CodeGen/MachineFrameInfo.h @@ -85,6 +85,13 @@ class MachineFrameInfo { /// to be allocated on entry to the function. /// unsigned StackSize; + + /// MaxAlignment - The prolog/epilog code inserter may process objects + /// that require greater alignment than the default alignment the target + /// provides. In these cases, MaxAlignment is set to the new alignment + /// necessary to easily calculate fixed offsets for each stack object. + /// + unsigned MaxAlignment; /// HasCalls - Set to true if this function has any function calls. This is /// only valid during and after prolog/epilog code insertion. @@ -99,7 +106,7 @@ class MachineFrameInfo { unsigned MaxCallFrameSize; public: MachineFrameInfo() { - NumFixedObjects = StackSize = 0; + NumFixedObjects = StackSize = MaxAlignment = 0; HasVarSizedObjects = false; HasCalls = false; MaxCallFrameSize = 0; @@ -163,6 +170,16 @@ public: /// void setStackSize(unsigned Size) { StackSize = Size; } + /// getMaxAlignment - Return the alignment in bytes that this function must be + /// aligned to, which is greater than the default stack alignment provided by + /// the target. + /// + unsigned getMaxAlignment() const { return MaxAlignment; } + + /// setMaxAlignment - Set the preferred alignment. + /// + void setMaxAlignment(unsigned Align) { MaxAlignment = Align; } + /// hasCalls - Return true if the current function has no function calls. /// This is only valid during or after prolog/epilog code emission. /// |