Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable CppInterOp #16814

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from
Draft

Enable CppInterOp #16814

wants to merge 2 commits into from

Conversation

aaronj0
Copy link
Contributor

@aaronj0 aaronj0 commented Nov 4, 2024

CppInterOp exposes API from Clang and LLVM in a mostly backward compatibe way. The API support downstream tools that utilize interactive C++ by using the compiler as a service.

This PR is the first step in using pure clang based reflection API in meta, and part of eventually integrating the JITCall and DynamicLibraryManager infrastructure.

Adopting more of CppInterOp in ROOT will help simplify the LLVM migration process and allow us to upstream more patches to either CppInterOp or LLVM.

[CppInterOp](https://github.com/compiler-research/CppInterOp) exposes API from
Clang and LLVM in a mostly backward compatibe way. The API support downstream
tools that utilize interactive C++ by using the compiler as a service.

Adopting more of CppInterOp in ROOT will help simplify the LLVM migration
process and allow us to upstream more patches to either CppInterOp or LLVM.
@aaronj0 aaronj0 changed the title Enable interop Enable CppInterOp Nov 4, 2024
This uses provides InterOp with the TInterpreter instance created by ROOT in TCling.
The InterOp API can now be used without providing interpreter ownership.
Copy link

github-actions bot commented Nov 4, 2024

Test Results

     5 files       5 suites   19h 57m 10s ⏱️
 2 642 tests  2 635 ✅   2 💤  5 ❌
12 560 runs  12 263 ✅ 282 💤 15 ❌

For more details on these failures, see this check.

Results for commit 2d038e7.

Copy link
Member

@hahnjo hahnjo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The direction looks good to me! In addition to the test failures that need fixing, some comments inline for consideration

Comment on lines 78 to 79
add_dependencies(MetaCling CLING clangCppInterOp)
# target_include_directories(MetaCling SYSTEM PUBLIC ${source_dir}/include/)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you move these modifications to the next commit, where CppInterOp is used?

Comment on lines +609 to +611
set(LLVM_DIR "${CMAKE_BINARY_DIR}/interpreter/llvm-project/llvm/lib/cmake/llvm")
set(Clang_DIR "${CMAKE_BINARY_DIR}/interpreter/llvm-project/llvm/tools/clang/lib/cmake/clang")
set(Cling_DIR "${CMAKE_BINARY_DIR}/interpreter/cling")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will need adapting for externally built LLVM, Clang, and / or Cling. For LLVM and Clang, I believe this should already be taken care of above, no?

@@ -0,0 +1,372 @@
<div align="center">

# CppInterOp
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As discussed offline, we probably want a similar workflow as .github/workflows/llvm-diff.yml to make sure our copies are not diverging

Comment on lines +70 to +71
#include "clang/Interpreter/CppInterOp.h"

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not needed yet

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants