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_TARGET_NVPTX_TARGETOBJECTFILE_H
11 #define LLVM_TARGET_NVPTX_TARGETOBJECTFILE_H
13 #include "NVPTXSection.h"
14 #include "llvm/Target/TargetLoweringObjectFile.h"
21 class NVPTXTargetObjectFile : public TargetLoweringObjectFile {
24 NVPTXTargetObjectFile() {
30 StaticCtorSection = 0;
31 StaticDtorSection = 0;
34 DwarfAbbrevSection = 0;
37 DwarfFrameSection = 0;
38 DwarfPubTypesSection = 0;
39 DwarfDebugInlineSection = 0;
42 DwarfARangesSection = 0;
43 DwarfRangesSection = 0;
44 DwarfMacroInfoSection = 0;
47 ~NVPTXTargetObjectFile() {
51 delete ReadOnlySection;
53 delete StaticCtorSection;
54 delete StaticDtorSection;
56 delete EHFrameSection;
57 delete DwarfAbbrevSection;
58 delete DwarfInfoSection;
59 delete DwarfLineSection;
60 delete DwarfFrameSection;
61 delete DwarfPubTypesSection;
62 delete DwarfDebugInlineSection;
63 delete DwarfStrSection;
64 delete DwarfLocSection;
65 delete DwarfARangesSection;
66 delete DwarfRangesSection;
67 delete DwarfMacroInfoSection;
70 virtual void Initialize(MCContext &ctx, const TargetMachine &TM) {
71 TargetLoweringObjectFile::Initialize(ctx, TM);
72 TextSection = new NVPTXSection(MCSection::SV_ELF, SectionKind::getText());
74 new NVPTXSection(MCSection::SV_ELF, SectionKind::getDataRel());
75 BSSSection = new NVPTXSection(MCSection::SV_ELF, SectionKind::getBSS());
77 new NVPTXSection(MCSection::SV_ELF, SectionKind::getReadOnly());
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());
88 new NVPTXSection(MCSection::SV_ELF, SectionKind::getMetadata());
90 new NVPTXSection(MCSection::SV_ELF, SectionKind::getMetadata());
92 new NVPTXSection(MCSection::SV_ELF, SectionKind::getMetadata());
94 new NVPTXSection(MCSection::SV_ELF, SectionKind::getMetadata());
95 DwarfPubTypesSection =
96 new NVPTXSection(MCSection::SV_ELF, SectionKind::getMetadata());
97 DwarfDebugInlineSection =
98 new NVPTXSection(MCSection::SV_ELF, SectionKind::getMetadata());
100 new NVPTXSection(MCSection::SV_ELF, SectionKind::getMetadata());
102 new NVPTXSection(MCSection::SV_ELF, SectionKind::getMetadata());
103 DwarfARangesSection =
104 new NVPTXSection(MCSection::SV_ELF, SectionKind::getMetadata());
106 new NVPTXSection(MCSection::SV_ELF, SectionKind::getMetadata());
107 DwarfMacroInfoSection =
108 new NVPTXSection(MCSection::SV_ELF, SectionKind::getMetadata());
111 virtual const MCSection *getSectionForConstant(SectionKind Kind) const {
112 return ReadOnlySection;
115 virtual const MCSection *
116 getExplicitSectionGlobal(const GlobalValue *GV, SectionKind Kind,
117 Mangler *Mang, const TargetMachine &TM) const {
123 } // end namespace llvm