================
@@ -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: ");
----------------
lhames wrote:
This is an error that's immediately consumed by an output statement, which
isn't usually what you want.
There's some policy that we'd need to settle to decide this:
1. Is the ORC runtime expected, or optional?
2. If it's expected, is absence an error that can be manually overridden, or
just a warning with an automatic fallback to the generic IR platform?
@vgvassilev -- any thoughts?
My assumption is that, for now at least, ORC runtime use in clang-repl is
optional, and this should just be a log message.
In the future I'd argue that it should be expected-but-overridable, so you'd
pass in two things: a flag (either "RequireRuntime", "MissingRuntimeOk",
"DontUseRuntime") and a diagnostic stream. Then the API client has direct
control over the mode, and a feedback path for a user facing diagnostic.
E.g.
`"error: ORC runtime not found"` if the runtime is missing and the mode is
`RequireRuntime`.
or
`"running in [native | generic-ir] mode"` if the mode is `MissingRuntimeOk`.
https://github.com/llvm/llvm-project/pull/217988
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits