================
@@ -115,31 +116,60 @@ class Interpreter {
/// An optional compiler instance for CUDA offloading
std::unique_ptr<CompilerInstance> DeviceCI;
+public:
+ struct OutOfProcessJITConfig {
+ /// Indicates whether out-of-process JIT execution is enabled.
+ bool IsOutOfProcess;
+ /// Path to the out-of-process JIT executor.
+ std::string OOPExecutor;
+ std::string OOPExecutorConnect;
+ /// Indicates whether to use shared memory for communication.
+ bool UseSharedMemory;
+ /// String representing the slab allocation size for memory management.
+ std::string SlabAllocateSizeString;
+ /// Path to the ORC runtime library.
+ std::string OrcRuntimePath;
+
+ OutOfProcessJITConfig()
+ : IsOutOfProcess(false), OOPExecutor(""), OOPExecutorConnect(""),
+ UseSharedMemory(false), SlabAllocateSizeString(""),
+ OrcRuntimePath("") {}
+ };
+
protected:
// Derived classes can use an extended interface of the Interpreter.
Interpreter(std::unique_ptr<CompilerInstance> Instance, llvm::Error &Err,
std::unique_ptr<llvm::orc::LLJITBuilder> JITBuilder = nullptr,
- std::unique_ptr<clang::ASTConsumer> Consumer = nullptr);
+ std::unique_ptr<clang::ASTConsumer> Consumer = nullptr,
+ OutOfProcessJITConfig OOPConfig = OutOfProcessJITConfig());
// Create the internal IncrementalExecutor, or re-create it after calling
// ResetExecutor().
- llvm::Error CreateExecutor();
+ llvm::Error
+ CreateExecutor(OutOfProcessJITConfig OOPConfig = OutOfProcessJITConfig());
// Delete the internal IncrementalExecutor. This causes a hard shutdown of
the
// JIT engine. In particular, it doesn't run cleanup or destructors.
void ResetExecutor();
public:
virtual ~Interpreter();
- static llvm::Expected<std::unique_ptr<Interpreter>>
- create(std::unique_ptr<CompilerInstance> CI,
- std::unique_ptr<llvm::orc::LLJITBuilder> JITBuilder = nullptr);
+ static llvm::Expected<std::unique_ptr<Interpreter>> create(
+ std::unique_ptr<CompilerInstance> CI,
+ std::optional<OutOfProcessJITConfig> OutOfProcessConfig = std::nullopt);
----------------
vgvassilev wrote:
```suggestion
JITConfig Config = {});
```
https://github.com/llvm/llvm-project/pull/155140
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits