clang 24.0.0git
Wasm.h
Go to the documentation of this file.
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.
10//
11//===----------------------------------------------------------------------===//
12
13#ifndef LLVM_CLANG_LIB_INTERPRETER_WASM_H
14#define LLVM_CLANG_LIB_INTERPRETER_WASM_H
15
16#ifndef __EMSCRIPTEN__
17#error "This requires emscripten."
18#endif // __EMSCRIPTEN__
19
21#include "llvm/ADT/SmallString.h"
22
23namespace clang {
24
26public:
28 const Options &Opts) override;
29 bool supportsJIT() const override { return false; }
31
32private:
34 createExecutor(llvm::orc::ThreadSafeContext &TSC,
35 const clang::TargetInfo &TI) override;
36};
37
39public:
40 WasmIncrementalExecutor(llvm::Error &Err);
42
43 llvm::Error addModule(PartialTranslationUnit &PTU) override;
44 llvm::Error removeModule(PartialTranslationUnit &PTU) override;
45 llvm::Error runCtors() const override;
46 llvm::Error cleanUp() override;
48 getSymbolAddress(llvm::StringRef Name,
49 SymbolNameKind NameKind) const override;
50 llvm::Error LoadDynamicLibrary(const char *name) override;
51
52private:
54};
55
56} // namespace clang
57
58#endif // LLVM_CLANG_LIB_INTERPRETER_WASM_H
Create a pre-configured CompilerInstance for incremental processing.
Definition Interpreter.h:54
Common configuration and interface for incremental executor builders.
Exposes information about the current target.
Definition TargetInfo.h:228
llvm::Error configure(IncrementalCompilerBuilder &CB, const Options &Opts) override
Apply execution options and configure the compiler for this backend.
Definition Wasm.cpp:72
bool supportsJIT() const override
Probe whether this backend can JIT code for the host.
Definition Wasm.h:29
llvm::Expected< llvm::Triple > getHostJITTriple() const override
Return the host triple used by this backend.
Definition Wasm.cpp:81
llvm::Expected< llvm::orc::ExecutorAddr > getSymbolAddress(llvm::StringRef Name, SymbolNameKind NameKind) const override
Definition Wasm.cpp:211
llvm::Error addModule(PartialTranslationUnit &PTU) override
Definition Wasm.cpp:112
llvm::Error runCtors() const override
Definition Wasm.cpp:199
WasmIncrementalExecutor(llvm::Error &Err)
Definition Wasm.cpp:96
llvm::Error LoadDynamicLibrary(const char *name) override
Definition Wasm.cpp:223
llvm::Error removeModule(PartialTranslationUnit &PTU) override
Definition Wasm.cpp:194
llvm::Error cleanUp() override
Definition Wasm.cpp:204
Top level wrappers for InstallAPI frontend operations.
Options passed to the backend when configuring execution.
The class keeps track of various objects created as part of processing incremental inputs.