This is an archive of the discontinued LLVM Phabricator instance.

[clang][Interp] Remove args from called functions in more cases
ClosedPublic

Authored by tbaeder on May 11 2023, 5:28 AM.

Details

Summary
When calling functions in the checkingPotentialConstantExpression mode,
we cannot have arguments (including This + RVO pointers) for the
toplevel callee, but the functions called from within can work just
fine, or at least we succeed in pushing their arguments on the stack, so
we must also succeed in removing them again.

Diff Detail

Event Timeline

tbaeder created this revision.May 11 2023, 5:28 AM
Herald added a project: Restricted Project. · View Herald TranscriptMay 11 2023, 5:28 AM
tbaeder requested review of this revision.May 11 2023, 5:28 AM
Herald added a project: Restricted Project. · View Herald TranscriptMay 11 2023, 5:28 AM
Herald added a subscriber: cfe-commits. · View Herald Transcript
aaron.ballman accepted this revision.Jun 9 2023, 7:06 AM

LGTM

clang/test/AST/Interp/functions.cpp
262
This revision is now accepted and ready to land.Jun 9 2023, 7:06 AM
tbaeder added a subscriber: MaskRay.Jun 9 2023, 8:17 AM
tbaeder added inline comments.
clang/test/AST/Interp/functions.cpp
262

Question regarding this: IIRC it was @MaskRay who once told me to use /// comments for everything that's not a RUN or expected line. If you look further up, I think I stuck to that (mostly). Should I continue doing that or not?

aaron.ballman added inline comments.Jun 13 2023, 7:36 AM
clang/test/AST/Interp/functions.cpp
262

Oh yeah, you did mostly stick to that; then ignore my suggestion. However, we have no policy regarding // vs /// vs /**/, so it's pretty much a case-by-case basis, but in general we use // for all comments unless there's a specific reason not to.

This revision was landed with ongoing or failed builds.Jul 25 2023, 11:51 PM
This revision was automatically updated to reflect the committed changes.