blob: 2a7394b79ae610d85cd1ba492211120db68282d8 [file] [log] [blame]
Justin Holewinskiae556d32012-05-04 20:18:50 +00001//===-- 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
10#ifndef LLVM_TARGET_NVPTX_TARGETOBJECTFILE_H
11#define LLVM_TARGET_NVPTX_TARGETOBJECTFILE_H
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:
NAKAMURA Takumif7f58942013-06-24 13:19:41 +000024 NVPTXTargetObjectFile() {
25 TextSection = 0;
26 DataSection = 0;
27 BSSSection = 0;
28 ReadOnlySection = 0;
29
30 StaticCtorSection = 0;
31 StaticDtorSection = 0;
32 LSDASection = 0;
33 EHFrameSection = 0;
34 DwarfAbbrevSection = 0;
35 DwarfInfoSection = 0;
36 DwarfLineSection = 0;
37 DwarfFrameSection = 0;
38 DwarfPubTypesSection = 0;
39 DwarfDebugInlineSection = 0;
40 DwarfStrSection = 0;
41 DwarfLocSection = 0;
42 DwarfARangesSection = 0;
43 DwarfRangesSection = 0;
44 DwarfMacroInfoSection = 0;
45 }
46
Juergen Ributzkad12ccbd2013-11-19 00:57:56 +000047 virtual ~NVPTXTargetObjectFile();
Justin Holewinskiae556d32012-05-04 20:18:50 +000048
49 virtual void Initialize(MCContext &ctx, const TargetMachine &TM) {
Rafael Espindolae133ed82013-10-29 17:28:26 +000050 TargetLoweringObjectFile::Initialize(ctx, TM);
Justin Holewinski0497ab12013-03-30 14:29:21 +000051 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());
Justin Holewinskiae556d32012-05-04 20:18:50 +000057
Justin Holewinski0497ab12013-03-30 14:29:21 +000058 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());
Eric Christopherd666bb02012-05-08 20:45:04 +000088 }
Justin Holewinskiae556d32012-05-04 20:18:50 +000089
90 virtual const MCSection *getSectionForConstant(SectionKind Kind) const {
91 return ReadOnlySection;
Eric Christopherd666bb02012-05-08 20:45:04 +000092 }
Justin Holewinskiae556d32012-05-04 20:18:50 +000093
94 virtual const MCSection *
95 getExplicitSectionGlobal(const GlobalValue *GV, SectionKind Kind,
Justin Holewinski0497ab12013-03-30 14:29:21 +000096 Mangler *Mang, const TargetMachine &TM) const {
Justin Holewinskiae556d32012-05-04 20:18:50 +000097 return DataSection;
Eric Christopherd666bb02012-05-08 20:45:04 +000098 }
Justin Holewinskiae556d32012-05-04 20:18:50 +000099
100};
101
102} // end namespace llvm
103
104#endif