LLVM  4.0.0
NVPTXSection.h
Go to the documentation of this file.
1 //===- NVPTXSection.h - NVPTX-specific section representation ---*- 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 // This file declares the NVPTXSection class.
11 //
12 //===----------------------------------------------------------------------===//
13 
14 #ifndef LLVM_LIB_TARGET_NVPTX_NVPTXSECTION_H
15 #define LLVM_LIB_TARGET_NVPTX_NVPTXSECTION_H
16 
17 #include "llvm/MC/MCSection.h"
18 #include "llvm/MC/SectionKind.h"
19 
20 namespace llvm {
21 
22 /// Represents a section in PTX PTX does not have sections. We create this class
23 /// in order to use the ASMPrint interface.
24 ///
25 class NVPTXSection final : public MCSection {
26  virtual void anchor();
27 
28 public:
30  ~NVPTXSection() = default;
31 
32  /// Override this as NVPTX has its own way of printing switching
33  /// to a section.
35  raw_ostream &OS,
36  const MCExpr *Subsection) const override {}
37 
38  /// Base address of PTX sections is zero.
39  bool UseCodeAlign() const override { return false; }
40  bool isVirtualSection() const override { return false; }
41 };
42 
43 } // end namespace llvm
44 
45 #endif // LLVM_LIB_TARGET_NVPTX_NVPTXSECTION_H
NVPTXSection(SectionVariant V, SectionKind K)
Definition: NVPTXSection.h:29
Instances of this class represent a uniqued identifier for a section in the current translation unit...
Definition: MCSection.h:40
bool UseCodeAlign() const override
Base address of PTX sections is zero.
Definition: NVPTXSection.h:39
Base class for the full range of assembler expressions which are needed for parsing.
Definition: MCExpr.h:34
~NVPTXSection()=default
This class is intended to be used as a base class for asm properties and features specific to the tar...
Definition: MCAsmInfo.h:57
void PrintSwitchToSection(const MCAsmInfo &MAI, raw_ostream &OS, const MCExpr *Subsection) const override
Override this as NVPTX has its own way of printing switching to a section.
Definition: NVPTXSection.h:34
SectionKind - This is a simple POD value that classifies the properties of a section.
Definition: SectionKind.h:23
Represents a section in PTX PTX does not have sections.
Definition: NVPTXSection.h:25
bool isVirtualSection() const override
Check whether this section is "virtual", that is has no actual object file contents.
Definition: NVPTXSection.h:40
This class implements an extremely fast bulk output stream that can only output to a stream...
Definition: raw_ostream.h:44