This is an archive of the discontinued LLVM Phabricator instance.

[clang][NFC] Augment CoreturnStmt
AbandonedPublic

Authored by urnathan on May 17 2022, 12:01 PM.

Details

Summary

CoreturnStmt needs to keep the operand value distinct from its use in
any return_value call, so that instantiation may rebuild the latter.
But it also needs to keep the operand value separate in the case of
calling return_void. Code generation needs the same check on the
operand value to know whether it is being evaluated in a void context
solely for side effects.

Rather than repeat the (non-trivial) test, add a flag to CoreturnStmt
indicating the void-return case. This simplifies the code generation,
making it harder to get out of sync.

Diff Detail

Event Timeline

urnathan created this revision.May 17 2022, 12:01 PM
Herald added a project: Restricted Project. · View Herald TranscriptMay 17 2022, 12:01 PM
Herald added a subscriber: StephenFan. · View Herald Transcript
urnathan requested review of this revision.May 17 2022, 12:01 PM
ChuanqiXu requested changes to this revision.May 17 2022, 7:22 PM
ChuanqiXu added a subscriber: ChuanqiXu.

This is not correct. Any change to the AST node requires change to Serialization too.

This revision now requires changes to proceed.May 17 2022, 7:22 PM
urnathan abandoned this revision.May 18 2022, 5:37 AM
MaskRay added a comment.EditedMay 18 2022, 10:13 AM

I see that a new patch with the same intent/subject has been created: D125880.
Normally the same differential should be used to keep track of all past discussions on a differential.
The "History" tab on the page allows a user to compare two patches to get insights of the evolution of the differential.
It will help archaeology for future contributors: they will be able to understand what approaches have been proven successful and what haven't.

The unwritten reusing-differential rule also applies to patch relands, e.g. D118352/D122256.