LLVM  4.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 /// \brief 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 
20 #include "llvm/MC/MCStreamer.h"
21 
22 namespace llvm {
23 
24 class MCELFStreamer;
25 
26 /// WebAssembly-specific streamer interface, to implement support
27 /// WebAssembly-specific assembly directives.
29 public:
31 
32  /// .param
33  virtual void emitParam(ArrayRef<MVT> Types) = 0;
34  /// .result
35  virtual void emitResult(ArrayRef<MVT> Types) = 0;
36  /// .local
37  virtual void emitLocal(ArrayRef<MVT> Types) = 0;
38  /// .endfunc
39  virtual void emitEndFunc() = 0;
40  /// .functype
42  SmallVectorImpl<MVT> &Params,
44  llvm_unreachable("emitIndirectFunctionType not implemented");
45  }
46  /// .indidx
47  virtual void emitIndIdx(const MCExpr *Value) = 0;
48  /// .import_global
49  virtual void emitGlobalImport(StringRef name) = 0;
50 };
51 
52 /// This part is for ascii assembly output
55 
56 public:
58 
59  void emitParam(ArrayRef<MVT> Types) override;
60  void emitResult(ArrayRef<MVT> Types) override;
61  void emitLocal(ArrayRef<MVT> Types) override;
62  void emitEndFunc() override;
64  SmallVectorImpl<MVT> &Params,
65  SmallVectorImpl<MVT> &Results) override;
66  void emitIndIdx(const MCExpr *Value) override;
67  void emitGlobalImport(StringRef name) override;
68 };
69 
70 /// This part is for ELF object output
72 public:
74 
75  void emitParam(ArrayRef<MVT> Types) override;
76  void emitResult(ArrayRef<MVT> Types) override;
77  void emitLocal(ArrayRef<MVT> Types) override;
78  void emitEndFunc() override;
80  SmallVectorImpl<MVT> &Params,
81  SmallVectorImpl<MVT> &Results) override;
82  void emitIndIdx(const MCExpr *Value) override;
83  void emitGlobalImport(StringRef name) override;
84 };
85 
86 } // end namespace llvm
87 
88 #endif
virtual void emitIndirectFunctionType(StringRef name, SmallVectorImpl< MVT > &Params, SmallVectorImpl< MVT > &Results)
.functype
void emitLocal(ArrayRef< MVT > Types) override
.local
formatted_raw_ostream - A raw_ostream that wraps another one and keeps track of line and column posit...
void emitResult(ArrayRef< MVT > Types) override
.result
Target specific streamer interface.
Definition: MCStreamer.h:73
virtual void emitGlobalImport(StringRef name)=0
.import_global
Function Alias Analysis Results
void emitIndirectFunctionType(StringRef name, SmallVectorImpl< MVT > &Params, SmallVectorImpl< MVT > &Results) override
.functype
void emitResult(ArrayRef< MVT > Types) override
.result
This class consists of common code factored out of the SmallVector class to reduce code duplication b...
Definition: APFloat.h:32
Base class for the full range of assembler expressions which are needed for parsing.
Definition: MCExpr.h:34
virtual void emitParam(ArrayRef< MVT > Types)=0
.param
void emitGlobalImport(StringRef name) override
.import_global
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:161
void emitIndIdx(const MCExpr *Value) override
.indidx
void emitIndIdx(const MCExpr *Value) override
.indidx
This part is for ELF object output.
This part is for ascii assembly output.
WebAssemblyTargetAsmStreamer(MCStreamer &S, formatted_raw_ostream &OS)
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
void emitIndirectFunctionType(StringRef name, SmallVectorImpl< MVT > &Params, SmallVectorImpl< MVT > &Results) override
.functype
void emitParam(ArrayRef< MVT > Types) override
.param
virtual void emitResult(ArrayRef< MVT > Types)=0
.result
void emitLocal(ArrayRef< MVT > Types) override
.local
void emitGlobalImport(StringRef name) override
.import_global
LLVM Value Representation.
Definition: Value.h:71
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:47
void emitParam(ArrayRef< MVT > Types) override
.param
virtual void emitIndIdx(const MCExpr *Value)=0
.indidx