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: |
Bruno Cardoso Lopes | 24492b0 | 2015-02-23 21:26:18 +0000 | [diff] [blame] | 22 | X86_64MachoTargetObjectFile(); |
| 23 | |
Rafael Espindola | daeafb4 | 2014-02-19 17:23:20 +0000 | [diff] [blame] | 24 | const MCExpr * |
| 25 | getTTypeGlobalReference(const GlobalValue *GV, unsigned Encoding, |
| 26 | Mangler &Mang, const TargetMachine &TM, |
Craig Topper | 7315602 | 2014-03-02 09:09:27 +0000 | [diff] [blame] | 27 | MachineModuleInfo *MMI, |
| 28 | MCStreamer &Streamer) const override; |
Rafael Espindola | 0870434 | 2011-04-27 23:08:15 +0000 | [diff] [blame] | 29 | |
| 30 | // getCFIPersonalitySymbol - The symbol that gets passed to |
| 31 | // .cfi_personality. |
Rafael Espindola | fa0f728 | 2014-02-08 14:53:28 +0000 | [diff] [blame] | 32 | MCSymbol *getCFIPersonalitySymbol(const GlobalValue *GV, Mangler &Mang, |
Rafael Espindola | daeafb4 | 2014-02-19 17:23:20 +0000 | [diff] [blame] | 33 | const TargetMachine &TM, |
Craig Topper | 7315602 | 2014-03-02 09:09:27 +0000 | [diff] [blame] | 34 | MachineModuleInfo *MMI) const override; |
Bruno Cardoso Lopes | 24492b0 | 2015-02-23 21:26:18 +0000 | [diff] [blame] | 35 | |
| 36 | const MCExpr * |
| 37 | getIndirectSymViaGOTPCRel(const MCSymbol *Sym, |
| 38 | int64_t Offset) const override; |
Chris Lattner | b866602 | 2009-09-16 01:46:41 +0000 | [diff] [blame] | 39 | }; |
Anton Korobeynikov | ae4ccc1 | 2010-02-15 22:35:59 +0000 | [diff] [blame] | 40 | |
Paul Robinson | 06a8eb8 | 2015-03-03 21:01:27 +0000 | [diff] [blame^] | 41 | /// \brief This implemenatation is used for X86 ELF targets that don't |
| 42 | /// have a further specialization. |
| 43 | class X86ELFTargetObjectFile : public TargetLoweringObjectFileELF { |
David Blaikie | 1b01ae8 | 2013-07-01 21:45:25 +0000 | [diff] [blame] | 44 | /// \brief Describe a TLS variable address within debug info. |
Craig Topper | 7315602 | 2014-03-02 09:09:27 +0000 | [diff] [blame] | 45 | const MCExpr *getDebugThreadLocalSymbol(const MCSymbol *Sym) const override; |
Rafael Espindola | ca3e0ee | 2012-06-19 00:48:28 +0000 | [diff] [blame] | 46 | }; |
| 47 | |
Paul Robinson | 06a8eb8 | 2015-03-03 21:01:27 +0000 | [diff] [blame^] | 48 | /// X86LinuxTargetObjectFile - This implementation is used for linux x86 |
| 49 | /// and x86-64. |
| 50 | class X86LinuxTargetObjectFile : public X86ELFTargetObjectFile { |
| 51 | void Initialize(MCContext &Ctx, const TargetMachine &TM) override; |
| 52 | }; |
| 53 | |
David Majnemer | dee1057 | 2014-01-15 09:16:42 +0000 | [diff] [blame] | 54 | /// \brief This implementation is used for Windows targets on x86 and x86-64. |
| 55 | class X86WindowsTargetObjectFile : public TargetLoweringObjectFileCOFF { |
Craig Topper | 7315602 | 2014-03-02 09:09:27 +0000 | [diff] [blame] | 56 | const MCExpr * |
| 57 | getExecutableRelativeSymbol(const ConstantExpr *CE, Mangler &Mang, |
| 58 | const TargetMachine &TM) const override; |
David Majnemer | 8bce66b | 2014-07-14 22:57:27 +0000 | [diff] [blame] | 59 | |
| 60 | /// \brief Given a mergeable constant with the specified size and relocation |
| 61 | /// information, return a section that it should be placed in. |
| 62 | const MCSection *getSectionForConstant(SectionKind Kind, |
| 63 | const Constant *C) const override; |
David Majnemer | dee1057 | 2014-01-15 09:16:42 +0000 | [diff] [blame] | 64 | }; |
| 65 | |
Chris Lattner | b866602 | 2009-09-16 01:46:41 +0000 | [diff] [blame] | 66 | } // end namespace llvm |
| 67 | |
| 68 | #endif |