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: |
Rafael Espindola | daeafb4 | 2014-02-19 17:23:20 +0000 | [diff] [blame] | 22 | const MCExpr * |
| 23 | getTTypeGlobalReference(const GlobalValue *GV, unsigned Encoding, |
| 24 | Mangler &Mang, const TargetMachine &TM, |
Craig Topper | 7315602 | 2014-03-02 09:09:27 +0000 | [diff] [blame] | 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. |
Rafael Espindola | fa0f728 | 2014-02-08 14:53:28 +0000 | [diff] [blame] | 30 | MCSymbol *getCFIPersonalitySymbol(const GlobalValue *GV, Mangler &Mang, |
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 { |
David Blaikie | 1b01ae8 | 2013-07-01 21:45:25 +0000 | [diff] [blame] | 43 | /// \brief Describe a TLS variable address within debug info. |
Craig Topper | 7315602 | 2014-03-02 09:09:27 +0000 | [diff] [blame] | 44 | const MCExpr *getDebugThreadLocalSymbol(const MCSymbol *Sym) const override; |
Rafael Espindola | ca3e0ee | 2012-06-19 00:48:28 +0000 | [diff] [blame] | 45 | }; |
| 46 | |
Derek Schuff | 072f93f | 2015-03-11 16:16:09 +0000 | [diff] [blame^] | 47 | /// X86LinuxNaClTargetObjectFile - This implementation is used for linux and |
| 48 | /// Native Client on x86 and x86-64. |
| 49 | class X86LinuxNaClTargetObjectFile : public X86ELFTargetObjectFile { |
Paul Robinson | 06a8eb8 | 2015-03-03 21:01:27 +0000 | [diff] [blame] | 50 | void Initialize(MCContext &Ctx, const TargetMachine &TM) override; |
| 51 | }; |
| 52 | |
David Majnemer | dee1057 | 2014-01-15 09:16:42 +0000 | [diff] [blame] | 53 | /// \brief This implementation is used for Windows targets on x86 and x86-64. |
| 54 | class X86WindowsTargetObjectFile : public TargetLoweringObjectFileCOFF { |
Craig Topper | 7315602 | 2014-03-02 09:09:27 +0000 | [diff] [blame] | 55 | const MCExpr * |
| 56 | getExecutableRelativeSymbol(const ConstantExpr *CE, Mangler &Mang, |
| 57 | const TargetMachine &TM) const override; |
David Majnemer | 8bce66b | 2014-07-14 22:57:27 +0000 | [diff] [blame] | 58 | |
| 59 | /// \brief Given a mergeable constant with the specified size and relocation |
| 60 | /// information, return a section that it should be placed in. |
| 61 | const MCSection *getSectionForConstant(SectionKind Kind, |
| 62 | const Constant *C) const override; |
David Majnemer | dee1057 | 2014-01-15 09:16:42 +0000 | [diff] [blame] | 63 | }; |
| 64 | |
Chris Lattner | b866602 | 2009-09-16 01:46:41 +0000 | [diff] [blame] | 65 | } // end namespace llvm |
| 66 | |
| 67 | #endif |