Eliminate SectionFlags, just embed a SectionKind into Section
[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 "X86TargetMachine.h"
18 #include "llvm/Target/TargetAsmInfo.h"
19 #include "llvm/Target/ELFTargetAsmInfo.h"
20 #include "llvm/Target/DarwinTargetAsmInfo.h"
21 #include "llvm/Support/Compiler.h"
22
23 namespace llvm {
24
25   extern const char *const x86_asm_table[];
26
27   template <class BaseTAI>
28   struct X86TargetAsmInfo : public BaseTAI {
29     explicit X86TargetAsmInfo(const X86TargetMachine &TM) : BaseTAI(TM) {
30       BaseTAI::AsmTransCBE = x86_asm_table;
31       BaseTAI::AssemblerDialect =TM.getSubtarget<X86Subtarget>().getAsmFlavor();
32     }
33   };
34
35   typedef X86TargetAsmInfo<TargetAsmInfo> X86GenericTargetAsmInfo;
36
37   EXTERN_TEMPLATE_INSTANTIATION(class X86TargetAsmInfo<TargetAsmInfo>);
38
39   struct X86DarwinTargetAsmInfo : public X86TargetAsmInfo<DarwinTargetAsmInfo> {
40     explicit X86DarwinTargetAsmInfo(const X86TargetMachine &TM);
41     virtual unsigned PreferredEHDataFormat(DwarfEncoding::Target Reason,
42                                            bool Global) const;
43     virtual const char *getEHGlobalPrefix() const;
44   };
45
46   struct X86ELFTargetAsmInfo : public X86TargetAsmInfo<ELFTargetAsmInfo> {
47     explicit X86ELFTargetAsmInfo(const X86TargetMachine &TM);
48     virtual unsigned PreferredEHDataFormat(DwarfEncoding::Target Reason,
49                                            bool Global) const;
50   };
51
52   struct X86COFFTargetAsmInfo : public X86GenericTargetAsmInfo {
53     explicit X86COFFTargetAsmInfo(const X86TargetMachine &TM);
54     virtual unsigned PreferredEHDataFormat(DwarfEncoding::Target Reason,
55                                            bool Global) const;
56     virtual const char *
57     getSectionPrefixForUniqueGlobal(SectionKind kind) const;
58     
59     virtual void getSectionFlagsAsString(SectionKind Kind,
60                                          SmallVectorImpl<char> &Str) const;
61   };
62
63   struct X86WinTargetAsmInfo : public X86GenericTargetAsmInfo {
64     explicit X86WinTargetAsmInfo(const X86TargetMachine &TM);
65   };
66
67 } // namespace llvm
68
69 #endif