blob: 6a6988a2e2f65a7b5117a1c553f5e420aa8b196d [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;
Chris Lattnerb8666022009-09-16 01:46:41 +000033 };
Anton Korobeynikovae4ccc12010-02-15 22:35:59 +000034
Rafael Espindolaca3e0ee2012-06-19 00:48:28 +000035 /// X86LinuxTargetObjectFile - This implementation is used for linux x86
36 /// and x86-64.
37 class X86LinuxTargetObjectFile : public TargetLoweringObjectFileELF {
Craig Topper73156022014-03-02 09:09:27 +000038 void Initialize(MCContext &Ctx, const TargetMachine &TM) override;
David Blaikie1b01ae82013-07-01 21:45:25 +000039
40 /// \brief Describe a TLS variable address within debug info.
Craig Topper73156022014-03-02 09:09:27 +000041 const MCExpr *getDebugThreadLocalSymbol(const MCSymbol *Sym) const override;
Rafael Espindolaca3e0ee2012-06-19 00:48:28 +000042 };
43
David Majnemerdee10572014-01-15 09:16:42 +000044 /// \brief This implementation is used for Windows targets on x86 and x86-64.
45 class X86WindowsTargetObjectFile : public TargetLoweringObjectFileCOFF {
Craig Topper73156022014-03-02 09:09:27 +000046 const MCExpr *
47 getExecutableRelativeSymbol(const ConstantExpr *CE, Mangler &Mang,
48 const TargetMachine &TM) const override;
David Majnemer8bce66b2014-07-14 22:57:27 +000049
50 /// \brief Given a mergeable constant with the specified size and relocation
51 /// information, return a section that it should be placed in.
52 const MCSection *getSectionForConstant(SectionKind Kind,
53 const Constant *C) const override;
David Majnemerdee10572014-01-15 09:16:42 +000054 };
55
Chris Lattnerb8666022009-09-16 01:46:41 +000056} // end namespace llvm
57
58#endif