Merge branch 'master' into msp430
[llvm/msp430.git] / lib / Target / X86 / X86TargetAsmInfo.h
blobf89171d3da713535192da53e8aecde54b6de3530
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.
12 //===----------------------------------------------------------------------===//
14 #ifndef X86TARGETASMINFO_H
15 #define X86TARGETASMINFO_H
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"
23 namespace llvm {
25 extern const char *const x86_asm_table[];
27 template <class BaseTAI>
28 struct X86TargetAsmInfo : public BaseTAI {
29 explicit X86TargetAsmInfo(const X86TargetMachine &TM):
30 BaseTAI(TM) {
31 const X86Subtarget *Subtarget = &TM.getSubtarget<X86Subtarget>();
33 BaseTAI::AsmTransCBE = x86_asm_table;
34 BaseTAI::AssemblerDialect = Subtarget->getAsmFlavor();
37 virtual bool ExpandInlineAsm(CallInst *CI) const;
39 private:
40 bool LowerToBSwap(CallInst *CI) const;
43 typedef X86TargetAsmInfo<TargetAsmInfo> X86GenericTargetAsmInfo;
45 EXTERN_TEMPLATE_INSTANTIATION(class X86TargetAsmInfo<TargetAsmInfo>);
47 struct X86DarwinTargetAsmInfo : public X86TargetAsmInfo<DarwinTargetAsmInfo> {
48 explicit X86DarwinTargetAsmInfo(const X86TargetMachine &TM);
49 virtual unsigned PreferredEHDataFormat(DwarfEncoding::Target Reason,
50 bool Global) const;
51 virtual const char *getEHGlobalPrefix() const;
54 struct X86ELFTargetAsmInfo : public X86TargetAsmInfo<ELFTargetAsmInfo> {
55 explicit X86ELFTargetAsmInfo(const X86TargetMachine &TM);
56 virtual unsigned PreferredEHDataFormat(DwarfEncoding::Target Reason,
57 bool Global) const;
60 struct X86COFFTargetAsmInfo : public X86GenericTargetAsmInfo {
61 explicit X86COFFTargetAsmInfo(const X86TargetMachine &TM);
62 virtual unsigned PreferredEHDataFormat(DwarfEncoding::Target Reason,
63 bool Global) const;
64 virtual std::string UniqueSectionForGlobal(const GlobalValue* GV,
65 SectionKind::Kind kind) const;
66 virtual std::string printSectionFlags(unsigned flags) const;
69 struct X86WinTargetAsmInfo : public X86GenericTargetAsmInfo {
70 explicit X86WinTargetAsmInfo(const X86TargetMachine &TM);
73 } // namespace llvm
75 #endif