1 //===- NVPTXSection.h - NVPTX-specific section representation -*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 // This file declares the NVPTXSection class.
12 //===----------------------------------------------------------------------===//
14 #ifndef LLVM_LIB_TARGET_NVPTX_NVPTXSECTION_H
15 #define LLVM_LIB_TARGET_NVPTX_NVPTXSECTION_H
17 #include "llvm/IR/GlobalVariable.h"
18 #include "llvm/MC/MCSection.h"
22 /// Represents a section in PTX PTX does not have sections. We create this class
23 /// in order to use the ASMPrint interface.
25 class NVPTXSection : public MCSection {
26 virtual void anchor();
28 NVPTXSection(SectionVariant V, SectionKind K) : MCSection(V, K, nullptr) {}
29 virtual ~NVPTXSection() {}
31 /// Override this as NVPTX has its own way of printing switching
33 void PrintSwitchToSection(const MCAsmInfo &MAI,
35 const MCExpr *Subsection) const override {}
37 /// Base address of PTX sections is zero.
38 bool UseCodeAlign() const override { return false; }
39 bool isVirtualSection() const override { return false; }
42 } // end namespace llvm