blob: e166be5a68e4be7680e47eb4e7b547d848ecfa55 [file] [log] [blame]
Justin Holewinski49683f32012-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
14#ifndef LLVM_NVPTXSECTION_H
15#define LLVM_NVPTXSECTION_H
16
Chandler Carruth0b8c9a82013-01-02 11:36:10 +000017#include "llvm/IR/GlobalVariable.h"
Chandler Carrutha1514e22012-12-04 07:12:27 +000018#include "llvm/MC/MCSection.h"
Justin Holewinski49683f32012-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 {
27
28public:
29 NVPTXSection(SectionVariant V, SectionKind K) : MCSection(V, K) {}
Bill Wendlingecb3f432012-05-15 00:41:56 +000030 ~NVPTXSection() {}
Justin Holewinski49683f32012-05-04 20:18:50 +000031
32 /// Override this as NVPTX has its own way of printing switching
33 /// to a section.
34 virtual void PrintSwitchToSection(const MCAsmInfo &MAI,
35 raw_ostream &OS) const {}
36
37 /// Base address of PTX sections is zero.
38 virtual bool isBaseAddressKnownZero() const { return true; }
39 virtual bool UseCodeAlign() const { return false; }
40 virtual bool isVirtualSection() const { return false; }
Eric Christopherb1cc6f32012-12-13 03:00:35 +000041 virtual std::string getLabelBeginName() const { return ""; }
42 virtual std::string getLabelEndName() const { return ""; }
Justin Holewinski49683f32012-05-04 20:18:50 +000043};
44
45} // end namespace llvm
46
47#endif