[PATCH] D136017: [clang][Interp] Materializing primitive temporaries

Timm Bäder via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Oct 18 23:33:03 PDT 2022


tbaeder added inline comments.


================
Comment at: clang/lib/AST/Interp/ByteCodeExprGen.cpp:513
+
+      if (!this->emitSetLocal(PT_Sint32, *LocalIndex, E))
+        return false;
----------------
shafik wrote:
> Should this use `*SubExprT` instead?
Ah, yes. Thanks!


================
Comment at: clang/lib/AST/Interp/Interp.h:574
+/// 3) Initialized global with index \I with that
+template <PrimType Name, class T = typename PrimConv<Name>::T>
+bool InitGlobalTemp(InterpState &S, CodePtr OpPC, uint32_t I,
----------------
shafik wrote:
> Is `Name` really a `TypeName`?
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`.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D136017



More information about the cfe-commits mailing list