blob: a92c122838e312a1131d533142455024d87da6e1 [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:
Bruno Cardoso Lopes24492b02015-02-23 21:26:18 +000022 X86_64MachoTargetObjectFile();
23
Rafael Espindoladaeafb42014-02-19 17:23:20 +000024 const MCExpr *
25 getTTypeGlobalReference(const GlobalValue *GV, unsigned Encoding,
26 Mangler &Mang, const TargetMachine &TM,
Craig Topper73156022014-03-02 09:09:27 +000027 MachineModuleInfo *MMI,
28 MCStreamer &Streamer) const override;
Rafael Espindola08704342011-04-27 23:08:15 +000029
30 // getCFIPersonalitySymbol - The symbol that gets passed to
31 // .cfi_personality.
Rafael Espindolafa0f7282014-02-08 14:53:28 +000032 MCSymbol *getCFIPersonalitySymbol(const GlobalValue *GV, Mangler &Mang,
Rafael Espindoladaeafb42014-02-19 17:23:20 +000033 const TargetMachine &TM,
Craig Topper73156022014-03-02 09:09:27 +000034 MachineModuleInfo *MMI) const override;
Bruno Cardoso Lopes24492b02015-02-23 21:26:18 +000035
36 const MCExpr *
37 getIndirectSymViaGOTPCRel(const MCSymbol *Sym,
38 int64_t Offset) const override;
Chris Lattnerb8666022009-09-16 01:46:41 +000039 };
Anton Korobeynikovae4ccc12010-02-15 22:35:59 +000040
Paul Robinson06a8eb82015-03-03 21:01:27 +000041 /// \brief This implemenatation is used for X86 ELF targets that don't
42 /// have a further specialization.
43 class X86ELFTargetObjectFile : public TargetLoweringObjectFileELF {
David Blaikie1b01ae82013-07-01 21:45:25 +000044 /// \brief Describe a TLS variable address within debug info.
Craig Topper73156022014-03-02 09:09:27 +000045 const MCExpr *getDebugThreadLocalSymbol(const MCSymbol *Sym) const override;
Rafael Espindolaca3e0ee2012-06-19 00:48:28 +000046 };
47
Paul Robinson06a8eb82015-03-03 21:01:27 +000048 /// 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 Majnemerdee10572014-01-15 09:16:42 +000054 /// \brief This implementation is used for Windows targets on x86 and x86-64.
55 class X86WindowsTargetObjectFile : public TargetLoweringObjectFileCOFF {
Craig Topper73156022014-03-02 09:09:27 +000056 const MCExpr *
57 getExecutableRelativeSymbol(const ConstantExpr *CE, Mangler &Mang,
58 const TargetMachine &TM) const override;
David Majnemer8bce66b2014-07-14 22:57:27 +000059
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 Majnemerdee10572014-01-15 09:16:42 +000064 };
65
Chris Lattnerb8666022009-09-16 01:46:41 +000066} // end namespace llvm
67
68#endif