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

Timm Bäder via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Oct 11 23:42:05 PDT 2022


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 that. I tried adding comments to Pointer and Block to explain the situation.

We already have a mechanism to track initialization state, i.e. `InlineDescriptor`. So, this patch adds such an inline descriptor to local variables as well. However, that requires a bit of management in `Descriptor`.

I didn't add a test for this specifically, but while working on it, plenty of things broke left and right whenever I did something wrong.


Repository:
  rG LLVM Github Monorepo

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/Descriptor.cpp
  clang/lib/AST/Interp/Descriptor.h
  clang/lib/AST/Interp/EvalEmitter.cpp
  clang/lib/AST/Interp/Interp.h
  clang/lib/AST/Interp/InterpBlock.h
  clang/lib/AST/Interp/InterpFrame.cpp
  clang/lib/AST/Interp/InterpFrame.h
  clang/lib/AST/Interp/Pointer.cpp
  clang/lib/AST/Interp/Pointer.h
  clang/lib/AST/Interp/Program.cpp
  clang/lib/AST/Interp/Program.h
  clang/test/AST/Interp/cxx20.cpp
  clang/test/AST/Interp/loops.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D135750.467028.patch
Type: text/x-patch
Size: 32618 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20221012/5c1d9fff/attachment-0001.bin>


More information about the cfe-commits mailing list