1 //===-- NVPTXTargetObjectFile.h - NVPTX Object Info -------------*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 #ifndef LLVM_LIB_TARGET_NVPTX_NVPTXTARGETOBJECTFILE_H
11 #define LLVM_LIB_TARGET_NVPTX_NVPTXTARGETOBJECTFILE_H
13 #include "NVPTXSection.h"
14 #include "llvm/MC/MCSection.h"
15 #include "llvm/MC/SectionKind.h"
16 #include "llvm/Target/TargetLoweringObjectFile.h"
20 class NVPTXTargetObjectFile : public TargetLoweringObjectFile {
22 NVPTXTargetObjectFile() {
23 TextSection = nullptr;
24 DataSection = nullptr;
26 ReadOnlySection = nullptr;
28 StaticCtorSection = nullptr;
29 StaticDtorSection = nullptr;
30 LSDASection = nullptr;
31 EHFrameSection = nullptr;
32 DwarfAbbrevSection = nullptr;
33 DwarfInfoSection = nullptr;
34 DwarfLineSection = nullptr;
35 DwarfFrameSection = nullptr;
36 DwarfPubTypesSection = nullptr;
37 DwarfDebugInlineSection = nullptr;
38 DwarfStrSection = nullptr;
39 DwarfLocSection = nullptr;
40 DwarfARangesSection = nullptr;
41 DwarfRangesSection = nullptr;
42 DwarfMacinfoSection = nullptr;
45 ~NVPTXTargetObjectFile() override;
47 void Initialize(MCContext &ctx, const TargetMachine &TM) override {
48 TargetLoweringObjectFile::Initialize(ctx, TM);
49 TextSection = new NVPTXSection(MCSection::SV_ELF, SectionKind::getText());
50 DataSection = new NVPTXSection(MCSection::SV_ELF, SectionKind::getData());
51 BSSSection = new NVPTXSection(MCSection::SV_ELF, SectionKind::getBSS());
53 new NVPTXSection(MCSection::SV_ELF, SectionKind::getReadOnly());
55 new NVPTXSection(MCSection::SV_ELF, SectionKind::getMetadata());
57 new NVPTXSection(MCSection::SV_ELF, SectionKind::getMetadata());
59 new NVPTXSection(MCSection::SV_ELF, SectionKind::getMetadata());
61 new NVPTXSection(MCSection::SV_ELF, SectionKind::getMetadata());
63 new NVPTXSection(MCSection::SV_ELF, SectionKind::getMetadata());
65 new NVPTXSection(MCSection::SV_ELF, SectionKind::getMetadata());
67 new NVPTXSection(MCSection::SV_ELF, SectionKind::getMetadata());
69 new NVPTXSection(MCSection::SV_ELF, SectionKind::getMetadata());
70 DwarfPubTypesSection =
71 new NVPTXSection(MCSection::SV_ELF, SectionKind::getMetadata());
72 DwarfDebugInlineSection =
73 new NVPTXSection(MCSection::SV_ELF, SectionKind::getMetadata());
75 new NVPTXSection(MCSection::SV_ELF, SectionKind::getMetadata());
77 new NVPTXSection(MCSection::SV_ELF, SectionKind::getMetadata());
79 new NVPTXSection(MCSection::SV_ELF, SectionKind::getMetadata());
81 new NVPTXSection(MCSection::SV_ELF, SectionKind::getMetadata());
83 new NVPTXSection(MCSection::SV_ELF, SectionKind::getMetadata());
86 MCSection *getSectionForConstant(const DataLayout &DL, SectionKind Kind,
88 unsigned &Align) const override {
89 return ReadOnlySection;
92 MCSection *getExplicitSectionGlobal(const GlobalObject *GO, SectionKind Kind,
93 const TargetMachine &TM) const override {
97 MCSection *SelectSectionForGlobal(const GlobalObject *GO, SectionKind Kind,
98 const TargetMachine &TM) const override;
101 } // end namespace llvm
103 #endif // LLVM_LIB_TARGET_NVPTX_NVPTXTARGETOBJECTFILE_H