WasmException.h 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  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. namespace llvm {
  17. class AsmPrinter;
  18. class MachineFunction;
  19. struct LandingPadInfo;
  20. template <typename T> class SmallVectorImpl;
  21. class LLVM_LIBRARY_VISIBILITY WasmException : public EHStreamer {
  22. public:
  23. WasmException(AsmPrinter *A) : EHStreamer(A) {}
  24. void endModule() override;
  25. void beginFunction(const MachineFunction *MF) override {}
  26. void endFunction(const MachineFunction *MF) override;
  27. protected:
  28. // Compute the call site table for wasm EH.
  29. void computeCallSiteTable(
  30. SmallVectorImpl<CallSiteEntry> &CallSites,
  31. SmallVectorImpl<CallSiteRange> &CallSiteRanges,
  32. const SmallVectorImpl<const LandingPadInfo *> &LandingPads,
  33. const SmallVectorImpl<unsigned> &FirstActions) override;
  34. };
  35. } // End of namespace llvm
  36. #endif