blob: 81207ad630461f615cd02ae5487b6f9ffdd30908 [file] [log] [blame]
Jia Liub22310f2012-02-18 12:03:15 +00001//===-- X86TargetObjectFile.h - X86 Object Info -----------------*- C++ -*-===//
Chris Lattnerb8666022009-09-16 01:46:41 +00002//
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 Kramera7c40ef2014-08-13 16:26:38 +000010#ifndef LLVM_LIB_TARGET_X86_X86TARGETOBJECTFILE_H
11#define LLVM_LIB_TARGET_X86_X86TARGETOBJECTFILE_H
Chris Lattnerb8666022009-09-16 01:46:41 +000012
Anton Korobeynikovab663a02010-02-15 22:37:53 +000013#include "llvm/CodeGen/TargetLoweringObjectFileImpl.h"
Chris Lattnerb8666022009-09-16 01:46:41 +000014#include "llvm/Target/TargetLoweringObjectFile.h"
15
16namespace llvm {
Anton Korobeynikovae4ccc12010-02-15 22:35:59 +000017
Bill Wendling8ed44462012-06-26 10:05:06 +000018 /// X86_64MachoTargetObjectFile - This TLOF implementation is used for Darwin
Bill Wendling03448742010-03-15 19:04:37 +000019 /// x86-64.
Bill Wendling8ed44462012-06-26 10:05:06 +000020 class X86_64MachoTargetObjectFile : public TargetLoweringObjectFileMachO {
Bill Wendling03448742010-03-15 19:04:37 +000021 public:
Rafael Espindoladaeafb42014-02-19 17:23:20 +000022 const MCExpr *
23 getTTypeGlobalReference(const GlobalValue *GV, unsigned Encoding,
24 Mangler &Mang, const TargetMachine &TM,
Craig Topper73156022014-03-02 09:09:27 +000025 MachineModuleInfo *MMI,
26 MCStreamer &Streamer) const override;
Rafael Espindola08704342011-04-27 23:08:15 +000027
28 // getCFIPersonalitySymbol - The symbol that gets passed to
29 // .cfi_personality.
Rafael Espindolafa0f7282014-02-08 14:53:28 +000030 MCSymbol *getCFIPersonalitySymbol(const GlobalValue *GV, Mangler &Mang,
Rafael Espindoladaeafb42014-02-19 17:23:20 +000031 const TargetMachine &TM,
Craig Topper73156022014-03-02 09:09:27 +000032 MachineModuleInfo *MMI) const override;
Bruno Cardoso Lopes24492b02015-02-23 21:26:18 +000033
Bruno Cardoso Lopes618c67a2015-03-06 13:49:05 +000034 const MCExpr *getIndirectSymViaGOTPCRel(const MCSymbol *Sym,
35 const MCValue &MV, int64_t Offset,
36 MachineModuleInfo *MMI,
37 MCStreamer &Streamer) const override;
Chris Lattnerb8666022009-09-16 01:46:41 +000038 };
Anton Korobeynikovae4ccc12010-02-15 22:35:59 +000039
Paul Robinson06a8eb82015-03-03 21:01:27 +000040 /// \brief This implemenatation is used for X86 ELF targets that don't
41 /// have a further specialization.
42 class X86ELFTargetObjectFile : public TargetLoweringObjectFileELF {
David Blaikie1b01ae82013-07-01 21:45:25 +000043 /// \brief Describe a TLS variable address within debug info.
Craig Topper73156022014-03-02 09:09:27 +000044 const MCExpr *getDebugThreadLocalSymbol(const MCSymbol *Sym) const override;
Rafael Espindolaca3e0ee2012-06-19 00:48:28 +000045 };
46
Derek Schuff072f93f2015-03-11 16:16:09 +000047 /// X86LinuxNaClTargetObjectFile - This implementation is used for linux and
48 /// Native Client on x86 and x86-64.
49 class X86LinuxNaClTargetObjectFile : public X86ELFTargetObjectFile {
Paul Robinson06a8eb82015-03-03 21:01:27 +000050 void Initialize(MCContext &Ctx, const TargetMachine &TM) override;
51 };
52
David Majnemerdee10572014-01-15 09:16:42 +000053 /// \brief This implementation is used for Windows targets on x86 and x86-64.
54 class X86WindowsTargetObjectFile : public TargetLoweringObjectFileCOFF {
Craig Topper73156022014-03-02 09:09:27 +000055 const MCExpr *
56 getExecutableRelativeSymbol(const ConstantExpr *CE, Mangler &Mang,
57 const TargetMachine &TM) const override;
David Majnemer8bce66b2014-07-14 22:57:27 +000058
59 /// \brief Given a mergeable constant with the specified size and relocation
60 /// information, return a section that it should be placed in.
Mehdi Amini5c0fa582015-07-16 06:04:17 +000061 MCSection *getSectionForConstant(const DataLayout &DL, SectionKind Kind,
David Majnemera3ea4072016-02-21 01:30:30 +000062 const Constant *C,
63 unsigned &Align) const override;
David Majnemerdee10572014-01-15 09:16:42 +000064 };
65
Chris Lattnerb8666022009-09-16 01:46:41 +000066} // end namespace llvm
67
68#endif