Evan Cheng | e8bd0a3 | 2006-06-06 23:30:24 +0000 | [diff] [blame] | 1 | //====- X86MachineFuctionInfo.h - X86 machine function info -----*- C++ -*-===// |
| 2 | // |
| 3 | // The LLVM Compiler Infrastructure |
| 4 | // |
| 5 | // This file was developed by the Evan Cheng and is distributed under |
| 6 | // the University of Illinois Open Source License. See LICENSE.TXT for details. |
| 7 | // |
| 8 | //===----------------------------------------------------------------------===// |
| 9 | // |
| 10 | // This file declares X86-specific per-machine-function information. |
| 11 | // |
| 12 | //===----------------------------------------------------------------------===// |
| 13 | |
| 14 | #ifndef X86MACHINEFUNCTIONINFO_H |
| 15 | #define X86MACHINEFUNCTIONINFO_H |
| 16 | |
| 17 | #include "llvm/CodeGen/MachineFunction.h" |
| 18 | |
| 19 | namespace llvm { |
| 20 | |
Anton Korobeynikov | f824868 | 2006-09-20 22:03:51 +0000 | [diff] [blame^] | 21 | enum NameDecorationStyle { |
| 22 | None, |
| 23 | StdCall, |
| 24 | FastCall |
| 25 | }; |
| 26 | |
Evan Cheng | e5e228d | 2006-06-09 06:25:10 +0000 | [diff] [blame] | 27 | /// X86FunctionInfo - This class is derived from MachineFunction private |
| 28 | /// X86 target-specific information for each MachineFunction. |
Evan Cheng | e8bd0a3 | 2006-06-06 23:30:24 +0000 | [diff] [blame] | 29 | class X86FunctionInfo : public MachineFunctionInfo { |
Anton Korobeynikov | f824868 | 2006-09-20 22:03:51 +0000 | [diff] [blame^] | 30 | /// ForceFramePointer - True if the function is required to use of frame |
| 31 | /// pointer for reasons other than it containing dynamic allocation or |
| 32 | /// that FP eliminatation is turned off. For example, Cygwin main function |
| 33 | /// contains stack pointer re-alignment code which requires FP. |
Evan Cheng | e5e228d | 2006-06-09 06:25:10 +0000 | [diff] [blame] | 34 | bool ForceFramePointer; |
Anton Korobeynikov | f824868 | 2006-09-20 22:03:51 +0000 | [diff] [blame^] | 35 | |
| 36 | /// BytesToPopOnReturn - amount of bytes function pops on return. |
| 37 | /// Used on windows platform for stdcall & fastcall name decoration |
| 38 | unsigned BytesToPopOnReturn; |
| 39 | |
| 40 | /// If the function requires additional name decoration, DecorationStyle holds |
| 41 | /// the right way to do so. |
| 42 | NameDecorationStyle DecorationStyle; |
| 43 | |
Evan Cheng | e8bd0a3 | 2006-06-06 23:30:24 +0000 | [diff] [blame] | 44 | public: |
Anton Korobeynikov | f824868 | 2006-09-20 22:03:51 +0000 | [diff] [blame^] | 45 | X86FunctionInfo() : ForceFramePointer(false), |
| 46 | BytesToPopOnReturn(0), |
| 47 | DecorationStyle(None) {} |
| 48 | |
| 49 | X86FunctionInfo(MachineFunction& MF) : ForceFramePointer(false), |
| 50 | BytesToPopOnReturn(0), |
| 51 | DecorationStyle(None) {} |
| 52 | |
Evan Cheng | e8bd0a3 | 2006-06-06 23:30:24 +0000 | [diff] [blame] | 53 | bool getForceFramePointer() const { return ForceFramePointer;} |
| 54 | void setForceFramePointer(bool forceFP) { ForceFramePointer = forceFP; } |
Anton Korobeynikov | f824868 | 2006-09-20 22:03:51 +0000 | [diff] [blame^] | 55 | |
| 56 | unsigned getBytesToPopOnReturn() const { return BytesToPopOnReturn; } |
| 57 | void setBytesToPopOnReturn (unsigned bytes) { BytesToPopOnReturn = bytes;} |
| 58 | |
| 59 | NameDecorationStyle getDecorationStyle() const { return DecorationStyle; } |
| 60 | void setDecorationStyle(NameDecorationStyle style) { DecorationStyle = style;} |
| 61 | |
Evan Cheng | e8bd0a3 | 2006-06-06 23:30:24 +0000 | [diff] [blame] | 62 | }; |
| 63 | } // End llvm namespace |
| 64 | |
| 65 | #endif |