blob: cbdb42457cf80eaf75eb19b303365a310223e4b6 [file] [log] [blame]
Heejin Ahn24faf852018-10-25 23:55:10 +00001//===-- 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
21namespace llvm {
22
23class LLVM_LIBRARY_VISIBILITY WasmException : public EHStreamer {
24public:
25 WasmException(AsmPrinter *A) : EHStreamer(A) {}
26
Heejin Ahnda419bd2018-11-14 02:46:21 +000027 void endModule() override;
Heejin Ahn24faf852018-10-25 23:55:10 +000028 void beginFunction(const MachineFunction *MF) override {}
29 virtual void markFunctionEnd() override;
30 void endFunction(const MachineFunction *MF) override;
31
32protected:
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