X86TargetObjectFile.h revision ebe69fe11e48d322045d5949c83283927a0d790b
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 16namespace 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 implementation is used for Windows targets on x86 and x86-64. 51 class X86WindowsTargetObjectFile : public TargetLoweringObjectFileCOFF { 52 const MCExpr * 53 getExecutableRelativeSymbol(const ConstantExpr *CE, Mangler &Mang, 54 const TargetMachine &TM) const override; 55 56 /// \brief Given a mergeable constant with the specified size and relocation 57 /// information, return a section that it should be placed in. 58 const MCSection *getSectionForConstant(SectionKind Kind, 59 const Constant *C) const override; 60 }; 61 62} // end namespace llvm 63 64#endif 65