LLVM API Documentation

NVPTXSection.h
Go to the documentation of this file.
00001 //===- NVPTXSection.h - NVPTX-specific section representation -*- C++ -*-===//
00002 //
00003 //                     The LLVM Compiler Infrastructure
00004 //
00005 // This file is distributed under the University of Illinois Open Source
00006 // License. See LICENSE.TXT for details.
00007 //
00008 //===----------------------------------------------------------------------===//
00009 //
00010 // This file declares the NVPTXSection class.
00011 //
00012 //===----------------------------------------------------------------------===//
00013 
00014 #ifndef LLVM_LIB_TARGET_NVPTX_NVPTXSECTION_H
00015 #define LLVM_LIB_TARGET_NVPTX_NVPTXSECTION_H
00016 
00017 #include "llvm/IR/GlobalVariable.h"
00018 #include "llvm/MC/MCSection.h"
00019 #include <vector>
00020 
00021 namespace llvm {
00022 /// NVPTXSection - Represents a section in PTX
00023 /// PTX does not have sections. We create this class in order to use
00024 /// the ASMPrint interface.
00025 ///
00026 class NVPTXSection : public MCSection {
00027   virtual void anchor();
00028 public:
00029   NVPTXSection(SectionVariant V, SectionKind K) : MCSection(V, K) {}
00030   virtual ~NVPTXSection() {}
00031 
00032   /// Override this as NVPTX has its own way of printing switching
00033   /// to a section.
00034   void PrintSwitchToSection(const MCAsmInfo &MAI,
00035                             raw_ostream &OS,
00036                             const MCExpr *Subsection) const override {}
00037 
00038   /// Base address of PTX sections is zero.
00039   bool isBaseAddressKnownZero() const override { return true; }
00040   bool UseCodeAlign() const override { return false; }
00041   bool isVirtualSection() const override { return false; }
00042   std::string getLabelBeginName() const override { return ""; }
00043   std::string getLabelEndName() const override { return ""; }
00044 };
00045 
00046 } // end namespace llvm
00047 
00048 #endif