LLVM API Documentation

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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_NVPTXSECTION_H
15 #define LLVM_NVPTXSECTION_H
16 
17 #include "llvm/IR/GlobalVariable.h"
18 #include "llvm/MC/MCSection.h"
19 #include <vector>
20 
21 namespace llvm {
22 /// NVPTXSection - Represents a section in PTX
23 /// PTX does not have sections. We create this class in order to use
24 /// the ASMPrint interface.
25 ///
26 class NVPTXSection : public MCSection {
27  virtual void anchor();
28 public:
30  virtual ~NVPTXSection() {}
31 
32  /// Override this as NVPTX has its own way of printing switching
33  /// to a section.
34  virtual void PrintSwitchToSection(const MCAsmInfo &MAI,
35  raw_ostream &OS,
36  const MCExpr *Subsection) const {}
37 
38  /// Base address of PTX sections is zero.
39  virtual bool isBaseAddressKnownZero() const { return true; }
40  virtual bool UseCodeAlign() const { return false; }
41  virtual bool isVirtualSection() const { return false; }
42  virtual std::string getLabelBeginName() const { return ""; }
43  virtual std::string getLabelEndName() const { return ""; }
44 };
45 
46 } // end namespace llvm
47 
48 #endif
NVPTXSection(SectionVariant V, SectionKind K)
Definition: NVPTXSection.h:29
virtual bool isVirtualSection() const
Definition: NVPTXSection.h:41
virtual bool isBaseAddressKnownZero() const
Base address of PTX sections is zero.
Definition: NVPTXSection.h:39
virtual std::string getLabelEndName() const
Definition: NVPTXSection.h:43
virtual void PrintSwitchToSection(const MCAsmInfo &MAI, raw_ostream &OS, const MCExpr *Subsection) const
Definition: NVPTXSection.h:34
virtual bool UseCodeAlign() const
Definition: NVPTXSection.h:40
virtual ~NVPTXSection()
Definition: NVPTXSection.h:30
virtual std::string getLabelBeginName() const
Definition: NVPTXSection.h:42