This is an archive of the discontinued LLVM Phabricator instance.

[clang][DeclPrinter] Pass Context into StmtPrinter whenever possible
ClosedPublic

Authored by kadircet on Feb 19 2021, 4:17 AM.

Details

Summary

ASTContext were only passed to the StmtPrinter in some places, while it
is always available in DeclPrinter. The context is used by StmtPrinter to better
print statements in some cases, like printing constants as written.

Diff Detail

Event Timeline

kadircet created this revision.Feb 19 2021, 4:17 AM
kadircet requested review of this revision.Feb 19 2021, 4:17 AM
Herald added a project: Restricted Project. · View Herald TranscriptFeb 19 2021, 4:17 AM
Herald added a subscriber: cfe-commits. · View Herald Transcript
kadircet added inline comments.Feb 19 2021, 4:18 AM
clang-tools-extra/clangd/unittests/HoverTests.cpp
526

not sure if this is a regression or not, as in theory we print the definition as written.

sammccall accepted this revision.Feb 22 2021, 1:19 PM
sammccall added inline comments.
clang-tools-extra/clangd/unittests/HoverTests.cpp
526

this looks fine to me.

This revision is now accepted and ready to land.Feb 22 2021, 1:19 PM
This revision was landed with ongoing or failed builds.Feb 23 2021, 12:42 AM
This revision was automatically updated to reflect the committed changes.