]> git.proxmox.com Git - rustc.git/blame - src/llvm/lib/Target/NVPTX/NVPTXTargetObjectFile.h
Imported Upstream version 1.0.0+dfsg1
[rustc.git] / src / llvm / lib / Target / NVPTX / NVPTXTargetObjectFile.h
CommitLineData
223e47cc
LB
1//===-- NVPTXTargetObjectFile.h - NVPTX Object Info -------------*- C++ -*-===//
2//
3// The LLVM Compiler Infrastructure
4//
5// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
7//
8//===----------------------------------------------------------------------===//
9
1a4d82fc
JJ
10#ifndef LLVM_LIB_TARGET_NVPTX_NVPTXTARGETOBJECTFILE_H
11#define LLVM_LIB_TARGET_NVPTX_NVPTXTARGETOBJECTFILE_H
223e47cc
LB
12
13#include "NVPTXSection.h"
14#include "llvm/Target/TargetLoweringObjectFile.h"
15#include <string>
16
17namespace llvm {
18class GlobalVariable;
19class Module;
20
21class NVPTXTargetObjectFile : public TargetLoweringObjectFile {
22
23public:
1a4d82fc
JJ
24 NVPTXTargetObjectFile() {
25 TextSection = nullptr;
26 DataSection = nullptr;
27 BSSSection = nullptr;
28 ReadOnlySection = nullptr;
223e47cc 29
1a4d82fc
JJ
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 DwarfMacroInfoSection = nullptr;
223e47cc
LB
45 }
46
1a4d82fc 47 virtual ~NVPTXTargetObjectFile();
223e47cc 48
1a4d82fc
JJ
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 =
53 new NVPTXSection(MCSection::SV_ELF, SectionKind::getDataRel());
54 BSSSection = new NVPTXSection(MCSection::SV_ELF, SectionKind::getBSS());
55 ReadOnlySection =
56 new NVPTXSection(MCSection::SV_ELF, SectionKind::getReadOnly());
57
58 StaticCtorSection =
59 new NVPTXSection(MCSection::SV_ELF, SectionKind::getMetadata());
60 StaticDtorSection =
61 new NVPTXSection(MCSection::SV_ELF, SectionKind::getMetadata());
62 LSDASection =
63 new NVPTXSection(MCSection::SV_ELF, SectionKind::getMetadata());
64 EHFrameSection =
65 new NVPTXSection(MCSection::SV_ELF, SectionKind::getMetadata());
66 DwarfAbbrevSection =
67 new NVPTXSection(MCSection::SV_ELF, SectionKind::getMetadata());
68 DwarfInfoSection =
69 new NVPTXSection(MCSection::SV_ELF, SectionKind::getMetadata());
70 DwarfLineSection =
71 new NVPTXSection(MCSection::SV_ELF, SectionKind::getMetadata());
72 DwarfFrameSection =
73 new NVPTXSection(MCSection::SV_ELF, SectionKind::getMetadata());
74 DwarfPubTypesSection =
75 new NVPTXSection(MCSection::SV_ELF, SectionKind::getMetadata());
76 DwarfDebugInlineSection =
77 new NVPTXSection(MCSection::SV_ELF, SectionKind::getMetadata());
78 DwarfStrSection =
79 new NVPTXSection(MCSection::SV_ELF, SectionKind::getMetadata());
80 DwarfLocSection =
81 new NVPTXSection(MCSection::SV_ELF, SectionKind::getMetadata());
82 DwarfARangesSection =
83 new NVPTXSection(MCSection::SV_ELF, SectionKind::getMetadata());
84 DwarfRangesSection =
85 new NVPTXSection(MCSection::SV_ELF, SectionKind::getMetadata());
86 DwarfMacroInfoSection =
87 new NVPTXSection(MCSection::SV_ELF, SectionKind::getMetadata());
223e47cc
LB
88 }
89
1a4d82fc
JJ
90 const MCSection *getSectionForConstant(SectionKind Kind,
91 const Constant *C) const override {
223e47cc
LB
92 return ReadOnlySection;
93 }
94
1a4d82fc
JJ
95 const MCSection *getExplicitSectionGlobal(const GlobalValue *GV,
96 SectionKind Kind, Mangler &Mang,
97 const TargetMachine &TM) const override {
223e47cc
LB
98 return DataSection;
99 }
100
85aaf69f
SL
101 const MCSection *
102 SelectSectionForGlobal(const GlobalValue *GV, SectionKind Kind, Mangler &Mang,
103 const TargetMachine &TM) const override;
223e47cc
LB
104};
105
106} // end namespace llvm
107
108#endif