LLVM  7.0.0
WebAssemblyTargetStreamer.h
Go to the documentation of this file.
1 //==-- WebAssemblyTargetStreamer.h - WebAssembly 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 /// \file
11 /// This file declares WebAssembly-specific target streamer classes.
12 /// These are for implementing support for target-specific assembly directives.
13 ///
14 //===----------------------------------------------------------------------===//
15 
16 #ifndef LLVM_LIB_TARGET_WEBASSEMBLY_MCTARGETDESC_WEBASSEMBLYTARGETSTREAMER_H
17 #define LLVM_LIB_TARGET_WEBASSEMBLY_MCTARGETDESC_WEBASSEMBLYTARGETSTREAMER_H
18 
19 #include "llvm/BinaryFormat/Wasm.h"
20 #include "llvm/MC/MCStreamer.h"
22 
23 namespace llvm {
24 
25 class MCWasmStreamer;
26 class MCSymbolWasm;
27 
28 /// WebAssembly-specific streamer interface, to implement support
29 /// WebAssembly-specific assembly directives.
31 public:
33 
34  /// .param
35  virtual void emitParam(MCSymbol *Symbol, ArrayRef<MVT> Types) = 0;
36  /// .result
37  virtual void emitResult(MCSymbol *Symbol, ArrayRef<MVT> Types) = 0;
38  /// .local
39  virtual void emitLocal(ArrayRef<MVT> Types) = 0;
40  /// .endfunc
41  virtual void emitEndFunc() = 0;
42  /// .functype
43  virtual void emitIndirectFunctionType(MCSymbol *Symbol,
44  SmallVectorImpl<MVT> &Params,
46  /// .indidx
47  virtual void emitIndIdx(const MCExpr *Value) = 0;
48  /// .import_global
49  virtual void emitGlobalImport(StringRef name) = 0;
50  /// .import_module
51  virtual void emitImportModule(MCSymbolWasm *Sym, StringRef ModuleName) = 0;
52 
53 protected:
55 };
56 
57 /// This part is for ascii assembly output
60 
61 public:
63 
64  void emitParam(MCSymbol *Symbol, ArrayRef<MVT> Types) override;
65  void emitResult(MCSymbol *Symbol, ArrayRef<MVT> Types) override;
66  void emitLocal(ArrayRef<MVT> Types) override;
67  void emitEndFunc() override;
69  SmallVectorImpl<MVT> &Params,
70  SmallVectorImpl<MVT> &Results) override;
71  void emitIndIdx(const MCExpr *Value) override;
72  void emitGlobalImport(StringRef name) override;
73  void emitImportModule(MCSymbolWasm *Sym, StringRef ModuleName) override;
74 };
75 
76 /// This part is for Wasm object output
78 public:
80 
81  void emitParam(MCSymbol *Symbol, ArrayRef<MVT> Types) override;
82  void emitResult(MCSymbol *Symbol, ArrayRef<MVT> Types) override;
83  void emitLocal(ArrayRef<MVT> Types) override;
84  void emitEndFunc() override;
86  SmallVectorImpl<MVT> &Params,
87  SmallVectorImpl<MVT> &Results) override;
88  void emitIndIdx(const MCExpr *Value) override;
89  void emitGlobalImport(StringRef name) override;
90  void emitImportModule(MCSymbolWasm *Sym, StringRef ModuleName) override;
91 };
92 
93 } // end namespace llvm
94 
95 #endif
virtual void emitImportModule(MCSymbolWasm *Sym, StringRef ModuleName)=0
.import_module
Compute iterated dominance frontiers using a linear time algorithm.
Definition: AllocatorList.h:24
MCSymbol - Instances of this class represent a symbol name in the MC file, and MCSymbols are created ...
Definition: MCSymbol.h:42
formatted_raw_ostream - A raw_ostream that wraps another one and keeps track of line and column posit...
Target specific streamer interface.
Definition: MCStreamer.h:83
virtual void emitGlobalImport(StringRef name)=0
.import_global
Function Alias Analysis Results
This class consists of common code factored out of the SmallVector class to reduce code duplication b...
Definition: APFloat.h:42
Base class for the full range of assembler expressions which are needed for parsing.
Definition: MCExpr.h:36
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory)...
Definition: APInt.h:33
virtual void emitEndFunc()=0
.endfunc
WebAssembly-specific streamer interface, to implement support WebAssembly-specific assembly directive...
Streaming machine code generation interface.
Definition: MCStreamer.h:183
virtual void emitResult(MCSymbol *Symbol, ArrayRef< MVT > Types)=0
.result
The instances of the Type class are immutable: once they are created, they are never changed...
Definition: Type.h:46
This part is for ascii assembly output.
virtual void emitIndirectFunctionType(MCSymbol *Symbol, SmallVectorImpl< MVT > &Params, SmallVectorImpl< MVT > &Results)=0
.functype
This part is for Wasm object output.
virtual void emitParam(MCSymbol *Symbol, ArrayRef< MVT > Types)=0
.param
LLVM Value Representation.
Definition: Value.h:73
static const char * name
virtual void emitLocal(ArrayRef< MVT > Types)=0
.local
StringRef - Represent a constant reference to a string, i.e.
Definition: StringRef.h:49
virtual void emitIndIdx(const MCExpr *Value)=0
.indidx