LLVM  8.0.1
NVPTXTargetStreamer.h
Go to the documentation of this file.
1 //=====-- NVPTXTargetStreamer.h - NVPTX Target Streamer ------*- 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 #ifndef LLVM_LIB_TARGET_NVPTX_MCTARGETDESC_NVPTXTARGETSTREAMER_H
11 #define LLVM_LIB_TARGET_NVPTX_MCTARGETDESC_NVPTXTARGETSTREAMER_H
12 
13 #include "llvm/MC/MCStreamer.h"
14 
15 namespace llvm {
16 class MCSection;
17 
18 /// Implments NVPTX-specific streamer.
20 private:
21  SmallVector<std::string, 4> DwarfFiles;
22 
23 public:
25  ~NVPTXTargetStreamer() override;
26 
27  /// Outputs the list of the DWARF '.file' directives to the streamer.
29 
30  /// Record DWARF file directives for later output.
31  /// According to PTX ISA, CUDA Toolkit documentation, 11.5.3. Debugging
32  /// Directives: .file
33  /// (http://docs.nvidia.com/cuda/parallel-thread-execution/index.html#debugging-directives-file),
34  /// The .file directive is allowed only in the outermost scope, i.e., at the
35  /// same level as kernel and device function declarations. Also, the order of
36  /// the .loc and .file directive does not matter, .file directives may follow
37  /// the .loc directives where the file is referenced.
38  /// LLVM emits .file directives immediately the location debug info is
39  /// emitted, i.e. they may be emitted inside functions. We gather all these
40  /// directives and emit them outside of the sections and, thus, outside of the
41  /// functions.
42  void emitDwarfFileDirective(StringRef Directive) override;
43  void changeSection(const MCSection *CurSection, MCSection *Section,
44  const MCExpr *SubSection, raw_ostream &OS) override;
45  /// Emit the bytes in \p Data into the output.
46  ///
47  /// This is used to emit bytes in \p Data as sequence of .byte directives.
48  void emitRawBytes(StringRef Data) override;
49 };
50 
51 } // end namespace llvm
52 
53 #endif
Instances of this class represent a uniqued identifier for a section in the current translation unit...
Definition: MCSection.h:39
This class represents lattice values for constants.
Definition: AllocatorList.h:24
Target specific streamer interface.
Definition: MCStreamer.h:84
void emitRawBytes(StringRef Data) override
Emit the bytes in Data into the output.
Base class for the full range of assembler expressions which are needed for parsing.
Definition: MCExpr.h:36
Streaming machine code generation interface.
Definition: MCStreamer.h:189
void changeSection(const MCSection *CurSection, MCSection *Section, const MCExpr *SubSection, raw_ostream &OS) override
Update streamer for a new active section.
void emitDwarfFileDirective(StringRef Directive) override
Record DWARF file directives for later output.
Implments NVPTX-specific streamer.
This class implements an extremely fast bulk output stream that can only output to a stream...
Definition: raw_ostream.h:46
StringRef - Represent a constant reference to a string, i.e.
Definition: StringRef.h:49
void outputDwarfFileDirectives()
Outputs the list of the DWARF &#39;.file&#39; directives to the streamer.