2017-01-10 06:16:51 +08:00
|
|
|
//===- NVPTXSection.h - NVPTX-specific section representation ---*- C++ -*-===//
|
2012-05-05 04:18:50 +08:00
|
|
|
//
|
|
|
|
// The LLVM Compiler Infrastructure
|
|
|
|
//
|
|
|
|
// This file is distributed under the University of Illinois Open Source
|
|
|
|
// License. See LICENSE.TXT for details.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
//
|
|
|
|
// This file declares the NVPTXSection class.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
2014-08-14 00:26:38 +08:00
|
|
|
#ifndef LLVM_LIB_TARGET_NVPTX_NVPTXSECTION_H
|
|
|
|
#define LLVM_LIB_TARGET_NVPTX_NVPTXSECTION_H
|
2012-05-05 04:18:50 +08:00
|
|
|
|
2012-12-04 15:12:27 +08:00
|
|
|
#include "llvm/MC/MCSection.h"
|
2017-01-10 06:16:51 +08:00
|
|
|
#include "llvm/MC/SectionKind.h"
|
2012-05-05 04:18:50 +08:00
|
|
|
|
|
|
|
namespace llvm {
|
2017-01-10 06:16:51 +08:00
|
|
|
|
2015-10-07 21:38:49 +08:00
|
|
|
/// Represents a section in PTX PTX does not have sections. We create this class
|
|
|
|
/// in order to use the ASMPrint interface.
|
2012-05-05 04:18:50 +08:00
|
|
|
///
|
2015-10-07 21:46:06 +08:00
|
|
|
class NVPTXSection final : public MCSection {
|
2013-11-19 08:57:56 +08:00
|
|
|
virtual void anchor();
|
2017-01-10 06:16:51 +08:00
|
|
|
|
2012-05-05 04:18:50 +08:00
|
|
|
public:
|
2015-04-05 02:02:01 +08:00
|
|
|
NVPTXSection(SectionVariant V, SectionKind K) : MCSection(V, K, nullptr) {}
|
2017-01-10 06:16:51 +08:00
|
|
|
~NVPTXSection() = default;
|
2012-05-05 04:18:50 +08:00
|
|
|
|
|
|
|
/// Override this as NVPTX has its own way of printing switching
|
|
|
|
/// to a section.
|
2017-01-30 23:38:43 +08:00
|
|
|
void PrintSwitchToSection(const MCAsmInfo &MAI, const Triple &T,
|
2014-04-29 15:57:44 +08:00
|
|
|
raw_ostream &OS,
|
|
|
|
const MCExpr *Subsection) const override {}
|
2012-05-05 04:18:50 +08:00
|
|
|
|
|
|
|
/// Base address of PTX sections is zero.
|
2014-04-29 15:57:44 +08:00
|
|
|
bool UseCodeAlign() const override { return false; }
|
|
|
|
bool isVirtualSection() const override { return false; }
|
2012-05-05 04:18:50 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
} // end namespace llvm
|
|
|
|
|
2017-01-10 06:16:51 +08:00
|
|
|
#endif // LLVM_LIB_TARGET_NVPTX_NVPTXSECTION_H
|