diff options
Diffstat (limited to 'include/llvm')
-rw-r--r-- | include/llvm/CodeGen/MachineFunction.h | 11 | ||||
-rw-r--r-- | include/llvm/Target/TargetLowering.h | 3 |
2 files changed, 14 insertions, 0 deletions
diff --git a/include/llvm/CodeGen/MachineFunction.h b/include/llvm/CodeGen/MachineFunction.h index 0074f1a5f2..e9cecf9d68 100644 --- a/include/llvm/CodeGen/MachineFunction.h +++ b/include/llvm/CodeGen/MachineFunction.h @@ -111,6 +111,9 @@ class MachineFunction : private Annotation { // Tracks debug locations. DebugLocTracker DebugLocInfo; + // The alignment of the function. + unsigned Alignment; + public: MachineFunction(const Function *Fn, const TargetMachine &TM); ~MachineFunction(); @@ -148,6 +151,14 @@ public: MachineConstantPool *getConstantPool() { return ConstantPool; } const MachineConstantPool *getConstantPool() const { return ConstantPool; } + /// getAlignment - Return the alignment of the function. + /// + unsigned getAlignment() const { return Alignment; } + + /// setAlignment - Set the alignment of the function. + /// + void setAlignment(unsigned A) { Alignment = A; } + /// MachineFunctionInfo - Keep track of various per-function pieces of /// information for backends that would like to do so. /// diff --git a/include/llvm/Target/TargetLowering.h b/include/llvm/Target/TargetLowering.h index 02451c2b45..e52880fe95 100644 --- a/include/llvm/Target/TargetLowering.h +++ b/include/llvm/Target/TargetLowering.h @@ -736,6 +736,9 @@ public: /// PIC relocation models. virtual bool isOffsetFoldingLegal(const GlobalAddressSDNode *GA) const; + /// getFunctionAlignment - Return the alignment of this function. + virtual unsigned getFunctionAlignment(const Function *) const = 0; + //===--------------------------------------------------------------------===// // TargetLowering Optimization Methods // |