xref: /freebsd/contrib/llvm-project/llvm/lib/Target/AArch64/AArch64TargetObjectFile.h (revision 7a6dacaca14b62ca4b74406814becb87a3fefac0)
1 //===-- AArch64TargetObjectFile.h - AArch64 Object Info -*- C++ ---------*-===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 
9 #ifndef LLVM_LIB_TARGET_AARCH64_AARCH64TARGETOBJECTFILE_H
10 #define LLVM_LIB_TARGET_AARCH64_AARCH64TARGETOBJECTFILE_H
11 
12 #include "llvm/CodeGen/TargetLoweringObjectFileImpl.h"
13 #include "llvm/Target/TargetLoweringObjectFile.h"
14 
15 namespace llvm {
16 
17 /// This implementation is used for AArch64 ELF targets (Linux in particular).
18 class AArch64_ELFTargetObjectFile : public TargetLoweringObjectFileELF {
19   void Initialize(MCContext &Ctx, const TargetMachine &TM) override;
20 
21 public:
22   AArch64_ELFTargetObjectFile() {
23     PLTRelativeVariantKind = MCSymbolRefExpr::VK_PLT;
24     SupportIndirectSymViaGOTPCRel = true;
25   }
26 
27   const MCExpr *getIndirectSymViaGOTPCRel(const GlobalValue *GV,
28                                           const MCSymbol *Sym,
29                                           const MCValue &MV, int64_t Offset,
30                                           MachineModuleInfo *MMI,
31                                           MCStreamer &Streamer) const override;
32 };
33 
34 /// AArch64_MachoTargetObjectFile - This TLOF implementation is used for Darwin.
35 class AArch64_MachoTargetObjectFile : public TargetLoweringObjectFileMachO {
36 public:
37   AArch64_MachoTargetObjectFile();
38 
39   const MCExpr *getTTypeGlobalReference(const GlobalValue *GV,
40                                         unsigned Encoding,
41                                         const TargetMachine &TM,
42                                         MachineModuleInfo *MMI,
43                                         MCStreamer &Streamer) const override;
44 
45   MCSymbol *getCFIPersonalitySymbol(const GlobalValue *GV,
46                                     const TargetMachine &TM,
47                                     MachineModuleInfo *MMI) const override;
48 
49   const MCExpr *getIndirectSymViaGOTPCRel(const GlobalValue *GV,
50                                           const MCSymbol *Sym,
51                                           const MCValue &MV, int64_t Offset,
52                                           MachineModuleInfo *MMI,
53                                           MCStreamer &Streamer) const override;
54 
55   void getNameWithPrefix(SmallVectorImpl<char> &OutName, const GlobalValue *GV,
56                          const TargetMachine &TM) const override;
57 };
58 
59 /// This implementation is used for AArch64 COFF targets.
60 class AArch64_COFFTargetObjectFile : public TargetLoweringObjectFileCOFF {};
61 
62 } // end namespace llvm
63 
64 #endif
65