This is an archive of the discontinued LLVM Phabricator instance.

[clang-repl] Support orc runtime and use it to enhance support of x86_64-windows-msvc target.
Needs ReviewPublic

Authored by sunho on Sep 25 2022, 2:35 PM.

Details

Summary

Support orc runtime and use it to enhance support of x86_64-windows-msvc target.

Diff Detail

Event Timeline

sunho created this revision.Sep 25 2022, 2:35 PM
Herald added a project: Restricted Project. · View Herald TranscriptSep 25 2022, 2:35 PM
Herald added a subscriber: pengfei. · View Herald Transcript
sunho requested review of this revision.Sep 25 2022, 2:35 PM
sunho added reviewers: v.g.vassilev, lhames, sgraenitz.
v.g.vassilev added inline comments.Sep 25 2022, 2:41 PM
clang/tools/clang-repl/ClangRepl.cpp
119

Do we want to sink this in clang::Interpreter::create. This way other users would just use it straight out of the box? Maybe we can add a default argument useOrcRuntimeIfSupported = true in case things are not yet very stable.

glevner added inline comments.Sep 30 2022, 1:46 AM
clang/lib/Interpreter/IncrementalExecutor.cpp
63–72

This code will never be executed. Or am I missing something?

sgraenitz added inline comments.Oct 7 2022, 9:38 AM
clang/lib/Interpreter/IncrementalExecutor.cpp
63–72

That's definitely a non-obvious one. The lambda ends up in the builder states' CreateObjectLinkingLayer member and gets called from LLJIT: https://github.com/llvm/llvm-project/blob/release/15.x/llvm/lib/ExecutionEngine/Orc/LLJIT.cpp#L736

What's interesting is the EPC capture: In fact, it's a pointer so we wouldn't want the &. However, instead of capturing EPC, it might be easier to just obtain it inside the lambda via ES->getExecutorProcessControl().