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_NVPTXSECTION_H
15 #define LLVM_NVPTXSECTION_H
17 #include "llvm/IR/GlobalVariable.h"
18 #include "llvm/MC/MCSection.h"
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.
26 class NVPTXSection : public MCSection {
27 virtual void anchor();
29 NVPTXSection(SectionVariant V, SectionKind K) : MCSection(V, K) {}
30 virtual ~NVPTXSection() {}
32 /// Override this as NVPTX has its own way of printing switching
34 void PrintSwitchToSection(const MCAsmInfo &MAI,
36 const MCExpr *Subsection) const override {}
38 /// Base address of PTX sections is zero.
39 bool isBaseAddressKnownZero() const override { return true; }
40 bool UseCodeAlign() const override { return false; }
41 bool isVirtualSection() const override { return false; }
42 std::string getLabelBeginName() const override { return ""; }
43 std::string getLabelEndName() const override { return ""; }
46 } // end namespace llvm