1cecf0b4819abf53ddbd0fca59d94d6cf32489f6
[oota-llvm.git] / lib / Target / X86 / X86TargetObjectFile.h
1 //===-- X86TargetObjectFile.h - X86 Object Info -----------------*- C++ -*-===//
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
10 #ifndef LLVM_LIB_TARGET_X86_X86TARGETOBJECTFILE_H
11 #define LLVM_LIB_TARGET_X86_X86TARGETOBJECTFILE_H
12
13 #include "llvm/CodeGen/TargetLoweringObjectFileImpl.h"
14 #include "llvm/Target/TargetLoweringObjectFile.h"
15
16 namespace llvm {
17
18   /// X86_64MachoTargetObjectFile - This TLOF implementation is used for Darwin
19   /// x86-64.
20   class X86_64MachoTargetObjectFile : public TargetLoweringObjectFileMachO {
21   public:
22     X86_64MachoTargetObjectFile();
23
24     const MCExpr *
25     getTTypeGlobalReference(const GlobalValue *GV, unsigned Encoding,
26                             Mangler &Mang, const TargetMachine &TM,
27                             MachineModuleInfo *MMI,
28                             MCStreamer &Streamer) const override;
29
30     // getCFIPersonalitySymbol - The symbol that gets passed to
31     // .cfi_personality.
32     MCSymbol *getCFIPersonalitySymbol(const GlobalValue *GV, Mangler &Mang,
33                                       const TargetMachine &TM,
34                                       MachineModuleInfo *MMI) const override;
35
36     const MCExpr *
37       getIndirectSymViaGOTPCRel(const MCSymbol *Sym,
38                                 int64_t Offset) const override;
39   };
40
41   /// X86LinuxTargetObjectFile - This implementation is used for linux x86
42   /// and x86-64.
43   class X86LinuxTargetObjectFile : public TargetLoweringObjectFileELF {
44     void Initialize(MCContext &Ctx, const TargetMachine &TM) override;
45
46     /// \brief Describe a TLS variable address within debug info.
47     const MCExpr *getDebugThreadLocalSymbol(const MCSymbol *Sym) const override;
48   };
49
50   /// \brief This TLOF implementation is used for PS4.
51   class PS4TargetObjectFile : public TargetLoweringObjectFileELF {
52     /// \brief Describe a TLS variable address within debug info.
53     const MCExpr *getDebugThreadLocalSymbol(const MCSymbol *Sym) const override;
54   };
55
56   /// \brief This implementation is used for Windows targets on x86 and x86-64.
57   class X86WindowsTargetObjectFile : public TargetLoweringObjectFileCOFF {
58     const MCExpr *
59     getExecutableRelativeSymbol(const ConstantExpr *CE, Mangler &Mang,
60                                 const TargetMachine &TM) const override;
61
62     /// \brief Given a mergeable constant with the specified size and relocation
63     /// information, return a section that it should be placed in.
64     const MCSection *getSectionForConstant(SectionKind Kind,
65                                            const Constant *C) const override;
66   };
67
68 } // end namespace llvm
69
70 #endif