[PATCH] D133753: [clang][Interp] WIP: Array fillers

Timm Bäder via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Sep 13 00:40:06 PDT 2022


tbaeder created this revision.
tbaeder added reviewers: erichkeane, aaron.ballman, shafik, tahonermann.
Herald added a project: All.
tbaeder requested review of this revision.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.

Uploading this now to get some early feedback on the approach and maybe find some better tests.

Pointers in the VM are implemented through the `Pointer` class. Each `Pointer` points to a `Block`, which represent memory. However, each `Block` also knows all the `Pointer`s pointing at it. I've used this to find simply replace a `Block` representing an array with a larger one and update all pointers pointing to said block (`Block::transferPointers()`). This is the core of it all, but it requires quite a few smaller changes that could be broken out of this patch of course. Like enabling pointer tracking for static `Block`s.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D133753

Files:
  clang/lib/AST/Interp/Boolean.h
  clang/lib/AST/Interp/ByteCodeExprGen.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/Integral.h
  clang/lib/AST/Interp/Interp.h
  clang/lib/AST/Interp/InterpBlock.cpp
  clang/lib/AST/Interp/InterpBlock.h
  clang/lib/AST/Interp/InterpFrame.cpp
  clang/lib/AST/Interp/InterpFrame.h
  clang/lib/AST/Interp/InterpStack.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/arrays.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D133753.459664.patch
Type: text/x-patch
Size: 34328 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20220913/96ca8704/attachment-0001.bin>


More information about the cfe-commits mailing list