[llvm-commits] CVS: llvm/include/llvm/Target/MachineFrameInfo.h
vadve at cs.uiuc.edu
vadve at cs.uiuc.edu
Mon Sep 16 10:58:01 PDT 2002
Changes in directory llvm/include/llvm/Target:
MachineFrameInfo.h updated: 1.4 -> 1.5
---
Log message:
Add method adjustAlignment so that stack slot alignments can be computed
in a target-dependent manner (because of the dang OFFSET in Sparc v9).
---
Diffs of the changes:
Index: llvm/include/llvm/Target/MachineFrameInfo.h
diff -u llvm/include/llvm/Target/MachineFrameInfo.h:1.4 llvm/include/llvm/Target/MachineFrameInfo.h:1.5
--- llvm/include/llvm/Target/MachineFrameInfo.h:1.4 Fri Aug 9 15:07:44 2002
+++ llvm/include/llvm/Target/MachineFrameInfo.h Mon Sep 16 10:57:43 2002
@@ -19,7 +19,6 @@
public:
MachineFrameInfo(const TargetMachine& tgt) : target(tgt) {}
- //
// These methods provide constant parameters of the frame layout.
//
virtual int getStackFrameSizeAlignment () const = 0;
@@ -27,8 +26,15 @@
virtual int getNumFixedOutgoingArgs () const = 0;
virtual int getSizeOfEachArgOnStack () const = 0;
virtual bool argsOnStackHaveFixedSize () const = 0;
-
- //
+
+ // This method adjusts a stack offset to meet alignment rules of target.
+ //
+ virtual int adjustAlignment (int unalignedOffset,
+ bool growUp,
+ unsigned int align) const {
+ return unalignedOffset + (growUp? +1:-1)*(unalignedOffset % align);
+ }
+
// These methods compute offsets using the frame contents for a
// particular method. The frame contents are obtained from the
// MachineCodeInfoForMethod object for the given method.
More information about the llvm-commits
mailing list