• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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/MC/MCSection.h"
18 #include "llvm/GlobalVariable.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 
28 public:
NVPTXSection(SectionVariant V,SectionKind K)29   NVPTXSection(SectionVariant V, SectionKind K) : MCSection(V, K) {}
~NVPTXSection()30   ~NVPTXSection() {}
31 
32   /// Override this as NVPTX has its own way of printing switching
33   /// to a section.
PrintSwitchToSection(const MCAsmInfo & MAI,raw_ostream & OS)34   virtual void PrintSwitchToSection(const MCAsmInfo &MAI,
35                                     raw_ostream &OS) const {}
36 
37   /// Base address of PTX sections is zero.
isBaseAddressKnownZero()38   virtual bool isBaseAddressKnownZero() const { return true; }
UseCodeAlign()39   virtual bool UseCodeAlign() const { return false; }
isVirtualSection()40   virtual bool isVirtualSection() const { return false; }
41 };
42 
43 } // end namespace llvm
44 
45 #endif
46