xref: /freebsd/contrib/llvm-project/llvm/lib/CodeGen/AsmPrinter/WasmException.h (revision 8ddb146abcdf061be9f2c0db7e391697dafad85c)
1 //===-- WasmException.h - Wasm Exception Framework -------------*- C++ -*--===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 //
9 // This file contains support for writing WebAssembly exception info into asm
10 // files.
11 //
12 //===----------------------------------------------------------------------===//
13 
14 #ifndef LLVM_LIB_CODEGEN_ASMPRINTER_WASMEXCEPTION_H
15 #define LLVM_LIB_CODEGEN_ASMPRINTER_WASMEXCEPTION_H
16 
17 #include "EHStreamer.h"
18 #include "llvm/CodeGen/AsmPrinter.h"
19 
20 namespace llvm {
21 
22 class LLVM_LIBRARY_VISIBILITY WasmException : public EHStreamer {
23 public:
24   WasmException(AsmPrinter *A) : EHStreamer(A) {}
25 
26   void endModule() override;
27   void beginFunction(const MachineFunction *MF) override {}
28   virtual void markFunctionEnd() override;
29   void endFunction(const MachineFunction *MF) override;
30 
31 protected:
32   // Compute the call site table for wasm EH.
33   void computeCallSiteTable(
34       SmallVectorImpl<CallSiteEntry> &CallSites,
35       SmallVectorImpl<CallSiteRange> &CallSiteRanges,
36       const SmallVectorImpl<const LandingPadInfo *> &LandingPads,
37       const SmallVectorImpl<unsigned> &FirstActions) override;
38 };
39 
40 } // End of namespace llvm
41 
42 #endif
43