xref: /aosp_15_r20/external/llvm/lib/Target/NVPTX/NVPTXTargetObjectFile.h (revision 9880d6810fe72a1726cb53787c6711e909410d58)
1*9880d681SAndroid Build Coastguard Worker //===-- NVPTXTargetObjectFile.h - NVPTX Object Info -------------*- C++ -*-===//
2*9880d681SAndroid Build Coastguard Worker //
3*9880d681SAndroid Build Coastguard Worker //                     The LLVM Compiler Infrastructure
4*9880d681SAndroid Build Coastguard Worker //
5*9880d681SAndroid Build Coastguard Worker // This file is distributed under the University of Illinois Open Source
6*9880d681SAndroid Build Coastguard Worker // License. See LICENSE.TXT for details.
7*9880d681SAndroid Build Coastguard Worker //
8*9880d681SAndroid Build Coastguard Worker //===----------------------------------------------------------------------===//
9*9880d681SAndroid Build Coastguard Worker 
10*9880d681SAndroid Build Coastguard Worker #ifndef LLVM_LIB_TARGET_NVPTX_NVPTXTARGETOBJECTFILE_H
11*9880d681SAndroid Build Coastguard Worker #define LLVM_LIB_TARGET_NVPTX_NVPTXTARGETOBJECTFILE_H
12*9880d681SAndroid Build Coastguard Worker 
13*9880d681SAndroid Build Coastguard Worker #include "NVPTXSection.h"
14*9880d681SAndroid Build Coastguard Worker #include "llvm/Target/TargetLoweringObjectFile.h"
15*9880d681SAndroid Build Coastguard Worker 
16*9880d681SAndroid Build Coastguard Worker namespace llvm {
17*9880d681SAndroid Build Coastguard Worker class GlobalVariable;
18*9880d681SAndroid Build Coastguard Worker class Module;
19*9880d681SAndroid Build Coastguard Worker 
20*9880d681SAndroid Build Coastguard Worker class NVPTXTargetObjectFile : public TargetLoweringObjectFile {
21*9880d681SAndroid Build Coastguard Worker 
22*9880d681SAndroid Build Coastguard Worker public:
NVPTXTargetObjectFile()23*9880d681SAndroid Build Coastguard Worker   NVPTXTargetObjectFile() {
24*9880d681SAndroid Build Coastguard Worker     TextSection = nullptr;
25*9880d681SAndroid Build Coastguard Worker     DataSection = nullptr;
26*9880d681SAndroid Build Coastguard Worker     BSSSection = nullptr;
27*9880d681SAndroid Build Coastguard Worker     ReadOnlySection = nullptr;
28*9880d681SAndroid Build Coastguard Worker 
29*9880d681SAndroid Build Coastguard Worker     StaticCtorSection = nullptr;
30*9880d681SAndroid Build Coastguard Worker     StaticDtorSection = nullptr;
31*9880d681SAndroid Build Coastguard Worker     LSDASection = nullptr;
32*9880d681SAndroid Build Coastguard Worker     EHFrameSection = nullptr;
33*9880d681SAndroid Build Coastguard Worker     DwarfAbbrevSection = nullptr;
34*9880d681SAndroid Build Coastguard Worker     DwarfInfoSection = nullptr;
35*9880d681SAndroid Build Coastguard Worker     DwarfLineSection = nullptr;
36*9880d681SAndroid Build Coastguard Worker     DwarfFrameSection = nullptr;
37*9880d681SAndroid Build Coastguard Worker     DwarfPubTypesSection = nullptr;
38*9880d681SAndroid Build Coastguard Worker     DwarfDebugInlineSection = nullptr;
39*9880d681SAndroid Build Coastguard Worker     DwarfStrSection = nullptr;
40*9880d681SAndroid Build Coastguard Worker     DwarfLocSection = nullptr;
41*9880d681SAndroid Build Coastguard Worker     DwarfARangesSection = nullptr;
42*9880d681SAndroid Build Coastguard Worker     DwarfRangesSection = nullptr;
43*9880d681SAndroid Build Coastguard Worker     DwarfMacinfoSection = nullptr;
44*9880d681SAndroid Build Coastguard Worker   }
45*9880d681SAndroid Build Coastguard Worker 
46*9880d681SAndroid Build Coastguard Worker   virtual ~NVPTXTargetObjectFile();
47*9880d681SAndroid Build Coastguard Worker 
Initialize(MCContext & ctx,const TargetMachine & TM)48*9880d681SAndroid Build Coastguard Worker   void Initialize(MCContext &ctx, const TargetMachine &TM) override {
49*9880d681SAndroid Build Coastguard Worker     TargetLoweringObjectFile::Initialize(ctx, TM);
50*9880d681SAndroid Build Coastguard Worker     TextSection = new NVPTXSection(MCSection::SV_ELF, SectionKind::getText());
51*9880d681SAndroid Build Coastguard Worker     DataSection = new NVPTXSection(MCSection::SV_ELF, SectionKind::getData());
52*9880d681SAndroid Build Coastguard Worker     BSSSection = new NVPTXSection(MCSection::SV_ELF, SectionKind::getBSS());
53*9880d681SAndroid Build Coastguard Worker     ReadOnlySection =
54*9880d681SAndroid Build Coastguard Worker         new NVPTXSection(MCSection::SV_ELF, SectionKind::getReadOnly());
55*9880d681SAndroid Build Coastguard Worker 
56*9880d681SAndroid Build Coastguard Worker     StaticCtorSection =
57*9880d681SAndroid Build Coastguard Worker         new NVPTXSection(MCSection::SV_ELF, SectionKind::getMetadata());
58*9880d681SAndroid Build Coastguard Worker     StaticDtorSection =
59*9880d681SAndroid Build Coastguard Worker         new NVPTXSection(MCSection::SV_ELF, SectionKind::getMetadata());
60*9880d681SAndroid Build Coastguard Worker     LSDASection =
61*9880d681SAndroid Build Coastguard Worker         new NVPTXSection(MCSection::SV_ELF, SectionKind::getMetadata());
62*9880d681SAndroid Build Coastguard Worker     EHFrameSection =
63*9880d681SAndroid Build Coastguard Worker         new NVPTXSection(MCSection::SV_ELF, SectionKind::getMetadata());
64*9880d681SAndroid Build Coastguard Worker     DwarfAbbrevSection =
65*9880d681SAndroid Build Coastguard Worker         new NVPTXSection(MCSection::SV_ELF, SectionKind::getMetadata());
66*9880d681SAndroid Build Coastguard Worker     DwarfInfoSection =
67*9880d681SAndroid Build Coastguard Worker         new NVPTXSection(MCSection::SV_ELF, SectionKind::getMetadata());
68*9880d681SAndroid Build Coastguard Worker     DwarfLineSection =
69*9880d681SAndroid Build Coastguard Worker         new NVPTXSection(MCSection::SV_ELF, SectionKind::getMetadata());
70*9880d681SAndroid Build Coastguard Worker     DwarfFrameSection =
71*9880d681SAndroid Build Coastguard Worker         new NVPTXSection(MCSection::SV_ELF, SectionKind::getMetadata());
72*9880d681SAndroid Build Coastguard Worker     DwarfPubTypesSection =
73*9880d681SAndroid Build Coastguard Worker         new NVPTXSection(MCSection::SV_ELF, SectionKind::getMetadata());
74*9880d681SAndroid Build Coastguard Worker     DwarfDebugInlineSection =
75*9880d681SAndroid Build Coastguard Worker         new NVPTXSection(MCSection::SV_ELF, SectionKind::getMetadata());
76*9880d681SAndroid Build Coastguard Worker     DwarfStrSection =
77*9880d681SAndroid Build Coastguard Worker         new NVPTXSection(MCSection::SV_ELF, SectionKind::getMetadata());
78*9880d681SAndroid Build Coastguard Worker     DwarfLocSection =
79*9880d681SAndroid Build Coastguard Worker         new NVPTXSection(MCSection::SV_ELF, SectionKind::getMetadata());
80*9880d681SAndroid Build Coastguard Worker     DwarfARangesSection =
81*9880d681SAndroid Build Coastguard Worker         new NVPTXSection(MCSection::SV_ELF, SectionKind::getMetadata());
82*9880d681SAndroid Build Coastguard Worker     DwarfRangesSection =
83*9880d681SAndroid Build Coastguard Worker         new NVPTXSection(MCSection::SV_ELF, SectionKind::getMetadata());
84*9880d681SAndroid Build Coastguard Worker     DwarfMacinfoSection =
85*9880d681SAndroid Build Coastguard Worker         new NVPTXSection(MCSection::SV_ELF, SectionKind::getMetadata());
86*9880d681SAndroid Build Coastguard Worker   }
87*9880d681SAndroid Build Coastguard Worker 
getSectionForConstant(const DataLayout & DL,SectionKind Kind,const Constant * C,unsigned & Align)88*9880d681SAndroid Build Coastguard Worker   MCSection *getSectionForConstant(const DataLayout &DL, SectionKind Kind,
89*9880d681SAndroid Build Coastguard Worker                                    const Constant *C,
90*9880d681SAndroid Build Coastguard Worker                                    unsigned &Align) const override {
91*9880d681SAndroid Build Coastguard Worker     return ReadOnlySection;
92*9880d681SAndroid Build Coastguard Worker   }
93*9880d681SAndroid Build Coastguard Worker 
getExplicitSectionGlobal(const GlobalValue * GV,SectionKind Kind,Mangler & Mang,const TargetMachine & TM)94*9880d681SAndroid Build Coastguard Worker   MCSection *getExplicitSectionGlobal(const GlobalValue *GV, SectionKind Kind,
95*9880d681SAndroid Build Coastguard Worker                                       Mangler &Mang,
96*9880d681SAndroid Build Coastguard Worker                                       const TargetMachine &TM) const override {
97*9880d681SAndroid Build Coastguard Worker     return DataSection;
98*9880d681SAndroid Build Coastguard Worker   }
99*9880d681SAndroid Build Coastguard Worker 
100*9880d681SAndroid Build Coastguard Worker   MCSection *SelectSectionForGlobal(const GlobalValue *GV, SectionKind Kind,
101*9880d681SAndroid Build Coastguard Worker                                     Mangler &Mang,
102*9880d681SAndroid Build Coastguard Worker                                     const TargetMachine &TM) const override;
103*9880d681SAndroid Build Coastguard Worker };
104*9880d681SAndroid Build Coastguard Worker 
105*9880d681SAndroid Build Coastguard Worker } // end namespace llvm
106*9880d681SAndroid Build Coastguard Worker 
107*9880d681SAndroid Build Coastguard Worker #endif
108