1 //===-- WasmException.h - Wasm Exception Framework -------------*- 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 // This file contains support for writing WebAssembly exception info into asm
11 // files.
12 //
13 //===----------------------------------------------------------------------===//
14 
15 #ifndef LLVM_LIB_CODEGEN_ASMPRINTER_WASMEXCEPTION_H
16 #define LLVM_LIB_CODEGEN_ASMPRINTER_WASMEXCEPTION_H
17 
18 #include "EHStreamer.h"
19 #include "llvm/CodeGen/AsmPrinter.h"
20 
21 namespace llvm {
22 
23 class LLVM_LIBRARY_VISIBILITY WasmException : public EHStreamer {
24 public:
25   WasmException(AsmPrinter *A) : EHStreamer(A) {}
26 
27   void endModule() override;
28   void beginFunction(const MachineFunction *MF) override {}
29   virtual void markFunctionEnd() override;
30   void endFunction(const MachineFunction *MF) override;
31 
32 protected:
33   // Compute the call site table for wasm EH.
34   void computeCallSiteTable(
35       SmallVectorImpl<CallSiteEntry> &CallSites,
36       const SmallVectorImpl<const LandingPadInfo *> &LandingPads,
37       const SmallVectorImpl<unsigned> &FirstActions) override;
38 };
39 
40 } // End of namespace llvm
41 
42 #endif
43