1343171Sdim//===-- WasmException.h - Wasm Exception Framework -------------*- C++ -*--===//
2343171Sdim//
3353358Sdim// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4353358Sdim// See https://llvm.org/LICENSE.txt for license information.
5353358Sdim// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6343171Sdim//
7343171Sdim//===----------------------------------------------------------------------===//
8343171Sdim//
9343171Sdim// This file contains support for writing WebAssembly exception info into asm
10343171Sdim// files.
11343171Sdim//
12343171Sdim//===----------------------------------------------------------------------===//
13343171Sdim
14343171Sdim#ifndef LLVM_LIB_CODEGEN_ASMPRINTER_WASMEXCEPTION_H
15343171Sdim#define LLVM_LIB_CODEGEN_ASMPRINTER_WASMEXCEPTION_H
16343171Sdim
17343171Sdim#include "EHStreamer.h"
18343171Sdim#include "llvm/CodeGen/AsmPrinter.h"
19343171Sdim
20343171Sdimnamespace llvm {
21343171Sdim
22343171Sdimclass LLVM_LIBRARY_VISIBILITY WasmException : public EHStreamer {
23343171Sdimpublic:
24343171Sdim  WasmException(AsmPrinter *A) : EHStreamer(A) {}
25343171Sdim
26343171Sdim  void endModule() override;
27343171Sdim  void beginFunction(const MachineFunction *MF) override {}
28343171Sdim  virtual void markFunctionEnd() override;
29343171Sdim  void endFunction(const MachineFunction *MF) override;
30343171Sdim
31343171Sdimprotected:
32343171Sdim  // Compute the call site table for wasm EH.
33343171Sdim  void computeCallSiteTable(
34343171Sdim      SmallVectorImpl<CallSiteEntry> &CallSites,
35343171Sdim      const SmallVectorImpl<const LandingPadInfo *> &LandingPads,
36343171Sdim      const SmallVectorImpl<unsigned> &FirstActions) override;
37343171Sdim};
38343171Sdim
39343171Sdim} // End of namespace llvm
40343171Sdim
41343171Sdim#endif
42