blob: 2fc2d65af7c3dc2e36afaf830a180efc79db670e [file] [log] [blame]
Dan Gohmanf17a25c2007-07-18 16:29:46 +00001//=====-- X86TargetAsmInfo.h - X86 asm properties -------------*- C++ -*--====//
2//
3// The LLVM Compiler Infrastructure
4//
Chris Lattner081ce942007-12-29 20:36:04 +00005// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
Dan Gohmanf17a25c2007-07-18 16:29:46 +00007//
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
19namespace llvm {
20
21 // Forward declaration.
22 class X86TargetMachine;
Anton Korobeynikov4e4ea3b2008-07-09 13:23:37 +000023 class GlobalVariable;
Dan Gohmanf17a25c2007-07-18 16:29:46 +000024
25 struct X86TargetAsmInfo : public TargetAsmInfo {
Dan Gohmancdd820b2007-09-25 20:27:06 +000026 explicit X86TargetAsmInfo(const X86TargetMachine &TM);
Anton Korobeynikov8bf5d342008-07-09 13:19:08 +000027
Dan Gohmanf17a25c2007-07-18 16:29:46 +000028 virtual bool ExpandInlineAsm(CallInst *CI) const;
Anton Korobeynikov65c0d872008-02-27 23:33:50 +000029
Dan Gohmanf17a25c2007-07-18 16:29:46 +000030 private:
Dan Gohmanf17a25c2007-07-18 16:29:46 +000031 bool LowerToBSwap(CallInst *CI) const;
Anton Korobeynikovf700e682008-07-09 13:20:48 +000032 protected:
33 const X86TargetMachine* X86TM;
34 };
35
36 struct X86DarwinTargetAsmInfo : public X86TargetAsmInfo {
Anton Korobeynikovc33a1ff2008-07-09 13:28:49 +000037 const Section* TextCoalSection;
38 const Section* ConstDataCoalSection;
39 const Section* ConstDataSection;
40 const Section* DataCoalSection;
41
Anton Korobeynikovf700e682008-07-09 13:20:48 +000042 explicit X86DarwinTargetAsmInfo(const X86TargetMachine &TM);
Anton Korobeynikovcd2a4e52008-07-09 13:21:08 +000043 virtual unsigned PreferredEHDataFormat(DwarfEncoding::Target Reason,
44 bool Global) const;
Anton Korobeynikovc33a1ff2008-07-09 13:28:49 +000045 virtual const Section* SelectSectionForGlobal(const GlobalValue *GV) const;
Anton Korobeynikov52069b52008-07-09 13:21:29 +000046 virtual std::string UniqueSectionForGlobal(const GlobalValue* GV,
47 SectionKind::Kind kind) const;
Anton Korobeynikovc33a1ff2008-07-09 13:28:49 +000048 const Section* MergeableConstSection(const GlobalVariable *GV) const;
49 const Section* MergeableStringSection(const GlobalVariable *GV) const;
Anton Korobeynikovf700e682008-07-09 13:20:48 +000050 };
51
52 struct X86ELFTargetAsmInfo : public X86TargetAsmInfo {
53 explicit X86ELFTargetAsmInfo(const X86TargetMachine &TM);
Anton Korobeynikovcd2a4e52008-07-09 13:21:08 +000054 virtual unsigned PreferredEHDataFormat(DwarfEncoding::Target Reason,
55 bool Global) const;
Anton Korobeynikovb900e2b2008-07-09 13:23:08 +000056
Anton Korobeynikovc33a1ff2008-07-09 13:28:49 +000057 virtual const Section* SelectSectionForGlobal(const GlobalValue *GV) const;
Anton Korobeynikov49881c52008-07-09 13:21:49 +000058 virtual std::string PrintSectionFlags(unsigned flags) const;
Anton Korobeynikovc33a1ff2008-07-09 13:28:49 +000059 const Section* MergeableConstSection(const GlobalVariable *GV) const;
60 const Section* MergeableStringSection(const GlobalVariable *GV) const ;
Anton Korobeynikovf700e682008-07-09 13:20:48 +000061 };
62
63 struct X86COFFTargetAsmInfo : public X86TargetAsmInfo {
64 explicit X86COFFTargetAsmInfo(const X86TargetMachine &TM);
Anton Korobeynikovcd2a4e52008-07-09 13:21:08 +000065 virtual unsigned PreferredEHDataFormat(DwarfEncoding::Target Reason,
66 bool Global) const;
Anton Korobeynikov52069b52008-07-09 13:21:29 +000067 virtual std::string UniqueSectionForGlobal(const GlobalValue* GV,
68 SectionKind::Kind kind) const;
Anton Korobeynikov49881c52008-07-09 13:21:49 +000069 virtual std::string PrintSectionFlags(unsigned flags) const;
Anton Korobeynikovf700e682008-07-09 13:20:48 +000070 };
71
72 struct X86WinTargetAsmInfo : public X86TargetAsmInfo {
73 explicit X86WinTargetAsmInfo(const X86TargetMachine &TM);
Dan Gohmanf17a25c2007-07-18 16:29:46 +000074 };
75} // namespace llvm
76
77#endif