blob: 0d2627d62ebdd3dbfa373f73a0340a69827ee8d9 [file] [log] [blame]
Justin Holewinskiae556d32012-05-04 20:18:50 +00001//===- 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
Benjamin Kramera7c40ef2014-08-13 16:26:38 +000014#ifndef LLVM_LIB_TARGET_NVPTX_NVPTXSECTION_H
15#define LLVM_LIB_TARGET_NVPTX_NVPTXSECTION_H
Justin Holewinskiae556d32012-05-04 20:18:50 +000016
Chandler Carruth9fb823b2013-01-02 11:36:10 +000017#include "llvm/IR/GlobalVariable.h"
Chandler Carruth802d7552012-12-04 07:12:27 +000018#include "llvm/MC/MCSection.h"
Justin Holewinskiae556d32012-05-04 20:18:50 +000019#include <vector>
20
21namespace 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///
26class NVPTXSection : public MCSection {
Juergen Ributzkad12ccbd2013-11-19 00:57:56 +000027 virtual void anchor();
Justin Holewinskiae556d32012-05-04 20:18:50 +000028public:
Rafael Espindola8ca44f02015-04-04 18:02:01 +000029 NVPTXSection(SectionVariant V, SectionKind K) : MCSection(V, K, nullptr) {}
Juergen Ributzkad12ccbd2013-11-19 00:57:56 +000030 virtual ~NVPTXSection() {}
Justin Holewinskiae556d32012-05-04 20:18:50 +000031
32 /// Override this as NVPTX has its own way of printing switching
33 /// to a section.
Craig Topper2865c982014-04-29 07:57:44 +000034 void PrintSwitchToSection(const MCAsmInfo &MAI,
35 raw_ostream &OS,
36 const MCExpr *Subsection) const override {}
Justin Holewinskiae556d32012-05-04 20:18:50 +000037
38 /// Base address of PTX sections is zero.
Craig Topper2865c982014-04-29 07:57:44 +000039 bool UseCodeAlign() const override { return false; }
40 bool isVirtualSection() const override { return false; }
Justin Holewinskiae556d32012-05-04 20:18:50 +000041};
42
43} // end namespace llvm
44
45#endif