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

Provide a backup plan if we fail to delay the handling of declarations. #877

Merged
merged 1 commit into from
May 8, 2024

Conversation

vgvassilev
Copy link
Owner

This patch enhances the work done in #766 where we assumed the clients are going to be well-behaved such as clang or clang-repl. However, we can have clients which connect the clang components in a non-standard way and we should provide a reasonable fallback.

This patch detects if the setup is non-standard and teaches clad to handle requests as they come, pretty much the same way as before #766 was implemented. Of course this comes with a cost when we try to differentiate declarations that are defined later in the translation unit. We expect such setups to be rare and mostly in the cases of incremental processing and old repls such as Cling.

Depends on #876.

@vgvassilev vgvassilev added this to the v1.5 milestone May 4, 2024
@vgvassilev vgvassilev requested a review from vaithak May 4, 2024 19:42
Copy link

codecov bot commented May 4, 2024

Codecov Report

Attention: Patch coverage is 66.66667% with 4 lines in your changes are missing coverage. Please review.

Project coverage is 94.77%. Comparing base (3f0e5a1) to head (ebe60e0).

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #877      +/-   ##
==========================================
- Coverage   94.82%   94.77%   -0.05%     
==========================================
  Files          52       52              
  Lines        7703     7714      +11     
==========================================
+ Hits         7304     7311       +7     
- Misses        399      403       +4     
Files Coverage Δ
tools/ClangPlugin.cpp 95.48% <80.00%> (-0.27%) ⬇️
tools/ClangPlugin.h 91.97% <57.14%> (-1.88%) ⬇️
Files Coverage Δ
tools/ClangPlugin.cpp 95.48% <80.00%> (-0.27%) ⬇️
tools/ClangPlugin.h 91.97% <57.14%> (-1.88%) ⬇️

Copy link
Contributor

github-actions bot commented May 4, 2024

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

@vgvassilev vgvassilev requested a review from parth-07 May 5, 2024 06:08
@vgvassilev vgvassilev force-pushed the non-standard-repls branch from 13f0e86 to c529893 Compare May 5, 2024 12:21
Copy link
Contributor

github-actions bot commented May 5, 2024

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

@vgvassilev
Copy link
Owner Author

I am not sure if we can test this patch - it will need to have either cling or some sort of cling-like infrastructure which is probably not worth maintaining in a long run.

// We could not delay the process due to some strange way of
// initialization, inform the consumers now.
if (!m_Multiplexer)
m_CI.getASTConsumer().HandleTopLevelDecl(DCI.m_DGR);
Copy link
Collaborator

Choose a reason for hiding this comment

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

If we are not delaying the call, do we still want to add it to AppendDelayed?

Copy link
Owner Author

Choose a reason for hiding this comment

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

I’d think so. That’d give us some uniform debugging capabilities for both cases….

This patch enhances the work done in #766 where we assumed the clients are going
to be well-behaved such as clang or clang-repl. However, we can have clients
which connect the clang components in a non-standard way and we should provide a
reasonable fallback.

This patch detects if the setup is non-standard and teaches clad to handle
requests as they come, pretty much the same way as before #766 was implemented.
Of course this comes with a cost when we try to differentiate declarations that
are defined later in the translation unit. We expect such setups to be rare and
mostly in the cases of incremental processing and old repls such as Cling.
@vgvassilev vgvassilev force-pushed the non-standard-repls branch from c529893 to ebe60e0 Compare May 8, 2024 14:41
Copy link
Contributor

github-actions bot commented May 8, 2024

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

@vgvassilev vgvassilev merged commit 69a2d0c into master May 8, 2024
87 of 89 checks passed
@vgvassilev vgvassilev deleted the non-standard-repls branch May 8, 2024 16:20
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