blob: 1893b6b2df43d1a5ef56bd6e2ec3748419cda164 [file] [log] [blame]
Heejin Ahn24faf852018-10-25 23:55:10 +00001//===-- WasmException.h - Wasm Exception Framework -------------*- C++ -*--===//
2//
Chandler Carruth2946cd72019-01-19 08:50:56 +00003// 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
Heejin Ahn24faf852018-10-25 23:55:10 +00006//
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
20namespace llvm {
21
22class LLVM_LIBRARY_VISIBILITY WasmException : public EHStreamer {
23public:
24 WasmException(AsmPrinter *A) : EHStreamer(A) {}
25
Heejin Ahnda419bd2018-11-14 02:46:21 +000026 void endModule() override;
Heejin Ahn24faf852018-10-25 23:55:10 +000027 void beginFunction(const MachineFunction *MF) override {}
28 virtual void markFunctionEnd() override;
29 void endFunction(const MachineFunction *MF) override;
30
31protected:
32 // Compute the call site table for wasm EH.
33 void computeCallSiteTable(
34 SmallVectorImpl<CallSiteEntry> &CallSites,
35 const SmallVectorImpl<const LandingPadInfo *> &LandingPads,
36 const SmallVectorImpl<unsigned> &FirstActions) override;
37};
38
39} // End of namespace llvm
40
41#endif