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

Library autoloader #308

Open
wants to merge 13 commits into
base: main
Choose a base branch
from

Conversation

alexander-penev
Copy link
Collaborator

No description provided.

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

clang-tidy made some suggestions

There were too many comments to post at once. Showing the first 10 out of 12. Check the log or trigger a new build to see more.

lib/Interpreter/CppInterOp.cpp Outdated Show resolved Hide resolved
lib/Interpreter/CppInterOp.cpp Outdated Show resolved Hide resolved
lib/Interpreter/CppInterOp.cpp Outdated Show resolved Hide resolved
lib/Interpreter/CppInterOp.cpp Show resolved Hide resolved
lib/Interpreter/CppInterOp.cpp Outdated Show resolved Hide resolved
lib/Interpreter/CppInterOp.cpp Outdated Show resolved Hide resolved
lib/Interpreter/CppInterOp.cpp Outdated Show resolved Hide resolved
lib/Interpreter/CppInterOp.cpp Outdated Show resolved Hide resolved
lib/Interpreter/CppInterOp.cpp Outdated Show resolved Hide resolved
lib/Interpreter/CppInterOp.cpp Outdated Show resolved Hide resolved
Copy link

codecov bot commented Jul 10, 2024

Codecov Report

Attention: Patch coverage is 82.75862% with 15 lines in your changes missing coverage. Please review.

Project coverage is 74.30%. Comparing base (e0fa91e) to head (6cfe873).

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #308      +/-   ##
==========================================
+ Coverage   72.22%   74.30%   +2.07%     
==========================================
  Files           8        8              
  Lines        2963     3043      +80     
==========================================
+ Hits         2140     2261     +121     
+ Misses        823      782      -41     
Files Coverage Δ
include/clang/Interpreter/CppInterOp.h 96.00% <ø> (ø)
lib/Interpreter/DynamicLibraryManagerSymbol.cpp 74.56% <ø> (+6.91%) ⬆️
lib/Interpreter/DynamicLibraryManager.cpp 77.77% <60.00%> (+5.40%) ⬆️
lib/Interpreter/CppInterOp.cpp 78.79% <84.14%> (+0.26%) ⬆️

... and 2 files with indirect coverage changes

Files Coverage Δ
include/clang/Interpreter/CppInterOp.h 96.00% <ø> (ø)
lib/Interpreter/DynamicLibraryManagerSymbol.cpp 74.56% <ø> (+6.91%) ⬆️
lib/Interpreter/DynamicLibraryManager.cpp 77.77% <60.00%> (+5.40%) ⬆️
lib/Interpreter/CppInterOp.cpp 78.79% <84.14%> (+0.26%) ⬆️

... and 2 files with indirect coverage changes

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

clang-tidy made some suggestions

lib/Interpreter/CppInterOp.cpp Outdated Show resolved Hide resolved
lib/Interpreter/CppInterOp.cpp Outdated Show resolved Hide resolved
lib/Interpreter/CppInterOp.cpp Show resolved Hide resolved
lib/Interpreter/CppInterOp.cpp Outdated Show resolved Hide resolved
lib/Interpreter/CppInterOp.cpp Outdated Show resolved Hide resolved
lib/Interpreter/DynamicLibraryManager.cpp Outdated Show resolved Hide resolved
Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

clang-tidy made some suggestions

lib/Interpreter/CppInterOp.cpp Outdated Show resolved Hide resolved
Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

clang-tidy made some suggestions

There were too many comments to post at once. Showing the first 10 out of 14. Check the log or trigger a new build to see more.

lib/Interpreter/CppInterOp.cpp Show resolved Hide resolved
lib/Interpreter/CppInterOp.cpp Show resolved Hide resolved
lib/Interpreter/CppInterOp.cpp Show resolved Hide resolved
lib/Interpreter/CppInterOp.cpp Show resolved Hide resolved
lib/Interpreter/CppInterOp.cpp Show resolved Hide resolved
unittests/CppInterOp/DynamicLibraryManagerTest.cpp Outdated Show resolved Hide resolved
unittests/CppInterOp/DynamicLibraryManagerTest.cpp Outdated Show resolved Hide resolved
include/clang/Interpreter/CppInterOp.h Outdated Show resolved Hide resolved
lib/Interpreter/CppInterOp.cpp Outdated Show resolved Hide resolved
lib/Interpreter/CppInterOp.cpp Outdated Show resolved Hide resolved
lib/Interpreter/DynamicLibraryManagerSymbol.cpp Outdated Show resolved Hide resolved
unittests/CppInterOp/CMakeLists.txt Show resolved Hide resolved
return nameForDlsym;
}

#include "../../lib/Interpreter/CppInterOp.cpp"
Copy link
Contributor

Choose a reason for hiding this comment

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

We probably should drop this.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

We use from it functions that are not visible through the .h file ie. should be available only for the tests.

Copy link
Contributor

Choose a reason for hiding this comment

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

Okay, fair enough...

