[PATCH] D154581: [clang][Interp] Track existing InitMaps in InterpState

Timm Bäder via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Aug 3 07:48:10 PDT 2023


tbaeder updated this revision to Diff 546872.
tbaeder added a comment.

1. Use  a `shared_ptr` for the initmaps.
2. However, we allocate them into the `Block`, therefore can't forget to call the Block's dtor.
3. To distinguish between Blocks we've already deallocated (via a `destroy` op), add an `IsInitialized` flag that we set in `invokeCtor` and unset in `invokeDtor`.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D154581/new/

https://reviews.llvm.org/D154581

Files:
  clang/lib/AST/Interp/Descriptor.cpp
  clang/lib/AST/Interp/Descriptor.h
  clang/lib/AST/Interp/EvalEmitter.cpp
  clang/lib/AST/Interp/EvalEmitter.h
  clang/lib/AST/Interp/InterpBlock.h
  clang/lib/AST/Interp/InterpFrame.cpp
  clang/lib/AST/Interp/InterpState.cpp
  clang/lib/AST/Interp/Pointer.cpp
  clang/lib/AST/Interp/Pointer.h
  clang/test/AST/Interp/arrays.cpp
  clang/test/AST/Interp/literals.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D154581.546872.patch
Type: text/x-patch
Size: 18619 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20230803/edffcc23/attachment-0001.bin>


More information about the cfe-commits mailing list