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

Fix synth literal function for enums #1113

Merged
merged 6 commits into from
Oct 12, 2024

Conversation

kchristin22
Copy link
Collaborator

Tested in PR #1111

@kchristin22 kchristin22 requested a review from vgvassilev October 8, 2024 10:15
Copy link
Contributor

github-actions bot commented Oct 8, 2024

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

Copy link

codecov bot commented Oct 8, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 94.24%. Comparing base (8ed2707) to head (b3cae4a).
Report is 4 commits behind head on master.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1113      +/-   ##
==========================================
+ Coverage   94.21%   94.24%   +0.02%     
==========================================
  Files          48       48              
  Lines        8131     8164      +33     
==========================================
+ Hits         7661     7694      +33     
  Misses        470      470              
Files with missing lines Coverage Δ
lib/Differentiator/ConstantFolder.cpp 43.13% <100.00%> (+3.55%) ⬆️

... and 4 files with indirect coverage changes

Files with missing lines Coverage Δ
lib/Differentiator/ConstantFolder.cpp 43.13% <100.00%> (+3.55%) ⬆️

... and 4 files with indirect coverage changes

@kchristin22 kchristin22 requested a review from parth-07 October 8, 2024 10:27
Copy link
Owner

@vgvassilev vgvassilev left a comment

Choose a reason for hiding this comment

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

Can we add a test for it?

Copy link
Contributor

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

Copy link
Contributor

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

Copy link
Contributor

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

Copy link
Contributor

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

Copy link
Contributor

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

Copy link
Owner

@vgvassilev vgvassilev left a comment

Choose a reason for hiding this comment

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

LGTM!

@vgvassilev vgvassilev merged commit f86eede into vgvassilev:master Oct 12, 2024
90 checks passed
Result = clad::synthesizeLiteral(
dyn_cast<EnumType>(QT)->getDecl()->getIntegerType(), C, APVal);
SourceLocation noLoc;
Expr* cast = CXXStaticCastExpr::Create(
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can we please use clang::Sema::BuildCXXNamedCast here? BuildCXXNamedCast will automatically determine the correct values for ExprValueKind, CXXCastPath, and FPOptionsOverride.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This regards the whole function and how it's implemented. For each case we create the literal manually, but we can alter that to include Sema as an arg instead of the AST context and use Sema's Build functions for all type cases. @vgvassilev what's your opinion on this?

Copy link
Owner

Choose a reason for hiding this comment

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

Yeah, that'd be annoying to update all call sites. Probably worth doing but maybe after the other PR is complete and merged?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Sounds good

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.

3 participants