Nate Begeman | 8c00f8c | 2005-08-04 07:12:09 +0000 | [diff] [blame] | 1 | //=====---- X86Subtarget.h - Define Subtarget for the X86 -----*- C++ -*--====// |
Nate Begeman | fb5792f | 2005-07-12 01:41:54 +0000 | [diff] [blame] | 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 | |
Jim Laskey | b1e1180 | 2005-09-01 21:38:21 +0000 | [diff] [blame] | 19 | #include <string> |
| 20 | |
Nate Begeman | fb5792f | 2005-07-12 01:41:54 +0000 | [diff] [blame] | 21 | namespace llvm { |
| 22 | class Module; |
| 23 | |
| 24 | class X86Subtarget : public TargetSubtarget { |
| 25 | protected: |
Chris Lattner | b151aca | 2005-07-12 02:36:10 +0000 | [diff] [blame] | 26 | /// stackAlignment - The minimum alignment known to hold of the stack frame on |
| 27 | /// entry to the function and which must be maintained by every function. |
Nate Begeman | fb5792f | 2005-07-12 01:41:54 +0000 | [diff] [blame] | 28 | unsigned stackAlignment; |
Jeff Cohen | 9eb59ec | 2005-07-27 05:53:44 +0000 | [diff] [blame] | 29 | |
Nate Begeman | fb5792f | 2005-07-12 01:41:54 +0000 | [diff] [blame] | 30 | /// Used by instruction selector |
| 31 | bool indirectExternAndWeakGlobals; |
Jeff Cohen | 9eb59ec | 2005-07-27 05:53:44 +0000 | [diff] [blame] | 32 | |
Nate Begeman | fb5792f | 2005-07-12 01:41:54 +0000 | [diff] [blame] | 33 | /// Used by the asm printer |
| 34 | bool asmDarwinLinkerStubs; |
| 35 | bool asmLeadingUnderscore; |
| 36 | bool asmAlignmentIsInBytes; |
| 37 | bool asmPrintDotLocalConstants; |
| 38 | bool asmPrintDotLCommConstants; |
| 39 | bool asmPrintConstantAlignment; |
| 40 | public: |
Chris Lattner | e5600e5 | 2005-11-21 22:31:58 +0000 | [diff] [blame^] | 41 | enum { |
| 42 | isELF, isCygwin, isDarwin, isWindows |
| 43 | } TargetType; |
| 44 | |
Jeff Cohen | 9eb59ec | 2005-07-27 05:53:44 +0000 | [diff] [blame] | 45 | /// This constructor initializes the data members to match that |
Nate Begeman | fb5792f | 2005-07-12 01:41:54 +0000 | [diff] [blame] | 46 | /// of the specified module. |
| 47 | /// |
Jim Laskey | b1e1180 | 2005-09-01 21:38:21 +0000 | [diff] [blame] | 48 | X86Subtarget(const Module &M, const std::string &FS); |
Chris Lattner | b151aca | 2005-07-12 02:36:10 +0000 | [diff] [blame] | 49 | |
| 50 | /// getStackAlignment - Returns the minimum alignment known to hold of the |
| 51 | /// stack frame on entry to the function and which must be maintained by every |
| 52 | /// function for this subtarget. |
Nate Begeman | fb5792f | 2005-07-12 01:41:54 +0000 | [diff] [blame] | 53 | unsigned getStackAlignment() const { return stackAlignment; } |
Jeff Cohen | 9eb59ec | 2005-07-27 05:53:44 +0000 | [diff] [blame] | 54 | |
Nate Begeman | fb5792f | 2005-07-12 01:41:54 +0000 | [diff] [blame] | 55 | /// Returns true if the instruction selector should treat global values |
Jeff Cohen | 9eb59ec | 2005-07-27 05:53:44 +0000 | [diff] [blame] | 56 | /// referencing external or weak symbols as indirect rather than direct |
Nate Begeman | fb5792f | 2005-07-12 01:41:54 +0000 | [diff] [blame] | 57 | /// references. |
Chris Lattner | b151aca | 2005-07-12 02:36:10 +0000 | [diff] [blame] | 58 | bool getIndirectExternAndWeakGlobals() const { |
| 59 | return indirectExternAndWeakGlobals; |
| 60 | } |
Nate Begeman | fb5792f | 2005-07-12 01:41:54 +0000 | [diff] [blame] | 61 | }; |
| 62 | } // End llvm namespace |
| 63 | |
| 64 | #endif |