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

Use ASTContext's printing policy, reuse the Sema variable. NFC #1175

Merged
merged 2 commits into from
Dec 17, 2024

Conversation

vgvassilev
Copy link
Owner

No description provided.

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

@@ -170,7 +170,7 @@ struct DiffRequest {
const clang::FunctionDecl* m_TopMostFD = nullptr;
clang::Sema& m_Sema;

RequestOptions& m_Options;
const RequestOptions& m_Options;
Copy link
Contributor

Choose a reason for hiding this comment

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

warning: member 'm_Options' of type 'const RequestOptions &' is a reference [cppcoreguidelines-avoid-const-or-ref-data-members]

    const RequestOptions& m_Options;
                          ^

clang::PrintingPolicy Policy(LangOpts);
Policy.Bool = true;
ASTContext &C = S.getASTContext();
clang::PrintingPolicy Policy = C.getPrintingPolicy();
Copy link
Contributor

Choose a reason for hiding this comment

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

warning: no header providing "clang::PrintingPolicy" is directly included [misc-include-cleaner]

tools/ClangPlugin.cpp:32:

+ #include <clang/AST/PrettyPrinter.h>

Copy link

codecov bot commented Dec 17, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 94.56%. Comparing base (38fd6d1) to head (0e5b0b1).
Report is 2 commits behind head on master.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1175      +/-   ##
==========================================
- Coverage   94.56%   94.56%   -0.01%     
==========================================
  Files          51       51              
  Lines        8963     8960       -3     
==========================================
- Hits         8476     8473       -3     
  Misses        487      487              
Files with missing lines Coverage Δ
include/clad/Differentiator/DiffPlanner.h 68.18% <ø> (ø)
tools/ClangPlugin.cpp 96.09% <100.00%> (-0.04%) ⬇️
Files with missing lines Coverage Δ
include/clad/Differentiator/DiffPlanner.h 68.18% <ø> (ø)
tools/ClangPlugin.cpp 96.09% <100.00%> (-0.04%) ⬇️

@vgvassilev vgvassilev merged commit 91fcf31 into master Dec 17, 2024
92 checks passed
@vgvassilev vgvassilev deleted the fix-printing-policy branch December 17, 2024 19:26
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.

1 participant