/Users/buildslave/jenkins/sharedspace/clang-stage2-coverage-R@2/llvm/lib/Target/NVPTX/NVPTXTargetObjectFile.h
Line | Count | Source (jump to first uncovered line) |
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 | | |
10 | | #ifndef LLVM_LIB_TARGET_NVPTX_NVPTXTARGETOBJECTFILE_H |
11 | | #define LLVM_LIB_TARGET_NVPTX_NVPTXTARGETOBJECTFILE_H |
12 | | |
13 | | #include "NVPTXSection.h" |
14 | | #include "llvm/MC/MCSection.h" |
15 | | #include "llvm/MC/SectionKind.h" |
16 | | #include "llvm/Target/TargetLoweringObjectFile.h" |
17 | | |
18 | | namespace llvm { |
19 | | |
20 | | class NVPTXTargetObjectFile : public TargetLoweringObjectFile { |
21 | | public: |
22 | 351 | NVPTXTargetObjectFile() { |
23 | 351 | TextSection = nullptr; |
24 | 351 | DataSection = nullptr; |
25 | 351 | BSSSection = nullptr; |
26 | 351 | ReadOnlySection = nullptr; |
27 | 351 | |
28 | 351 | StaticCtorSection = nullptr; |
29 | 351 | StaticDtorSection = nullptr; |
30 | 351 | LSDASection = nullptr; |
31 | 351 | EHFrameSection = nullptr; |
32 | 351 | DwarfAbbrevSection = nullptr; |
33 | 351 | DwarfInfoSection = nullptr; |
34 | 351 | DwarfLineSection = nullptr; |
35 | 351 | DwarfFrameSection = nullptr; |
36 | 351 | DwarfPubTypesSection = nullptr; |
37 | 351 | DwarfDebugInlineSection = nullptr; |
38 | 351 | DwarfStrSection = nullptr; |
39 | 351 | DwarfLocSection = nullptr; |
40 | 351 | DwarfARangesSection = nullptr; |
41 | 351 | DwarfRangesSection = nullptr; |
42 | 351 | DwarfMacinfoSection = nullptr; |
43 | 351 | } |
44 | | |
45 | | ~NVPTXTargetObjectFile() override; |
46 | | |
47 | 228 | void Initialize(MCContext &ctx, const TargetMachine &TM) override { |
48 | 228 | TargetLoweringObjectFile::Initialize(ctx, TM); |
49 | 228 | TextSection = new NVPTXSection(MCSection::SV_ELF, SectionKind::getText()); |
50 | 228 | DataSection = new NVPTXSection(MCSection::SV_ELF, SectionKind::getData()); |
51 | 228 | BSSSection = new NVPTXSection(MCSection::SV_ELF, SectionKind::getBSS()); |
52 | 228 | ReadOnlySection = |
53 | 228 | new NVPTXSection(MCSection::SV_ELF, SectionKind::getReadOnly()); |
54 | 228 | StaticCtorSection = |
55 | 228 | new NVPTXSection(MCSection::SV_ELF, SectionKind::getMetadata()); |
56 | 228 | StaticDtorSection = |
57 | 228 | new NVPTXSection(MCSection::SV_ELF, SectionKind::getMetadata()); |
58 | 228 | LSDASection = |
59 | 228 | new NVPTXSection(MCSection::SV_ELF, SectionKind::getMetadata()); |
60 | 228 | EHFrameSection = |
61 | 228 | new NVPTXSection(MCSection::SV_ELF, SectionKind::getMetadata()); |
62 | 228 | DwarfAbbrevSection = |
63 | 228 | new NVPTXSection(MCSection::SV_ELF, SectionKind::getMetadata()); |
64 | 228 | DwarfInfoSection = |
65 | 228 | new NVPTXSection(MCSection::SV_ELF, SectionKind::getMetadata()); |
66 | 228 | DwarfLineSection = |
67 | 228 | new NVPTXSection(MCSection::SV_ELF, SectionKind::getMetadata()); |
68 | 228 | DwarfFrameSection = |
69 | 228 | new NVPTXSection(MCSection::SV_ELF, SectionKind::getMetadata()); |
70 | 228 | DwarfPubTypesSection = |
71 | 228 | new NVPTXSection(MCSection::SV_ELF, SectionKind::getMetadata()); |
72 | 228 | DwarfDebugInlineSection = |
73 | 228 | new NVPTXSection(MCSection::SV_ELF, SectionKind::getMetadata()); |
74 | 228 | DwarfStrSection = |
75 | 228 | new NVPTXSection(MCSection::SV_ELF, SectionKind::getMetadata()); |
76 | 228 | DwarfLocSection = |
77 | 228 | new NVPTXSection(MCSection::SV_ELF, SectionKind::getMetadata()); |
78 | 228 | DwarfARangesSection = |
79 | 228 | new NVPTXSection(MCSection::SV_ELF, SectionKind::getMetadata()); |
80 | 228 | DwarfRangesSection = |
81 | 228 | new NVPTXSection(MCSection::SV_ELF, SectionKind::getMetadata()); |
82 | 228 | DwarfMacinfoSection = |
83 | 228 | new NVPTXSection(MCSection::SV_ELF, SectionKind::getMetadata()); |
84 | 228 | } |
85 | | |
86 | | MCSection *getSectionForConstant(const DataLayout &DL, SectionKind Kind, |
87 | | const Constant *C, |
88 | 0 | unsigned &Align) const override { |
89 | 0 | return ReadOnlySection; |
90 | 0 | } |
91 | | |
92 | | MCSection *getExplicitSectionGlobal(const GlobalObject *GO, SectionKind Kind, |
93 | 0 | const TargetMachine &TM) const override { |
94 | 0 | return DataSection; |
95 | 0 | } |
96 | | |
97 | | MCSection *SelectSectionForGlobal(const GlobalObject *GO, SectionKind Kind, |
98 | | const TargetMachine &TM) const override; |
99 | | }; |
100 | | |
101 | | } // end namespace llvm |
102 | | |
103 | | #endif // LLVM_LIB_TARGET_NVPTX_NVPTXTARGETOBJECTFILE_H |