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

Add LLVM17 support. #675

Merged
merged 3 commits into from
Dec 29, 2023
Merged

Add LLVM17 support. #675

merged 3 commits into from
Dec 29, 2023

Conversation

vgvassilev
Copy link
Owner

Fixes #669

Copy link

codecov bot commented Dec 8, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (6a42b46) 94.37% compared to head (969d108) 94.39%.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #675      +/-   ##
==========================================
+ Coverage   94.37%   94.39%   +0.01%     
==========================================
  Files          48       48              
  Lines        7062     7087      +25     
==========================================
+ Hits         6665     6690      +25     
  Misses        397      397              
Files Coverage Δ
include/clad/Differentiator/ReverseModeVisitor.h 97.67% <100.00%> (ø)
include/clad/Differentiator/VisitorBase.h 100.00% <100.00%> (ø)
lib/Differentiator/BaseForwardModeVisitor.cpp 98.84% <100.00%> (+<0.01%) ⬆️
lib/Differentiator/HessianModeVisitor.cpp 99.47% <100.00%> (+<0.01%) ⬆️
lib/Differentiator/ReverseModeForwPassVisitor.cpp 100.00% <100.00%> (ø)
lib/Differentiator/ReverseModeVisitor.cpp 95.72% <100.00%> (+<0.01%) ⬆️
lib/Differentiator/VectorForwardModeVisitor.cpp 100.00% <100.00%> (ø)
lib/Differentiator/VisitorBase.cpp 97.94% <100.00%> (+0.13%) ⬆️
Files Coverage Δ
include/clad/Differentiator/ReverseModeVisitor.h 97.67% <100.00%> (ø)
include/clad/Differentiator/VisitorBase.h 100.00% <100.00%> (ø)
lib/Differentiator/BaseForwardModeVisitor.cpp 98.84% <100.00%> (+<0.01%) ⬆️
lib/Differentiator/HessianModeVisitor.cpp 99.47% <100.00%> (+<0.01%) ⬆️
lib/Differentiator/ReverseModeForwPassVisitor.cpp 100.00% <100.00%> (ø)
lib/Differentiator/ReverseModeVisitor.cpp 95.72% <100.00%> (+<0.01%) ⬆️
lib/Differentiator/VectorForwardModeVisitor.cpp 100.00% <100.00%> (ø)
lib/Differentiator/VisitorBase.cpp 97.94% <100.00%> (+0.13%) ⬆️

@@ -378,7 +378,7 @@ double fn10_darg0(double x, size_t n);
// CHECK-NEXT: {
// CHECK-NEXT: size_t _d_count = 0;
// CHECK-NEXT: size_t _d_max_count = _d_n;
// CHECK-NEXT: for (size_t count = 0; max_count; ++count) {
// CHECK-NEXT: for (size_t count = 0; size_t max_count = n; ++count) {
Copy link
Owner Author

Choose a reason for hiding this comment

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

@PetroZarytskyi, can you take a look at this change - I believe it was broken before that patch...

Copy link
Collaborator

Choose a reason for hiding this comment

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

@vgvassilev Yes. I think this was a bug in clang with dumping for-loop condition inits. It had to do with the fact that technically in such cases the condition is max_count and size_t max_count = n is the condition init.

Copy link
Owner Author

Choose a reason for hiding this comment

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

Ok, I've fixed it by making it conditional in the test...

Copy link
Contributor

@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

include/clad/Differentiator/VisitorBase.h Show resolved Hide resolved
include/clad/Differentiator/VisitorBase.h Show resolved Hide resolved
include/clad/Differentiator/VisitorBase.h Show resolved Hide resolved
lib/Differentiator/VisitorBase.cpp Outdated Show resolved Hide resolved
lib/Differentiator/VisitorBase.cpp Show resolved Hide resolved
lib/Differentiator/VisitorBase.cpp Show resolved Hide resolved
This patch replaces the artificial handling of the scopes and accesses the
private CurScope member of Sema. This allows us to build precise lexical scope
setup for when building AST nodes. That's essential for lambda support in
clang17 because it tightly couples both Scopes and DeclContexts.

The change in test/FirstDerivative/Loops.C is because the pretty printer did not
print correctly the variables defined in the condition of the loop until clang17.

Fixes #669
Copy link
Contributor

clang-tidy review says "All clean, LGTM! 👍"

Copy link
Contributor

clang-tidy review says "All clean, LGTM! 👍"

@vgvassilev vgvassilev merged commit 1921b56 into master Dec 29, 2023
78 checks passed
@vgvassilev vgvassilev deleted the add-clang-17 branch January 2, 2024 09:40
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.

Add support for clang17
3 participants