[PATCH] D135750: [clang][Interp] Track initialization state of local variables

2023-01-18 Thread Timm Bäder via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG865094746e2a: [clang][Interp] Track initialization state of local variables (authored by tbaeder). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D135750/new/

[PATCH] D135750: [clang][Interp] Track initialization state of local variables

2023-01-18 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman accepted this revision. aaron.ballman added a comment. LGTM! Comment at: clang/lib/AST/Interp/Pointer.h:63-64 private: static constexpr unsigned PastEndMark = (unsigned)-1; static constexpr unsigned RootPtrMark = (unsigned)-1; aaron.ballm

[PATCH] D135750: [clang][Interp] Track initialization state of local variables

2023-01-16 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder updated this revision to Diff 489693. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D135750/new/ https://reviews.llvm.org/D135750 Files: clang/lib/AST/Interp/ByteCodeExprGen.cpp clang/lib/AST/Interp/ByteCodeStmtGen.cpp clang/lib/AST/Interp/Context.cpp clang/lib/AST/Interp/

[PATCH] D135750: [clang][Interp] Track initialization state of local variables

2023-01-13 Thread Shafik Yaghmour via Phabricator via cfe-commits
shafik accepted this revision. shafik added a comment. This revision is now accepted and ready to land. LGTM @aaron.ballman are you happy with this? CHANGES SINCE LAST ACTION https://reviews.llvm.org/D135750/new/ https://reviews.llvm.org/D135750 _

[PATCH] D135750: [clang][Interp] Track initialization state of local variables

2023-01-13 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder updated this revision to Diff 488996. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D135750/new/ https://reviews.llvm.org/D135750 Files: clang/lib/AST/Interp/ByteCodeExprGen.cpp clang/lib/AST/Interp/ByteCodeStmtGen.cpp clang/lib/AST/Interp/Context.cpp clang/lib/AST/Interp/

[PATCH] D135750: [clang][Interp] Track initialization state of local variables

2023-01-13 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder added a comment. Ping CHANGES SINCE LAST ACTION https://reviews.llvm.org/D135750/new/ https://reviews.llvm.org/D135750 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D135750: [clang][Interp] Track initialization state of local variables

2023-01-06 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder added a comment. Ping CHANGES SINCE LAST ACTION https://reviews.llvm.org/D135750/new/ https://reviews.llvm.org/D135750 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D135750: [clang][Interp] Track initialization state of local variables

2022-12-26 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder updated this revision to Diff 485271. tbaeder added a comment. Add missing inline descriptor handling to local variables created in the EvalEmitter. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D135750/new/ https://reviews.llvm.org/D135750 Files: clang/lib/AST/Interp/ByteCod

[PATCH] D135750: [clang][Interp] Track initialization state of local variables

2022-12-22 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder added inline comments. Comment at: clang/lib/AST/Interp/Interp.h:918 return false; + if (!Ptr.isRoot()) +Ptr.initialize(); shafik wrote: > tbaeder wrote: > > shafik wrote: > > > Can you explain what is going on here? Why do we need to initialize

[PATCH] D135750: [clang][Interp] Track initialization state of local variables

2022-12-21 Thread Shafik Yaghmour via Phabricator via cfe-commits
shafik added inline comments. Comment at: clang/lib/AST/Interp/Interp.h:918 return false; + if (!Ptr.isRoot()) +Ptr.initialize(); tbaeder wrote: > shafik wrote: > > Can you explain what is going on here? Why do we need to initialize if it > > is not ro

[PATCH] D135750: [clang][Interp] Track initialization state of local variables

2022-12-21 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder updated this revision to Diff 484499. tbaeder marked 2 inline comments as done. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D135750/new/ https://reviews.llvm.org/D135750 Files: clang/lib/AST/Interp/ByteCodeExprGen.cpp clang/lib/AST/Interp/ByteCodeStmtGen.cpp clang/lib/AST/

[PATCH] D135750: [clang][Interp] Track initialization state of local variables

2022-12-21 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder marked 4 inline comments as done. tbaeder added inline comments. Comment at: clang/lib/AST/Interp/ByteCodeExprGen.cpp:835 IsTemporary = true; Ty = E->getType(); } shafik wrote: > tbaeder wrote: > > shafik wrote: > > > Do we really want to the

[PATCH] D135750: [clang][Interp] Track initialization state of local variables

2022-12-20 Thread Shafik Yaghmour via Phabricator via cfe-commits
shafik added a comment. This looks good to me but I see at least one concern that Aaron had that he did not get back on, so I will wait for him to approve. Comment at: clang/lib/AST/Interp/ByteCodeExprGen.cpp:835 IsTemporary = true; Ty = E->getType(); } --

[PATCH] D135750: [clang][Interp] Track initialization state of local variables

