Nate Begeman | fb5792f | 2005-07-12 01:41:54 +0000 | [diff] [blame] | 1 | //=====-- X86Subtarget.h - Define TargetMachine for the X86 ---*- C++ -*--====// |
| 2 | // |
| 3 | // The LLVM Compiler Infrastructure |
| 4 | // |
| 5 | // This file was developed by Nate Begeman and is distributed under the |
| 6 | // University of Illinois Open Source License. See LICENSE.TXT for details. |
| 7 | // |
| 8 | //===----------------------------------------------------------------------===// |
| 9 | // |
| 10 | // This file declares the X86 specific subclass of TargetSubtarget. |
| 11 | // |
| 12 | //===----------------------------------------------------------------------===// |
| 13 | |
| 14 | #ifndef X86SUBTARGET_H |
| 15 | #define X86SUBTARGET_H |
| 16 | |
| 17 | #include "llvm/Target/TargetSubtarget.h" |
| 18 | |
| 19 | namespace llvm { |
| 20 | class Module; |
| 21 | |
| 22 | class X86Subtarget : public TargetSubtarget { |
| 23 | protected: |
Chris Lattner | b151aca | 2005-07-12 02:36:10 +0000 | [diff] [blame] | 24 | /// stackAlignment - The minimum alignment known to hold of the stack frame on |
| 25 | /// entry to the function and which must be maintained by every function. |
Nate Begeman | fb5792f | 2005-07-12 01:41:54 +0000 | [diff] [blame] | 26 | unsigned stackAlignment; |
Jeff Cohen | 9eb59ec | 2005-07-27 05:53:44 +0000 | [diff] [blame] | 27 | |
Nate Begeman | fb5792f | 2005-07-12 01:41:54 +0000 | [diff] [blame] | 28 | /// Used by instruction selector |
| 29 | bool indirectExternAndWeakGlobals; |
Jeff Cohen | 9eb59ec | 2005-07-27 05:53:44 +0000 | [diff] [blame] | 30 | |
Nate Begeman | fb5792f | 2005-07-12 01:41:54 +0000 | [diff] [blame] | 31 | /// Used by the asm printer |
| 32 | bool asmDarwinLinkerStubs; |
| 33 | bool asmLeadingUnderscore; |
| 34 | bool asmAlignmentIsInBytes; |
| 35 | bool asmPrintDotLocalConstants; |
| 36 | bool asmPrintDotLCommConstants; |
| 37 | bool asmPrintConstantAlignment; |
| 38 | public: |
Jeff Cohen | 9eb59ec | 2005-07-27 05:53:44 +0000 | [diff] [blame] | 39 | /// This constructor initializes the data members to match that |
Nate Begeman | fb5792f | 2005-07-12 01:41:54 +0000 | [diff] [blame] | 40 | /// of the specified module. |
| 41 | /// |
| 42 | X86Subtarget(const Module &M); |
Chris Lattner | b151aca | 2005-07-12 02:36:10 +0000 | [diff] [blame] | 43 | |
| 44 | /// getStackAlignment - Returns the minimum alignment known to hold of the |
| 45 | /// stack frame on entry to the function and which must be maintained by every |
| 46 | /// function for this subtarget. |
Nate Begeman | fb5792f | 2005-07-12 01:41:54 +0000 | [diff] [blame] | 47 | unsigned getStackAlignment() const { return stackAlignment; } |
Jeff Cohen | 9eb59ec | 2005-07-27 05:53:44 +0000 | [diff] [blame] | 48 | |
Nate Begeman | fb5792f | 2005-07-12 01:41:54 +0000 | [diff] [blame] | 49 | /// Returns true if the instruction selector should treat global values |
Jeff Cohen | 9eb59ec | 2005-07-27 05:53:44 +0000 | [diff] [blame] | 50 | /// referencing external or weak symbols as indirect rather than direct |
Nate Begeman | fb5792f | 2005-07-12 01:41:54 +0000 | [diff] [blame] | 51 | /// references. |
Chris Lattner | b151aca | 2005-07-12 02:36:10 +0000 | [diff] [blame] | 52 | bool getIndirectExternAndWeakGlobals() const { |
| 53 | return indirectExternAndWeakGlobals; |
| 54 | } |
Nate Begeman | fb5792f | 2005-07-12 01:41:54 +0000 | [diff] [blame] | 55 | }; |
| 56 | } // End llvm namespace |
| 57 | |
| 58 | #endif |