unittests/CppInterOp/DynamicLibraryManagerTest.cpp Outdated Show resolved Hide resolved
unittests/CppInterOp/TestSharedLib1/CMakeLists.txt Outdated Show resolved Hide resolved
Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

clang-tidy made some suggestions

unittests/CppInterOp/DynamicLibraryManagerTest.cpp Outdated Show resolved Hide resolved
unittests/CppInterOp/DynamicLibraryManagerTest.cpp Outdated Show resolved Hide resolved
unittests/CppInterOp/DynamicLibraryManagerTest.cpp Outdated Show resolved Hide resolved
unittests/CppInterOp/DynamicLibraryManagerTest.cpp Outdated Show resolved Hide resolved
unittests/CppInterOp/TestSharedLib3/TestSharedLib3.h Outdated Show resolved Hide resolved
Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

clang-tidy made some suggestions

There were too many comments to post at once. Showing the first 10 out of 18. Check the log or trigger a new build to see more.

lib/Interpreter/CppInterOp.cpp Show resolved Hide resolved
lib/Interpreter/CppInterOp.cpp Show resolved Hide resolved
lib/Interpreter/CppInterOp.cpp Show resolved Hide resolved
lib/Interpreter/CppInterOp.cpp Show resolved Hide resolved
lib/Interpreter/CppInterOp.cpp Show resolved Hide resolved
lib/Interpreter/CppInterOp.cpp Show resolved Hide resolved
lib/Interpreter/CppInterOp.cpp Show resolved Hide resolved
lib/Interpreter/CppInterOp.cpp Show resolved Hide resolved
lib/Interpreter/CppInterOp.cpp Show resolved Hide resolved
lib/Interpreter/CppInterOp.cpp Show resolved Hide resolved
Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

clang-tidy made some suggestions

lib/Interpreter/CppInterOp.cpp Show resolved Hide resolved
lib/Interpreter/CppInterOp.cpp Show resolved Hide resolved
lib/Interpreter/CppInterOp.cpp Show resolved Hide resolved
lib/Interpreter/CppInterOp.cpp Show resolved Hide resolved
lib/Interpreter/CppInterOp.cpp Show resolved Hide resolved
lib/Interpreter/CppInterOp.cpp Show resolved Hide resolved
lib/Interpreter/CppInterOp.cpp Show resolved Hide resolved
lib/Interpreter/CppInterOp.cpp Show resolved Hide resolved
@lhames
Copy link

lhames commented Aug 2, 2024

A couple of quick thoughts for future upstreaming: we'd want to make this compatible with out-of-process execution, and it'd be great if we could re-use parts of it for MachO auto-linking.

We should consider whether SimpleExecutorDylibManager can be extended to handle all this.

@vgvassilev
Copy link
Contributor

A couple of quick thoughts for future upstreaming: we'd want to make this compatible with out-of-process execution, and it'd be great if we could re-use parts of it for MachO auto-linking.

Thanks for the feedback, @lhames. That makes sense.

We should consider whether SimpleExecutorDylibManager can be extended to handle all this.

I was not aware such a thing existed. @SahilPatidar perhaps that's interesting in terms of your project, too.

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

clang-tidy made some suggestions

lib/Interpreter/CppInterOp.cpp Show resolved Hide resolved
lib/Interpreter/CppInterOp.cpp Show resolved Hide resolved
lib/Interpreter/CppInterOp.cpp Show resolved Hide resolved
Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

clang-tidy made some suggestions

}

void setEnabled(bool enabled) {
Enabled = enabled;

Choose a reason for hiding this comment

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

warning: method 'isEnabled' can be made const [readability-make-member-function-const]

Suggested change
Enabled = enabled;
bool isEnabled() const {

}

void materialize(std::unique_ptr<llvm::orc::MaterializationResponsibility> R) override {
if (!sAutoSG || !sAutoSG->isEnabled()) {

Choose a reason for hiding this comment

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

warning: function 'getName' should be marked [[nodiscard]] [modernize-use-nodiscard]

Suggested change
if (!sAutoSG || !sAutoSG->isEnabled()) {
[[nodiscard]] StringRef getName() const override {

@vgvassilev
Copy link
Contributor

@aaronj0, do you have a clue why cppyy fails?

@aaronj0
Copy link
Collaborator

aaronj0 commented Sep 20, 2024

@aaronj0, do you have a clue why cppyy fails?

cppyy does not fail, InterOp does not build on any of the jobs. This comes back to the point that CppInterOp is only built on the jobs tagged with "cppyy" not the first stage that only builds llvm.

On a preliminary look, it seems like on llvm19 we get:

error: no matching function for call to ‘llvm::orc::MaterializationResponsibility::notifyEmitted()’
 3470 |           llvm::cantFail(R->notifyEmitted());

and on 18 and 17, these "undefined reference to typeinfo for llvm::orc::DefinitionGenerator"

They also fail in some of the emscripten builds but I am more interested in the fact that they pass on llvm 17 and 18 with clang-repl on all platforms

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.

4 participants