Path: blob/main/contrib/llvm-project/llvm/lib/Target/NVPTX/MCTargetDesc/NVPTXTargetStreamer.h
35295 views
//=====-- NVPTXTargetStreamer.h - NVPTX Target Streamer ------*- C++ -*--=====//1//2// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.3// See https://llvm.org/LICENSE.txt for license information.4// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception5//6//===----------------------------------------------------------------------===//78#ifndef LLVM_LIB_TARGET_NVPTX_MCTARGETDESC_NVPTXTARGETSTREAMER_H9#define LLVM_LIB_TARGET_NVPTX_MCTARGETDESC_NVPTXTARGETSTREAMER_H1011#include "llvm/MC/MCStreamer.h"1213namespace llvm {14class MCSection;1516/// Implments NVPTX-specific streamer.17class NVPTXTargetStreamer : public MCTargetStreamer {18private:19SmallVector<std::string, 4> DwarfFiles;20bool HasSections = false;2122public:23NVPTXTargetStreamer(MCStreamer &S);24~NVPTXTargetStreamer() override;2526/// Outputs the list of the DWARF '.file' directives to the streamer.27void outputDwarfFileDirectives();28/// Close last section.29void closeLastSection();3031/// Record DWARF file directives for later output.32/// According to PTX ISA, CUDA Toolkit documentation, 11.5.3. Debugging33/// Directives: .file34/// (http://docs.nvidia.com/cuda/parallel-thread-execution/index.html#debugging-directives-file),35/// The .file directive is allowed only in the outermost scope, i.e., at the36/// same level as kernel and device function declarations. Also, the order of37/// the .loc and .file directive does not matter, .file directives may follow38/// the .loc directives where the file is referenced.39/// LLVM emits .file directives immediately the location debug info is40/// emitted, i.e. they may be emitted inside functions. We gather all these41/// directives and emit them outside of the sections and, thus, outside of the42/// functions.43void emitDwarfFileDirective(StringRef Directive) override;44void changeSection(const MCSection *CurSection, MCSection *Section,45uint32_t SubSection, raw_ostream &OS) override;46/// Emit the bytes in \p Data into the output.47///48/// This is used to emit bytes in \p Data as sequence of .byte directives.49void emitRawBytes(StringRef Data) override;50};5152class NVPTXAsmTargetStreamer : public NVPTXTargetStreamer {53public:54NVPTXAsmTargetStreamer(MCStreamer &S);55~NVPTXAsmTargetStreamer() override;56};5758} // end namespace llvm5960#endif616263