xref: /freebsd/contrib/llvm-project/llvm/lib/Target/AArch64/AArch64TargetObjectFile.h (revision 5ffd83dbcc34f10e07f6d3e968ae6365869615f4)
10b57cec5SDimitry Andric //===-- AArch64TargetObjectFile.h - AArch64 Object Info -*- C++ ---------*-===//
20b57cec5SDimitry Andric //
30b57cec5SDimitry Andric // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
40b57cec5SDimitry Andric // See https://llvm.org/LICENSE.txt for license information.
50b57cec5SDimitry Andric // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
60b57cec5SDimitry Andric //
70b57cec5SDimitry Andric //===----------------------------------------------------------------------===//
80b57cec5SDimitry Andric 
90b57cec5SDimitry Andric #ifndef LLVM_LIB_TARGET_AARCH64_AARCH64TARGETOBJECTFILE_H
100b57cec5SDimitry Andric #define LLVM_LIB_TARGET_AARCH64_AARCH64TARGETOBJECTFILE_H
110b57cec5SDimitry Andric 
120b57cec5SDimitry Andric #include "llvm/CodeGen/TargetLoweringObjectFileImpl.h"
130b57cec5SDimitry Andric #include "llvm/Target/TargetLoweringObjectFile.h"
140b57cec5SDimitry Andric 
150b57cec5SDimitry Andric namespace llvm {
160b57cec5SDimitry Andric class AArch64TargetMachine;
170b57cec5SDimitry Andric 
180b57cec5SDimitry Andric /// This implementation is used for AArch64 ELF targets (Linux in particular).
190b57cec5SDimitry Andric class AArch64_ELFTargetObjectFile : public TargetLoweringObjectFileELF {
200b57cec5SDimitry Andric   void Initialize(MCContext &Ctx, const TargetMachine &TM) override;
21*5ffd83dbSDimitry Andric 
22*5ffd83dbSDimitry Andric public:
23*5ffd83dbSDimitry Andric   AArch64_ELFTargetObjectFile() {
24*5ffd83dbSDimitry Andric     PLTRelativeVariantKind = MCSymbolRefExpr::VK_PLT;
25*5ffd83dbSDimitry Andric   }
260b57cec5SDimitry Andric };
270b57cec5SDimitry Andric 
280b57cec5SDimitry Andric /// AArch64_MachoTargetObjectFile - This TLOF implementation is used for Darwin.
290b57cec5SDimitry Andric class AArch64_MachoTargetObjectFile : public TargetLoweringObjectFileMachO {
300b57cec5SDimitry Andric public:
310b57cec5SDimitry Andric   AArch64_MachoTargetObjectFile();
320b57cec5SDimitry Andric 
330b57cec5SDimitry Andric   const MCExpr *getTTypeGlobalReference(const GlobalValue *GV,
340b57cec5SDimitry Andric                                         unsigned Encoding,
350b57cec5SDimitry Andric                                         const TargetMachine &TM,
360b57cec5SDimitry Andric                                         MachineModuleInfo *MMI,
370b57cec5SDimitry Andric                                         MCStreamer &Streamer) const override;
380b57cec5SDimitry Andric 
390b57cec5SDimitry Andric   MCSymbol *getCFIPersonalitySymbol(const GlobalValue *GV,
400b57cec5SDimitry Andric                                     const TargetMachine &TM,
410b57cec5SDimitry Andric                                     MachineModuleInfo *MMI) const override;
420b57cec5SDimitry Andric 
438bcb0991SDimitry Andric   const MCExpr *getIndirectSymViaGOTPCRel(const GlobalValue *GV,
448bcb0991SDimitry Andric                                           const MCSymbol *Sym,
450b57cec5SDimitry Andric                                           const MCValue &MV, int64_t Offset,
460b57cec5SDimitry Andric                                           MachineModuleInfo *MMI,
470b57cec5SDimitry Andric                                           MCStreamer &Streamer) const override;
480b57cec5SDimitry Andric 
490b57cec5SDimitry Andric   void getNameWithPrefix(SmallVectorImpl<char> &OutName, const GlobalValue *GV,
500b57cec5SDimitry Andric                          const TargetMachine &TM) const override;
510b57cec5SDimitry Andric };
520b57cec5SDimitry Andric 
530b57cec5SDimitry Andric /// This implementation is used for AArch64 COFF targets.
540b57cec5SDimitry Andric class AArch64_COFFTargetObjectFile : public TargetLoweringObjectFileCOFF {};
550b57cec5SDimitry Andric 
560b57cec5SDimitry Andric } // end namespace llvm
570b57cec5SDimitry Andric 
580b57cec5SDimitry Andric #endif
59