This is an archive of the discontinued LLVM Phabricator instance.

[clang][Interp] Materializing primitive temporaries
ClosedPublic

Authored by tbaeder on Oct 15 2022, 5:44 AM.

Details

Summary

Utilitze the existing support for temporary declarations to support MaterializeTemporaryExprs for primitive values.

Diff Detail

Event Timeline

tbaeder created this revision.Oct 15 2022, 5:44 AM
Herald added a project: Restricted Project. · View Herald TranscriptOct 15 2022, 5:44 AM
tbaeder requested review of this revision.Oct 15 2022, 5:44 AM
Herald added a project: Restricted Project. · View Herald TranscriptOct 15 2022, 5:44 AM
Herald added a subscriber: cfe-commits. · View Herald Transcript
shafik added inline comments.Oct 17 2022, 11:04 AM
clang/lib/AST/Interp/ByteCodeExprGen.cpp
790

What cases do we have multiple objects? Can we add failing tests for those?

827

Should this use *SubExprT instead?

clang/lib/AST/Interp/Interp.h
824

Is Name really a TypeName?

tbaeder added inline comments.Oct 18 2022, 11:33 PM
clang/lib/AST/Interp/ByteCodeExprGen.cpp
827

Ah, yes. Thanks!

clang/lib/AST/Interp/Interp.h
824

Not sure I understand the question, that's just the pattern for templating that's used for all the interp functions. Name is our PrimType and T is the underlying type we use, as defined in PrimConv.

tbaeder updated this revision to Diff 468895.Oct 19 2022, 6:47 AM
shafik added inline comments.Oct 20 2022, 4:34 PM
clang/lib/AST/Interp/Interp.h
824

I realize that this is the convention we have been using but it struck me (maybe I am wrong) that Name really is a type name and now I can't unsee it.

shafik accepted this revision.Oct 20 2022, 4:35 PM

LGTM

This revision is now accepted and ready to land.Oct 20 2022, 4:35 PM
tbaeder added inline comments.Oct 21 2022, 3:37 AM
clang/lib/AST/Interp/Interp.h
824

Name is the PrimType, so will be e.g. Sint32 in the end, T is then the integral type we use for it, e.g. Integral<32, true>.

This revision was landed with ongoing or failed builds.Feb 3 2023, 6:11 AM
This revision was automatically updated to reflect the committed changes.