blob: dba2bc6b76e242e643707c906bfeba6649bd4cc8 [file] [log] [blame]
Nate Begeman8c00f8c2005-08-04 07:12:09 +00001//=====---- X86Subtarget.h - Define Subtarget for the X86 -----*- C++ -*--====//
Nate Begemanfb5792f2005-07-12 01:41:54 +00002//
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 Laskeyb1e11802005-09-01 21:38:21 +000019#include <string>
20
Nate Begemanfb5792f2005-07-12 01:41:54 +000021namespace llvm {
22class Module;
23
24class X86Subtarget : public TargetSubtarget {
25protected:
Chris Lattnerb151aca2005-07-12 02:36:10 +000026 /// 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 Begemanfb5792f2005-07-12 01:41:54 +000028 unsigned stackAlignment;
Jeff Cohen9eb59ec2005-07-27 05:53:44 +000029
Nate Begemanfb5792f2005-07-12 01:41:54 +000030 /// Used by instruction selector
31 bool indirectExternAndWeakGlobals;
Jeff Cohen9eb59ec2005-07-27 05:53:44 +000032
Nate Begemanfb5792f2005-07-12 01:41:54 +000033 /// Used by the asm printer
34 bool asmDarwinLinkerStubs;
35 bool asmLeadingUnderscore;
36 bool asmAlignmentIsInBytes;
37 bool asmPrintDotLocalConstants;
38 bool asmPrintDotLCommConstants;
39 bool asmPrintConstantAlignment;
40public:
Chris Lattnere5600e52005-11-21 22:31:58 +000041 enum {
42 isELF, isCygwin, isDarwin, isWindows
43 } TargetType;
44
Jeff Cohen9eb59ec2005-07-27 05:53:44 +000045 /// This constructor initializes the data members to match that
Nate Begemanfb5792f2005-07-12 01:41:54 +000046 /// of the specified module.
47 ///
Jim Laskeyb1e11802005-09-01 21:38:21 +000048 X86Subtarget(const Module &M, const std::string &FS);
Chris Lattnerb151aca2005-07-12 02:36:10 +000049
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 Begemanfb5792f2005-07-12 01:41:54 +000053 unsigned getStackAlignment() const { return stackAlignment; }
Jeff Cohen9eb59ec2005-07-27 05:53:44 +000054
Nate Begemanfb5792f2005-07-12 01:41:54 +000055 /// Returns true if the instruction selector should treat global values
Jeff Cohen9eb59ec2005-07-27 05:53:44 +000056 /// referencing external or weak symbols as indirect rather than direct
Nate Begemanfb5792f2005-07-12 01:41:54 +000057 /// references.
Chris Lattnerb151aca2005-07-12 02:36:10 +000058 bool getIndirectExternAndWeakGlobals() const {
59 return indirectExternAndWeakGlobals;
60 }
Nate Begemanfb5792f2005-07-12 01:41:54 +000061};
62} // End llvm namespace
63
64#endif