[ControlHeightReduction] Add assert to avoid underflow (#116339)
[llvm-project.git] / clang / lib / Interpreter / Wasm.h
blob4632613326d39ba6bcd63639ae8e9e87b4032e41
1 //===------------------ Wasm.h - Wasm Interpreter ---------------*- 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 implements interpreter support for code execution in WebAssembly.
11 //===----------------------------------------------------------------------===//
13 #ifndef LLVM_CLANG_LIB_INTERPRETER_WASM_H
14 #define LLVM_CLANG_LIB_INTERPRETER_WASM_H
16 #ifndef __EMSCRIPTEN__
17 #error "This requires emscripten."
18 #endif // __EMSCRIPTEN__
20 #include "IncrementalExecutor.h"
22 namespace clang {
24 class WasmIncrementalExecutor : public IncrementalExecutor {
25 public:
26 WasmIncrementalExecutor(llvm::orc::ThreadSafeContext &TSC);
28 llvm::Error addModule(PartialTranslationUnit &PTU) override;
29 llvm::Error removeModule(PartialTranslationUnit &PTU) override;
30 llvm::Error runCtors() const override;
31 llvm::Error cleanUp() override;
33 ~WasmIncrementalExecutor() override;
36 } // namespace clang
38 #endif // LLVM_CLANG_LIB_INTERPRETER_WASM_H