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/Target/TargetLoweringObjectFile.h"
20 class NVPTXTargetObjectFile : public TargetLoweringObjectFile {
23 NVPTXTargetObjectFile() {
24 TextSection = nullptr;
25 DataSection = nullptr;
27 ReadOnlySection = nullptr;
29 StaticCtorSection = nullptr;
30 StaticDtorSection = nullptr;
31 LSDASection = nullptr;
32 EHFrameSection = nullptr;
33 DwarfAbbrevSection = nullptr;
34 DwarfInfoSection = nullptr;
35 DwarfLineSection = nullptr;
36 DwarfFrameSection = nullptr;
37 DwarfPubTypesSection = nullptr;
38 DwarfDebugInlineSection = nullptr;
39 DwarfStrSection = nullptr;
40 DwarfLocSection = nullptr;
41 DwarfARangesSection = nullptr;
42 DwarfRangesSection = nullptr;
43 DwarfMacinfoSection = nullptr;
46 virtual ~NVPTXTargetObjectFile();
48 void Initialize(MCContext &ctx, const TargetMachine &TM) override {
49 TargetLoweringObjectFile::Initialize(ctx, TM);
50 TextSection = new NVPTXSection(MCSection::SV_ELF, SectionKind::getText());
51 DataSection = new NVPTXSection(MCSection::SV_ELF, SectionKind::getData());
52 BSSSection = new NVPTXSection(MCSection::SV_ELF, SectionKind::getBSS());
54 new NVPTXSection(MCSection::SV_ELF, SectionKind::getReadOnly());
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());
71 new NVPTXSection(MCSection::SV_ELF, SectionKind::getMetadata());
72 DwarfPubTypesSection =
73 new NVPTXSection(MCSection::SV_ELF, SectionKind::getMetadata());
74 DwarfDebugInlineSection =
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());
85 new NVPTXSection(MCSection::SV_ELF, SectionKind::getMetadata());
88 MCSection *getSectionForConstant(const DataLayout &DL, SectionKind Kind,
90 unsigned &Align) const override {
91 return ReadOnlySection;
94 MCSection *getExplicitSectionGlobal(const GlobalValue *GV, SectionKind Kind,
96 const TargetMachine &TM) const override {
100 MCSection *SelectSectionForGlobal(const GlobalValue *GV, SectionKind Kind,
102 const TargetMachine &TM) const override;
105 } // end namespace llvm