1239310Sdim//===- NVPTXSection.h - NVPTX-specific section representation -*- C++ -*-===//
2239310Sdim//
3239310Sdim//                     The LLVM Compiler Infrastructure
4239310Sdim//
5239310Sdim// This file is distributed under the University of Illinois Open Source
6239310Sdim// License. See LICENSE.TXT for details.
7239310Sdim//
8239310Sdim//===----------------------------------------------------------------------===//
9239310Sdim//
10239310Sdim// This file declares the NVPTXSection class.
11239310Sdim//
12239310Sdim//===----------------------------------------------------------------------===//
13239310Sdim
14239310Sdim#ifndef LLVM_NVPTXSECTION_H
15239310Sdim#define LLVM_NVPTXSECTION_H
16239310Sdim
17249423Sdim#include "llvm/IR/GlobalVariable.h"
18239310Sdim#include "llvm/MC/MCSection.h"
19239310Sdim#include <vector>
20239310Sdim
21239310Sdimnamespace llvm {
22239310Sdim/// NVPTXSection - Represents a section in PTX
23239310Sdim/// PTX does not have sections. We create this class in order to use
24239310Sdim/// the ASMPrint interface.
25239310Sdim///
26239310Sdimclass NVPTXSection : public MCSection {
27263508Sdim  virtual void anchor();
28239310Sdimpublic:
29239310Sdim  NVPTXSection(SectionVariant V, SectionKind K) : MCSection(V, K) {}
30263508Sdim  virtual ~NVPTXSection() {}
31239310Sdim
32239310Sdim  /// Override this as NVPTX has its own way of printing switching
33239310Sdim  /// to a section.
34239310Sdim  virtual void PrintSwitchToSection(const MCAsmInfo &MAI,
35251662Sdim                                    raw_ostream &OS,
36251662Sdim                                    const MCExpr *Subsection) const {}
37239310Sdim
38239310Sdim  /// Base address of PTX sections is zero.
39239310Sdim  virtual bool isBaseAddressKnownZero() const { return true; }
40239310Sdim  virtual bool UseCodeAlign() const { return false; }
41239310Sdim  virtual bool isVirtualSection() const { return false; }
42249423Sdim  virtual std::string getLabelBeginName() const { return ""; }
43249423Sdim  virtual std::string getLabelEndName() const { return ""; }
44239310Sdim};
45239310Sdim
46239310Sdim} // end namespace llvm
47239310Sdim
48239310Sdim#endif
49