Jia Liu | b22310f | 2012-02-18 12:03:15 +0000 | [diff] [blame] | 1 | //===-- X86TargetObjectFile.h - X86 Object Info -----------------*- C++ -*-===// |
Chris Lattner | b866602 | 2009-09-16 01:46:41 +0000 | [diff] [blame] | 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 | |
Benjamin Kramer | a7c40ef | 2014-08-13 16:26:38 +0000 | [diff] [blame] | 10 | #ifndef LLVM_LIB_TARGET_X86_X86TARGETOBJECTFILE_H |
| 11 | #define LLVM_LIB_TARGET_X86_X86TARGETOBJECTFILE_H |
Chris Lattner | b866602 | 2009-09-16 01:46:41 +0000 | [diff] [blame] | 12 | |
Anton Korobeynikov | ab663a0 | 2010-02-15 22:37:53 +0000 | [diff] [blame] | 13 | #include "llvm/CodeGen/TargetLoweringObjectFileImpl.h" |
Chris Lattner | b866602 | 2009-09-16 01:46:41 +0000 | [diff] [blame] | 14 | #include "llvm/Target/TargetLoweringObjectFile.h" |
| 15 | |
| 16 | namespace llvm { |
Anton Korobeynikov | ae4ccc1 | 2010-02-15 22:35:59 +0000 | [diff] [blame] | 17 | |
Bill Wendling | 8ed4446 | 2012-06-26 10:05:06 +0000 | [diff] [blame] | 18 | /// X86_64MachoTargetObjectFile - This TLOF implementation is used for Darwin |
Bill Wendling | 0344874 | 2010-03-15 19:04:37 +0000 | [diff] [blame] | 19 | /// x86-64. |
Bill Wendling | 8ed4446 | 2012-06-26 10:05:06 +0000 | [diff] [blame] | 20 | class X86_64MachoTargetObjectFile : public TargetLoweringObjectFileMachO { |
Bill Wendling | 0344874 | 2010-03-15 19:04:37 +0000 | [diff] [blame] | 21 | public: |
Eric Christopher | 4367c7f | 2016-09-16 07:33:15 +0000 | [diff] [blame] | 22 | const MCExpr *getTTypeGlobalReference(const GlobalValue *GV, |
| 23 | unsigned Encoding, |
| 24 | const TargetMachine &TM, |
| 25 | MachineModuleInfo *MMI, |
| 26 | MCStreamer &Streamer) const override; |
Rafael Espindola | 0870434 | 2011-04-27 23:08:15 +0000 | [diff] [blame] | 27 | |
| 28 | // getCFIPersonalitySymbol - The symbol that gets passed to |
| 29 | // .cfi_personality. |
Eric Christopher | 4367c7f | 2016-09-16 07:33:15 +0000 | [diff] [blame] | 30 | MCSymbol *getCFIPersonalitySymbol(const GlobalValue *GV, |
Rafael Espindola | daeafb4 | 2014-02-19 17:23:20 +0000 | [diff] [blame] | 31 | const TargetMachine &TM, |
Craig Topper | 7315602 | 2014-03-02 09:09:27 +0000 | [diff] [blame] | 32 | MachineModuleInfo *MMI) const override; |
Bruno Cardoso Lopes | 24492b0 | 2015-02-23 21:26:18 +0000 | [diff] [blame] | 33 | |
Bruno Cardoso Lopes | 618c67a | 2015-03-06 13:49:05 +0000 | [diff] [blame] | 34 | const MCExpr *getIndirectSymViaGOTPCRel(const MCSymbol *Sym, |
| 35 | const MCValue &MV, int64_t Offset, |
| 36 | MachineModuleInfo *MMI, |
| 37 | MCStreamer &Streamer) const override; |
Chris Lattner | b866602 | 2009-09-16 01:46:41 +0000 | [diff] [blame] | 38 | }; |
Anton Korobeynikov | ae4ccc1 | 2010-02-15 22:35:59 +0000 | [diff] [blame] | 39 | |
Paul Robinson | 06a8eb8 | 2015-03-03 21:01:27 +0000 | [diff] [blame] | 40 | /// \brief This implemenatation is used for X86 ELF targets that don't |
| 41 | /// have a further specialization. |
| 42 | class X86ELFTargetObjectFile : public TargetLoweringObjectFileELF { |
Peter Collingbourne | 265ebd7 | 2016-04-22 20:40:10 +0000 | [diff] [blame] | 43 | public: |
| 44 | X86ELFTargetObjectFile() { |
| 45 | PLTRelativeVariantKind = MCSymbolRefExpr::VK_PLT; |
| 46 | } |
| 47 | |
David Blaikie | 1b01ae8 | 2013-07-01 21:45:25 +0000 | [diff] [blame] | 48 | /// \brief Describe a TLS variable address within debug info. |
Craig Topper | 7315602 | 2014-03-02 09:09:27 +0000 | [diff] [blame] | 49 | const MCExpr *getDebugThreadLocalSymbol(const MCSymbol *Sym) const override; |
Rafael Espindola | ca3e0ee | 2012-06-19 00:48:28 +0000 | [diff] [blame] | 50 | }; |
| 51 | |
Davide Italiano | a9f85d6 | 2016-09-26 22:53:15 +0000 | [diff] [blame] | 52 | /// X86FreeBSDTargetObjectFile - This implementation is used for FreeBSD |
| 53 | /// on x86 and x86-64. |
| 54 | class X86FreeBSDTargetObjectFile : public X86ELFTargetObjectFile { |
| 55 | void Initialize(MCContext &Ctx, const TargetMachine &TM) override; |
| 56 | }; |
| 57 | |
Petr Hosek | e023d62 | 2016-10-06 05:17:26 +0000 | [diff] [blame] | 58 | /// \brief This implementation is used for Fuchsia on x86-64. |
| 59 | class X86FuchsiaTargetObjectFile : public X86ELFTargetObjectFile { |
| 60 | void Initialize(MCContext &Ctx, const TargetMachine &TM) override; |
| 61 | }; |
| 62 | |
Derek Schuff | 072f93f | 2015-03-11 16:16:09 +0000 | [diff] [blame] | 63 | /// X86LinuxNaClTargetObjectFile - This implementation is used for linux and |
| 64 | /// Native Client on x86 and x86-64. |
| 65 | class X86LinuxNaClTargetObjectFile : public X86ELFTargetObjectFile { |
Paul Robinson | 06a8eb8 | 2015-03-03 21:01:27 +0000 | [diff] [blame] | 66 | void Initialize(MCContext &Ctx, const TargetMachine &TM) override; |
| 67 | }; |
| 68 | |
Davide Italiano | 9b8e3d3 | 2017-06-21 20:36:32 +0000 | [diff] [blame] | 69 | /// \brief This implementation is used for Solaris on x86/x86-64. |
| 70 | class X86SolarisTargetObjectFile : public X86ELFTargetObjectFile { |
| 71 | void Initialize(MCContext &Ctx, const TargetMachine &TM) override; |
| 72 | }; |
| 73 | |
David Majnemer | dee1057 | 2014-01-15 09:16:42 +0000 | [diff] [blame] | 74 | /// \brief This implementation is used for Windows targets on x86 and x86-64. |
| 75 | class X86WindowsTargetObjectFile : public TargetLoweringObjectFileCOFF { |
Craig Topper | 7315602 | 2014-03-02 09:09:27 +0000 | [diff] [blame] | 76 | const MCExpr * |
Peter Collingbourne | 265ebd7 | 2016-04-22 20:40:10 +0000 | [diff] [blame] | 77 | lowerRelativeReference(const GlobalValue *LHS, const GlobalValue *RHS, |
Peter Collingbourne | 265ebd7 | 2016-04-22 20:40:10 +0000 | [diff] [blame] | 78 | const TargetMachine &TM) const override; |
David Majnemer | 8bce66b | 2014-07-14 22:57:27 +0000 | [diff] [blame] | 79 | |
| 80 | /// \brief Given a mergeable constant with the specified size and relocation |
| 81 | /// information, return a section that it should be placed in. |
Mehdi Amini | 5c0fa58 | 2015-07-16 06:04:17 +0000 | [diff] [blame] | 82 | MCSection *getSectionForConstant(const DataLayout &DL, SectionKind Kind, |
David Majnemer | a3ea407 | 2016-02-21 01:30:30 +0000 | [diff] [blame] | 83 | const Constant *C, |
| 84 | unsigned &Align) const override; |
David Majnemer | dee1057 | 2014-01-15 09:16:42 +0000 | [diff] [blame] | 85 | }; |
| 86 | |
Chris Lattner | b866602 | 2009-09-16 01:46:41 +0000 | [diff] [blame] | 87 | } // end namespace llvm |
| 88 | |
| 89 | #endif |