xref: /freebsd/contrib/llvm-project/llvm/lib/CodeGen/AsmPrinter/WasmException.h (revision bdd1243df58e60e85101c09001d9812a789b6bc4)
10b57cec5SDimitry Andric //===-- WasmException.h - Wasm Exception Framework -------------*- C++ -*--===//
20b57cec5SDimitry Andric //
30b57cec5SDimitry Andric // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
40b57cec5SDimitry Andric // See https://llvm.org/LICENSE.txt for license information.
50b57cec5SDimitry Andric // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
60b57cec5SDimitry Andric //
70b57cec5SDimitry Andric //===----------------------------------------------------------------------===//
80b57cec5SDimitry Andric //
90b57cec5SDimitry Andric // This file contains support for writing WebAssembly exception info into asm
100b57cec5SDimitry Andric // files.
110b57cec5SDimitry Andric //
120b57cec5SDimitry Andric //===----------------------------------------------------------------------===//
130b57cec5SDimitry Andric 
140b57cec5SDimitry Andric #ifndef LLVM_LIB_CODEGEN_ASMPRINTER_WASMEXCEPTION_H
150b57cec5SDimitry Andric #define LLVM_LIB_CODEGEN_ASMPRINTER_WASMEXCEPTION_H
160b57cec5SDimitry Andric 
170b57cec5SDimitry Andric #include "EHStreamer.h"
180b57cec5SDimitry Andric 
190b57cec5SDimitry Andric namespace llvm {
20*81ad6265SDimitry Andric class AsmPrinter;
21*81ad6265SDimitry Andric class MachineFunction;
22*81ad6265SDimitry Andric struct LandingPadInfo;
23*81ad6265SDimitry Andric template <typename T> class SmallVectorImpl;
240b57cec5SDimitry Andric 
250b57cec5SDimitry Andric class LLVM_LIBRARY_VISIBILITY WasmException : public EHStreamer {
260b57cec5SDimitry Andric public:
WasmException(AsmPrinter * A)270b57cec5SDimitry Andric   WasmException(AsmPrinter *A) : EHStreamer(A) {}
280b57cec5SDimitry Andric 
290b57cec5SDimitry Andric   void endModule() override;
beginFunction(const MachineFunction * MF)300b57cec5SDimitry Andric   void beginFunction(const MachineFunction *MF) override {}
310b57cec5SDimitry Andric   void endFunction(const MachineFunction *MF) override;
320b57cec5SDimitry Andric 
330b57cec5SDimitry Andric protected:
340b57cec5SDimitry Andric   // Compute the call site table for wasm EH.
350b57cec5SDimitry Andric   void computeCallSiteTable(
360b57cec5SDimitry Andric       SmallVectorImpl<CallSiteEntry> &CallSites,
37e8d8bef9SDimitry Andric       SmallVectorImpl<CallSiteRange> &CallSiteRanges,
380b57cec5SDimitry Andric       const SmallVectorImpl<const LandingPadInfo *> &LandingPads,
390b57cec5SDimitry Andric       const SmallVectorImpl<unsigned> &FirstActions) override;
400b57cec5SDimitry Andric };
410b57cec5SDimitry Andric 
420b57cec5SDimitry Andric } // End of namespace llvm
430b57cec5SDimitry Andric 
440b57cec5SDimitry Andric #endif
45