This is an archive of the discontinued LLVM Phabricator instance.

[clang] Fix pretty-printing for variables declared in a for-loop condition
ClosedPublic

Authored by vaithak on Jun 24 2023, 4:15 AM.

Diff Detail

Event Timeline

vaithak created this revision.Jun 24 2023, 4:15 AM
Herald added a project: Restricted Project. · View Herald TranscriptJun 24 2023, 4:15 AM
vaithak requested review of this revision.Jun 24 2023, 4:15 AM
Herald added a project: Restricted Project. · View Herald TranscriptJun 24 2023, 4:15 AM
Herald added a subscriber: cfe-commits. · View Herald Transcript
vaithak updated this revision to Diff 534223.Jun 24 2023, 8:35 AM

rebased on the latest changes

MaskRay accepted this revision.Jun 24 2023, 10:51 AM

Thanks! Node->getConditionVariableDeclStmt() is how StmtPrinter::VisitWhileStmt prints the declaration in the condition.

https://reviews.llvm.org/D102502 added PCH/for-loop-init-ternary-operator-statement.cpp

This revision is now accepted and ready to land.Jun 24 2023, 10:51 AM
vaithak added a comment.EditedJun 24 2023, 11:52 AM

Please land this change for me as I don't have commit access. Thanks 👍
My details: "Vaibhav Thakkar" <vaibhav.thakkar.22.12.99 at gmail.com>

This revision was landed with ongoing or failed builds.Jun 25 2023, 8:28 AM
This revision was automatically updated to reflect the committed changes.