This is an archive of the discontinued LLVM Phabricator instance.

[clang][Parser][NFC] Simplify ParseParenExprOrCondition
ClosedPublic

Authored by tbaeder on Nov 17 2022, 3:18 AM.

Details

Summary

All call-sites of this function pass false for MissingOK, so remove the parameter. Also, all call-sites pass both LParenLoc and RParenLoc, so replace the conditional store with an assertion for both of them.

Diff Detail

Event Timeline

tbaeder created this revision.Nov 17 2022, 3:18 AM
Herald added a project: Restricted Project. · View Herald TranscriptNov 17 2022, 3:18 AM
tbaeder requested review of this revision.Nov 17 2022, 3:18 AM
Herald added a project: Restricted Project. · View Herald TranscriptNov 17 2022, 3:18 AM
Herald added a subscriber: cfe-commits. · View Herald Transcript
tbaeder edited the summary of this revision. (Show Details)Nov 17 2022, 3:20 AM
aaron.ballman accepted this revision.Nov 17 2022, 5:47 AM
aaron.ballman added a subscriber: aaron.ballman.

LGTM with a minor improvement.

clang/lib/Parse/ParseStmt.cpp
1275–1281

We can do better than an assert.

This revision is now accepted and ready to land.Nov 17 2022, 5:47 AM
tbaeder marked an inline comment as done.Nov 17 2022, 6:59 AM
This revision was landed with ongoing or failed builds.Nov 17 2022, 8:01 PM
This revision was automatically updated to reflect the committed changes.
shafik added a subscriber: shafik.Nov 28 2022, 5:22 PM
shafik added inline comments.
clang/lib/Parse/ParseStmt.cpp
1286

Nitpick edit for adding bugprone-argument-comment annotation.