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"
21 class NVPTXTargetObjectFile : public TargetLoweringObjectFile {
24 NVPTXTargetObjectFile() {
25 TextSection = nullptr;
26 DataSection = nullptr;
28 ReadOnlySection = nullptr;
30 StaticCtorSection = nullptr;
31 StaticDtorSection = nullptr;
32 LSDASection = nullptr;
33 EHFrameSection = nullptr;
34 DwarfAbbrevSection = nullptr;
35 DwarfInfoSection = nullptr;
36 DwarfLineSection = nullptr;
37 DwarfFrameSection = nullptr;
38 DwarfPubTypesSection = nullptr;
39 DwarfDebugInlineSection = nullptr;
40 DwarfStrSection = nullptr;
41 DwarfLocSection = nullptr;
42 DwarfARangesSection = nullptr;
43 DwarfRangesSection = nullptr;
44 DwarfMacinfoSection = nullptr;
47 virtual ~NVPTXTargetObjectFile();
49 void Initialize(MCContext &ctx, const TargetMachine &TM) override {
50 TargetLoweringObjectFile::Initialize(ctx, TM);
51 TextSection = new NVPTXSection(MCSection::SV_ELF, SectionKind::getText());
52 DataSection = new NVPTXSection(MCSection::SV_ELF, SectionKind::getData());
53 BSSSection = new NVPTXSection(MCSection::SV_ELF, SectionKind::getBSS());
55 new NVPTXSection(MCSection::SV_ELF, SectionKind::getReadOnly());
58 new NVPTXSection(MCSection::SV_ELF, SectionKind::getMetadata());
60 new NVPTXSection(MCSection::SV_ELF, SectionKind::getMetadata());
62 new NVPTXSection(MCSection::SV_ELF, SectionKind::getMetadata());
64 new NVPTXSection(MCSection::SV_ELF, SectionKind::getMetadata());
66 new NVPTXSection(MCSection::SV_ELF, SectionKind::getMetadata());
68 new NVPTXSection(MCSection::SV_ELF, SectionKind::getMetadata());
70 new NVPTXSection(MCSection::SV_ELF, SectionKind::getMetadata());
72 new NVPTXSection(MCSection::SV_ELF, SectionKind::getMetadata());
73 DwarfPubTypesSection =
74 new NVPTXSection(MCSection::SV_ELF, SectionKind::getMetadata());
75 DwarfDebugInlineSection =
76 new NVPTXSection(MCSection::SV_ELF, SectionKind::getMetadata());
78 new NVPTXSection(MCSection::SV_ELF, SectionKind::getMetadata());
80 new NVPTXSection(MCSection::SV_ELF, SectionKind::getMetadata());
82 new NVPTXSection(MCSection::SV_ELF, SectionKind::getMetadata());
84 new NVPTXSection(MCSection::SV_ELF, SectionKind::getMetadata());
86 new NVPTXSection(MCSection::SV_ELF, SectionKind::getMetadata());
89 MCSection *getSectionForConstant(const DataLayout &DL, SectionKind Kind,
90 const Constant *C) 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