[clang-repl] Set up native platform support if ORC Runtime available - #217988
Open
khanxmetu wants to merge 2 commits into
Open
[clang-repl] Set up native platform support if ORC Runtime available#217988khanxmetu wants to merge 2 commits into
khanxmetu wants to merge 2 commits into
Conversation
Contributor
Author
|
Further to this, I think its worth removing |
|
@llvm/pr-subscribers-clang Author: khanxmetu (khanxmetu) ChangesPreviously, only out-of-process execution used the native platform/ Fixes #213425 Full diff: https://github.com/llvm/llvm-project/pull/217988.diff 1 Files Affected:
diff --git a/clang/lib/Interpreter/IncrementalExecutor.cpp b/clang/lib/Interpreter/IncrementalExecutor.cpp
index 6d337e7848699..1a63e8a0e1817 100644
--- a/clang/lib/Interpreter/IncrementalExecutor.cpp
+++ b/clang/lib/Interpreter/IncrementalExecutor.cpp
@@ -413,6 +413,16 @@ IncrementalExecutorBuilder::create(llvm::orc::ThreadSafeContext &TSC,
if (!JB)
return JB.takeError();
JITBuilder = std::move(*JB);
+ if (!OrcRuntimePath.empty()) {
+ JITBuilder->setPlatformSetUp(
+ llvm::orc::ExecutorNativePlatform(OrcRuntimePath));
+ } else {
+ auto Err = llvm::make_error<llvm::StringError>(
+ "OrcRuntime not found, running JIT without native platform support "
+ "and some features may not work.",
+ std::error_code());
+ llvm::logAllUnhandledErrors(std::move(Err), llvm::errs(), "warning: ");
+ }
// TODO: Switch to native TLS once clang-repl can adopt the ORC runtime
// (which provides __emutls_get_address and supports the full TLS
// lifecycle). That will also remove the in-process-only constraint below.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Previously, only out-of-process execution used the native platform/
ORCPlatformSupportwhile in-process usedGenericLLVMIRPlatformSupport. This change also attempts to use native platform support for in-process execution when the ORC Runtime is available or displays a warning otherwise.Fixes #213425