1 //===--- IncrementalExecutor.h - Incremental Execution ----------*- C++ -*-===//
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
7 //===----------------------------------------------------------------------===//
9 // This file implements the class which performs incremental code execution.
11 //===----------------------------------------------------------------------===//
13 #ifndef LLVM_CLANG_LIB_INTERPRETER_INCREMENTALEXECUTOR_H
14 #define LLVM_CLANG_LIB_INTERPRETER_INCREMENTALEXECUTOR_H
16 #include "llvm/ADT/StringRef.h"
17 #include "llvm/ADT/Triple.h"
18 #include "llvm/ExecutionEngine/Orc/ExecutionUtils.h"
27 class ThreadSafeContext
;
32 class IncrementalExecutor
{
33 using CtorDtorIterator
= llvm::orc::CtorDtorIterator
;
34 std::unique_ptr
<llvm::orc::LLJIT
> Jit
;
35 llvm::orc::ThreadSafeContext
&TSCtx
;
38 IncrementalExecutor(llvm::orc::ThreadSafeContext
&TSC
, llvm::Error
&Err
,
39 const llvm::Triple
&Triple
);
40 ~IncrementalExecutor();
42 llvm::Error
addModule(std::unique_ptr
<llvm::Module
> M
);
43 llvm::Error
runCtors() const;
44 llvm::Expected
<llvm::JITTargetAddress
>
45 getSymbolAddress(llvm::StringRef UnmangledName
) const;
48 } // end namespace clang
50 #endif // LLVM_CLANG_LIB_INTERPRETER_INCREMENTALEXECUTOR_H