clang  15.0.0git
IncrementalExecutor.h
Go to the documentation of this file.
1 //===--- IncrementalExecutor.h - Incremental Execution ----------*- 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 the class which performs incremental code execution.
10 //
11 //===----------------------------------------------------------------------===//
12 
13 #ifndef LLVM_CLANG_LIB_INTERPRETER_INCREMENTALEXECUTOR_H
14 #define LLVM_CLANG_LIB_INTERPRETER_INCREMENTALEXECUTOR_H
15 
16 #include "llvm/ADT/StringRef.h"
17 #include "llvm/ADT/Triple.h"
18 #include "llvm/ExecutionEngine/Orc/ExecutionUtils.h"
19 
20 #include <memory>
21 
22 namespace llvm {
23 class Error;
24 class Module;
25 namespace orc {
26 class LLJIT;
27 class ThreadSafeContext;
28 } // namespace orc
29 } // namespace llvm
30 
31 namespace clang {
33  using CtorDtorIterator = llvm::orc::CtorDtorIterator;
34  std::unique_ptr<llvm::orc::LLJIT> Jit;
35  llvm::orc::ThreadSafeContext &TSCtx;
36 
37 public:
39 
40  IncrementalExecutor(llvm::orc::ThreadSafeContext &TSC, llvm::Error &Err,
41  const llvm::Triple &Triple);
43 
44  llvm::Error addModule(std::unique_ptr<llvm::Module> M);
45  llvm::Error runCtors() const;
47  getSymbolAddress(llvm::StringRef Name, SymbolNameKind NameKind) const;
48  llvm::orc::LLJIT *getExecutionEngine() const { return Jit.get(); }
49 };
50 
51 } // end namespace clang
52 
53 #endif // LLVM_CLANG_LIB_INTERPRETER_INCREMENTALEXECUTOR_H
llvm
YAML serialization mapping.
Definition: Dominators.h:30
Error
llvm::Error Error
Definition: ByteCodeEmitter.cpp:20
clang::IncrementalExecutor::SymbolNameKind
SymbolNameKind
Definition: IncrementalExecutor.h:38
llvm::Expected
Definition: LLVM.h:41
clang::IncrementalExecutor::IRName
@ IRName
Definition: IncrementalExecutor.h:38
clang::index::SymbolKind::Module
@ Module
clang::IncrementalExecutor::~IncrementalExecutor
~IncrementalExecutor()
Definition: IncrementalExecutor.cpp:53
clang::IncrementalExecutor
Definition: IncrementalExecutor.h:32
clang::IncrementalExecutor::addModule
llvm::Error addModule(std::unique_ptr< llvm::Module > M)
Definition: IncrementalExecutor.cpp:55
clang::IncrementalExecutor::LinkerName
@ LinkerName
Definition: IncrementalExecutor.h:38
clang::IncrementalExecutor::runCtors
llvm::Error runCtors() const
Definition: IncrementalExecutor.cpp:59
clang::IncrementalExecutor::IncrementalExecutor
IncrementalExecutor(llvm::orc::ThreadSafeContext &TSC, llvm::Error &Err, const llvm::Triple &Triple)
Definition: IncrementalExecutor.cpp:28
clang
Definition: CalledOnceCheck.h:17
clang::IncrementalExecutor::getSymbolAddress
llvm::Expected< llvm::JITTargetAddress > getSymbolAddress(llvm::StringRef Name, SymbolNameKind NameKind) const
Definition: IncrementalExecutor.cpp:64
clang::IncrementalExecutor::getExecutionEngine
llvm::orc::LLJIT * getExecutionEngine() const
Definition: IncrementalExecutor.h:48