2022-12-20 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder updated this revision to Diff 484212. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D135750/new/ https://reviews.llvm.org/D135750 Files: clang/lib/AST/Interp/ByteCodeExprGen.cpp clang/lib/AST/Interp/ByteCodeStmtGen.cpp clang/lib/AST/Interp/Context.cpp clang/lib/AST/Interp/

[PATCH] D135750: [clang][Interp] Track initialization state of local variables

2022-12-08 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder added inline comments. Comment at: clang/lib/AST/Interp/InterpBlock.h:97 void invokeCtor() { -std::memset(data(), 0, getSize()); +std::memset(rawData(), 0, Desc->getAllocSize()); if (Desc->CtorFn) aaron.ballman wrote: > tbaeder wrote: > >

[PATCH] D135750: [clang][Interp] Track initialization state of local variables

2022-12-06 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added inline comments. Comment at: clang/lib/AST/Interp/InterpBlock.h:97 void invokeCtor() { -std::memset(data(), 0, getSize()); +std::memset(rawData(), 0, Desc->getAllocSize()); if (Desc->CtorFn) tbaeder wrote: > aaron.ballman wrote

[PATCH] D135750: [clang][Interp] Track initialization state of local variables

2022-12-06 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder marked 9 inline comments as done. tbaeder added inline comments. Comment at: clang/lib/AST/Interp/ByteCodeExprGen.cpp:835 IsTemporary = true; Ty = E->getType(); } shafik wrote: > Do we really want to the type of the expression? If we have a `

[PATCH] D135750: [clang][Interp] Track initialization state of local variables

2022-12-02 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added inline comments. Comment at: clang/lib/AST/Interp/Descriptor.h:141-145 unsigned getAllocSize() const { return AllocSize; } /// returns the size of an element when the structure is viewed as an array. unsigned getElemSize() const { return ElemSize; }

[PATCH] D135750: [clang][Interp] Track initialization state of local variables

2022-12-02 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder added inline comments. Comment at: clang/lib/AST/Interp/Descriptor.h:73 + /// Flag indicating if the field is mutable (if in a record). + unsigned IsMutable : 1; + shafik wrote: > Maybe `IsFieldMutable` b/c we call `CreateDescriptor` it is a little > c

[PATCH] D135750: [clang][Interp] Track initialization state of local variables

2022-12-02 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder updated this revision to Diff 479582. tbaeder marked an inline comment as done. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D135750/new/ https://reviews.llvm.org/D135750 Files: clang/lib/AST/Interp/ByteCodeExprGen.cpp clang/lib/AST/Interp/ByteCodeStmtGen.cpp clang/lib/AST/

[PATCH] D135750: [clang][Interp] Track initialization state of local variables

2022-12-02 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder added inline comments. Comment at: clang/lib/AST/Interp/InterpBlock.h:97 void invokeCtor() { -std::memset(data(), 0, getSize()); +std::memset(rawData(), 0, Desc->getAllocSize()); if (Desc->CtorFn) aaron.ballman wrote: > tbaeder wrote: > >

[PATCH] D135750: [clang][Interp] Track initialization state of local variables

2022-12-01 Thread Shafik Yaghmour via Phabricator via cfe-commits
shafik added inline comments. Comment at: clang/lib/AST/Interp/ByteCodeExprGen.cpp:835 IsTemporary = true; Ty = E->getType(); } Do we really want to the type of the expression? If we have a `ValueDecl` don't we want that type? I think they should be

[PATCH] D135750: [clang][Interp] Track initialization state of local variables

2022-11-23 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder updated this revision to Diff 477437. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D135750/new/ https://reviews.llvm.org/D135750 Files: clang/lib/AST/Interp/ByteCodeExprGen.cpp clang/lib/AST/Interp/ByteCodeStmtGen.cpp clang/lib/AST/Interp/Context.cpp clang/lib/AST/Interp/

[PATCH] D135750: [clang][Interp] Track initialization state of local variables

2022-11-23 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder marked 10 inline comments as done. tbaeder added inline comments. Comment at: clang/lib/AST/Interp/Descriptor.h:141-145 unsigned getAllocSize() const { return AllocSize; } /// returns the size of an element when the structure is viewed as an array. unsigned getEl

[PATCH] D135750: [clang][Interp] Track initialization state of local variables

2022-11-22 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added inline comments. Comment at: clang/lib/AST/Interp/ByteCodeExprGen.cpp:749-751 + const Descriptor::MetadataSize MDSize{sizeof(InlineDescriptor)}; + Descriptor *D = + P.createDescriptor(Src, Ty, MDSize, IsConst, Src.is()); tbaeder wrote:

[PATCH] D135750: [clang][Interp] Track initialization state of local variables

2022-11-18 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder marked 4 inline comments as done. tbaeder added inline comments. Comment at: clang/lib/AST/Interp/ByteCodeExprGen.cpp:749-751 + const Descriptor::MetadataSize MDSize{sizeof(InlineDescriptor)}; + Descriptor *D = + P.createDescriptor(Src, Ty, MDSize, IsConst, Src.is(

[PATCH] D135750: [clang][Interp] Track initialization state of local variables

2022-11-18 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added inline comments. Comment at: clang/lib/AST/Interp/ByteCodeExprGen.cpp:749-751 + const Descriptor::MetadataSize MDSize{sizeof(InlineDescriptor)}; + Descriptor *D = + P.createDescriptor(Src, Ty, MDSize, IsConst, Src.is()); tbaeder wrote:

[PATCH] D135750: [clang][Interp] Track initialization state of local variables

2022-11-17 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder updated this revision to Diff 476334. tbaeder marked 3 inline comments as done. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D135750/new/ https://reviews.llvm.org/D135750 Files: clang/lib/AST/Interp/ByteCodeExprGen.cpp clang/lib/AST/Interp/ByteCodeStmtGen.cpp clang/lib/AST/

[PATCH] D135750: [clang][Interp] Track initialization state of local variables

2022-11-17 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder marked 14 inline comments as done. tbaeder added inline comments. Comment at: clang/lib/AST/Interp/ByteCodeExprGen.cpp:749-751 + const Descriptor::MetadataSize MDSize{sizeof(InlineDescriptor)}; + Descriptor *D = + P.createDescriptor(Src, Ty, MDSize, IsConst, Src.is

[PATCH] D135750: [clang][Interp] Track initialization state of local variables

2022-11-17 Thread Shafik Yaghmour via Phabricator via cfe-commits
shafik added inline comments. Comment at: clang/lib/AST/Interp/Context.cpp:128 InterpState State(Parent, *P, Stk, *this); - State.Current = new InterpFrame(State, Func, nullptr, {}, {}); + State.Current = new InterpFrame(State, Func, nullptr, {}); if (Interpret(State, Res

[PATCH] D135750: [clang][Interp] Track initialization state of local variables

2022-11-17 Thread Erich Keane via Phabricator via cfe-commits
erichkeane added a comment. I don't have enough knowledge about how this works to do a better review, but I have a couple of suggestions. Comment at: clang/lib/AST/Interp/ByteCodeExprGen.cpp:749 bool IsExtended) { - D

[PATCH] D135750: [clang][Interp] Track initialization state of local variables

2022-11-17 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added inline comments. Comment at: clang/lib/AST/Interp/ByteCodeExprGen.cpp:749-751 + const Descriptor::MetadataSize MDSize{sizeof(InlineDescriptor)}; + Descriptor *D = + P.createDescriptor(Src, Ty, MDSize, IsConst, Src.is()); Double checking

[PATCH] D135750: [clang][Interp] Track initialization state of local variables

2022-11-10 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder added a comment. Ping. This review has been open for a month now and a lot of following functionality depends on it, so if you need to decide which one of the patches to review, choose this one :) CHANGES SINCE LAST ACTION https://reviews.llvm.org/D135750/new/ https://reviews.llvm.o

[PATCH] D135750: [clang][Interp] Track initialization state of local variables

2022-11-03 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder added a comment. Ping CHANGES SINCE LAST ACTION https://reviews.llvm.org/D135750/new/ https://reviews.llvm.org/D135750 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D135750: [clang][Interp] Track initialization state of local variables

2022-10-28 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder updated this revision to Diff 471713. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D135750/new/ https://reviews.llvm.org/D135750 Files: clang/lib/AST/Interp/ByteCodeExprGen.cpp clang/lib/AST/Interp/ByteCodeStmtGen.cpp clang/lib/AST/Interp/Context.cpp clang/lib/AST/Interp/

[PATCH] D135750: [clang][Interp] Track initialization state of local variables

2022-10-26 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder added a comment. Ping CHANGES SINCE LAST ACTION https://reviews.llvm.org/D135750/new/ https://reviews.llvm.org/D135750 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D135750: [clang][Interp] Track initialization state of local variables

2022-10-26 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder updated this revision to Diff 470724. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D135750/new/ https://reviews.llvm.org/D135750 Files: clang/lib/AST/Interp/ByteCodeExprGen.cpp clang/lib/AST/Interp/ByteCodeStmtGen.cpp clang/lib/AST/Interp/Context.cpp clang/lib/AST/Interp/

[PATCH] D135750: [clang][Interp] Track initialization state of local variables

2022-10-20 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder added a comment. Ping Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D135750/new/ https://reviews.llvm.org/D135750 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi

[PATCH] D135750: [clang][Interp] Track initialization state of local variables

2022-10-11 Thread Timm Bäder via Phabricator via cfe-commits
tbaeder created this revision. tbaeder added reviewers: aaron.ballman, erichkeane, tahonermann, shafik. Herald added a project: All. tbaeder requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. This patch is a bit all over the place, sorry for t