Dan Gohman | f17a25c | 2007-07-18 16:29:46 +0000 | [diff] [blame] | 1 | //=====-- X86TargetAsmInfo.h - X86 asm properties -------------*- C++ -*--====// |
| 2 | // |
| 3 | // The LLVM Compiler Infrastructure |
| 4 | // |
Chris Lattner | 081ce94 | 2007-12-29 20:36:04 +0000 | [diff] [blame] | 5 | // This file is distributed under the University of Illinois Open Source |
| 6 | // License. See LICENSE.TXT for details. |
Dan Gohman | f17a25c | 2007-07-18 16:29:46 +0000 | [diff] [blame] | 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 | |
| 19 | namespace llvm { |
| 20 | |
| 21 | // Forward declaration. |
| 22 | class X86TargetMachine; |
Anton Korobeynikov | 4e4ea3b | 2008-07-09 13:23:37 +0000 | [diff] [blame] | 23 | class GlobalVariable; |
Dan Gohman | f17a25c | 2007-07-18 16:29:46 +0000 | [diff] [blame] | 24 | |
| 25 | struct X86TargetAsmInfo : public TargetAsmInfo { |
Dan Gohman | cdd820b | 2007-09-25 20:27:06 +0000 | [diff] [blame] | 26 | explicit X86TargetAsmInfo(const X86TargetMachine &TM); |
Anton Korobeynikov | 8bf5d34 | 2008-07-09 13:19:08 +0000 | [diff] [blame] | 27 | |
Dan Gohman | f17a25c | 2007-07-18 16:29:46 +0000 | [diff] [blame] | 28 | virtual bool ExpandInlineAsm(CallInst *CI) const; |
Anton Korobeynikov | 65c0d87 | 2008-02-27 23:33:50 +0000 | [diff] [blame] | 29 | |
Dan Gohman | f17a25c | 2007-07-18 16:29:46 +0000 | [diff] [blame] | 30 | private: |
Dan Gohman | f17a25c | 2007-07-18 16:29:46 +0000 | [diff] [blame] | 31 | bool LowerToBSwap(CallInst *CI) const; |
Anton Korobeynikov | f700e68 | 2008-07-09 13:20:48 +0000 | [diff] [blame] | 32 | protected: |
| 33 | const X86TargetMachine* X86TM; |
| 34 | }; |
| 35 | |
| 36 | struct X86DarwinTargetAsmInfo : public X86TargetAsmInfo { |
Anton Korobeynikov | c33a1ff | 2008-07-09 13:28:49 +0000 | [diff] [blame] | 37 | const Section* TextCoalSection; |
| 38 | const Section* ConstDataCoalSection; |
| 39 | const Section* ConstDataSection; |
| 40 | const Section* DataCoalSection; |
| 41 | |
Anton Korobeynikov | f700e68 | 2008-07-09 13:20:48 +0000 | [diff] [blame] | 42 | explicit X86DarwinTargetAsmInfo(const X86TargetMachine &TM); |
Anton Korobeynikov | cd2a4e5 | 2008-07-09 13:21:08 +0000 | [diff] [blame] | 43 | virtual unsigned PreferredEHDataFormat(DwarfEncoding::Target Reason, |
| 44 | bool Global) const; |
Anton Korobeynikov | c33a1ff | 2008-07-09 13:28:49 +0000 | [diff] [blame] | 45 | virtual const Section* SelectSectionForGlobal(const GlobalValue *GV) const; |
Anton Korobeynikov | 52069b5 | 2008-07-09 13:21:29 +0000 | [diff] [blame] | 46 | virtual std::string UniqueSectionForGlobal(const GlobalValue* GV, |
| 47 | SectionKind::Kind kind) const; |
Anton Korobeynikov | c33a1ff | 2008-07-09 13:28:49 +0000 | [diff] [blame] | 48 | const Section* MergeableConstSection(const GlobalVariable *GV) const; |
| 49 | const Section* MergeableStringSection(const GlobalVariable *GV) const; |
Anton Korobeynikov | f700e68 | 2008-07-09 13:20:48 +0000 | [diff] [blame] | 50 | }; |
| 51 | |
| 52 | struct X86ELFTargetAsmInfo : public X86TargetAsmInfo { |
| 53 | explicit X86ELFTargetAsmInfo(const X86TargetMachine &TM); |
Anton Korobeynikov | cd2a4e5 | 2008-07-09 13:21:08 +0000 | [diff] [blame] | 54 | virtual unsigned PreferredEHDataFormat(DwarfEncoding::Target Reason, |
| 55 | bool Global) const; |
Anton Korobeynikov | b900e2b | 2008-07-09 13:23:08 +0000 | [diff] [blame] | 56 | |
Anton Korobeynikov | c33a1ff | 2008-07-09 13:28:49 +0000 | [diff] [blame] | 57 | virtual const Section* SelectSectionForGlobal(const GlobalValue *GV) const; |
Anton Korobeynikov | 49881c5 | 2008-07-09 13:21:49 +0000 | [diff] [blame] | 58 | virtual std::string PrintSectionFlags(unsigned flags) const; |
Anton Korobeynikov | c33a1ff | 2008-07-09 13:28:49 +0000 | [diff] [blame] | 59 | const Section* MergeableConstSection(const GlobalVariable *GV) const; |
| 60 | const Section* MergeableStringSection(const GlobalVariable *GV) const ; |
Anton Korobeynikov | f700e68 | 2008-07-09 13:20:48 +0000 | [diff] [blame] | 61 | }; |
| 62 | |
| 63 | struct X86COFFTargetAsmInfo : public X86TargetAsmInfo { |
| 64 | explicit X86COFFTargetAsmInfo(const X86TargetMachine &TM); |
Anton Korobeynikov | cd2a4e5 | 2008-07-09 13:21:08 +0000 | [diff] [blame] | 65 | virtual unsigned PreferredEHDataFormat(DwarfEncoding::Target Reason, |
| 66 | bool Global) const; |
Anton Korobeynikov | 52069b5 | 2008-07-09 13:21:29 +0000 | [diff] [blame] | 67 | virtual std::string UniqueSectionForGlobal(const GlobalValue* GV, |
| 68 | SectionKind::Kind kind) const; |
Anton Korobeynikov | 49881c5 | 2008-07-09 13:21:49 +0000 | [diff] [blame] | 69 | virtual std::string PrintSectionFlags(unsigned flags) const; |
Anton Korobeynikov | f700e68 | 2008-07-09 13:20:48 +0000 | [diff] [blame] | 70 | }; |
| 71 | |
| 72 | struct X86WinTargetAsmInfo : public X86TargetAsmInfo { |
| 73 | explicit X86WinTargetAsmInfo(const X86TargetMachine &TM); |
Dan Gohman | f17a25c | 2007-07-18 16:29:46 +0000 | [diff] [blame] | 74 | }; |
| 75 | } // namespace llvm |
| 76 | |
| 77 | #endif |