PIC support in X86FastISel.
[oota-llvm.git] / lib / Target / X86 / X86TargetAsmInfo.h
1 //=====-- X86TargetAsmInfo.h - X86 asm properties -------------*- C++ -*--====//
2 //
3 //                     The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 //
10 // This file contains the declaration of the X86TargetAsmInfo class.
11 //
12 //===----------------------------------------------------------------------===//
13
14 #ifndef X86TARGETASMINFO_H
15 #define X86TARGETASMINFO_H
16
17 #include "llvm/Target/TargetAsmInfo.h"
18 #include "llvm/Target/ELFTargetAsmInfo.h"
19 #include "llvm/Target/DarwinTargetAsmInfo.h"
20
21 namespace llvm {
22
23   // Forward declaration.
24   class X86TargetMachine;
25
26   struct X86TargetAsmInfo : public virtual TargetAsmInfo {
27     explicit X86TargetAsmInfo(const X86TargetMachine &TM);
28
29     virtual bool ExpandInlineAsm(CallInst *CI) const;
30
31   private:
32     bool LowerToBSwap(CallInst *CI) const;
33   };
34
35   struct X86DarwinTargetAsmInfo : public X86TargetAsmInfo,
36                                   public DarwinTargetAsmInfo {
37     explicit X86DarwinTargetAsmInfo(const X86TargetMachine &TM);
38     virtual unsigned PreferredEHDataFormat(DwarfEncoding::Target Reason,
39                                            bool Global) const;
40   };
41
42   struct X86ELFTargetAsmInfo : public X86TargetAsmInfo,
43                                public ELFTargetAsmInfo {
44     explicit X86ELFTargetAsmInfo(const X86TargetMachine &TM);
45     virtual unsigned PreferredEHDataFormat(DwarfEncoding::Target Reason,
46                                            bool Global) const;
47   };
48
49   struct X86COFFTargetAsmInfo : public X86TargetAsmInfo {
50     explicit X86COFFTargetAsmInfo(const X86TargetMachine &TM);
51     virtual unsigned PreferredEHDataFormat(DwarfEncoding::Target Reason,
52                                            bool Global) const;
53     virtual std::string UniqueSectionForGlobal(const GlobalValue* GV,
54                                                SectionKind::Kind kind) const;
55     virtual std::string printSectionFlags(unsigned flags) const;
56   protected:
57     const X86TargetMachine *X86TM;
58   };
59
60   struct X86WinTargetAsmInfo : public X86TargetAsmInfo {
61     explicit X86WinTargetAsmInfo(const X86TargetMachine &TM);
62   };
63 } // namespace llvm
64
65 #endif