This is an archive of the discontinued LLVM Phabricator instance.

[clang][NFC] Augment CoreturnStmt
Needs ReviewPublic

Authored by urnathan on May 18 2022, 5:36 AM.

Details

Reviewers
iains
MaskRay
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 18 2022, 5:36 AM
Herald added a project: Restricted Project. · View Herald TranscriptMay 18 2022, 5:36 AM
Herald added a subscriber: StephenFan. · View Herald Transcript
urnathan requested review of this revision.May 18 2022, 5:36 AM