WasmException.h 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  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. #ifndef LLVM_LIB_CODEGEN_ASMPRINTER_WASMEXCEPTION_H
  14. #define LLVM_LIB_CODEGEN_ASMPRINTER_WASMEXCEPTION_H
  15. #include "EHStreamer.h"
  16. #include "llvm/CodeGen/AsmPrinter.h"
  17. namespace llvm {
  18. class LLVM_LIBRARY_VISIBILITY WasmException : public EHStreamer {
  19. public:
  20. WasmException(AsmPrinter *A) : EHStreamer(A) {}
  21. void endModule() override;
  22. void beginFunction(const MachineFunction *MF) override {}
  23. virtual void markFunctionEnd() override;
  24. void endFunction(const MachineFunction *MF) override;
  25. protected:
  26. // Compute the call site table for wasm EH.
  27. void computeCallSiteTable(
  28. SmallVectorImpl<CallSiteEntry> &CallSites,
  29. SmallVectorImpl<CallSiteRange> &CallSiteRanges,
  30. const SmallVectorImpl<const LandingPadInfo *> &LandingPads,
  31. const SmallVectorImpl<unsigned> &FirstActions) override;
  32. };
  33. } // End of namespace llvm
  34. #endif