[PATCH] D134057: [clang][Interp] Start implementing record types

Timm Bäder via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Sep 19 00:20:33 PDT 2022


tbaeder added inline comments.


================
Comment at: clang/lib/AST/Interp/ByteCodeExprGen.cpp:673
+      if (Optional<PrimType> T = classify(Init->getType())) {
+        if (!this->emitDupPtr(Initializer))
+          return false;
----------------
shafik wrote:
> This section of code looks duplicated w/ the above, can it be factored out or will they diverge as you fill in more details?
The version above will go away in my next patch to record implementation.


================
Comment at: clang/test/AST/Interp/records.cpp:7
+
+struct Ints {
+  int a = 20;
----------------
shafik wrote:
> How about also have a field that is a struct and initializing that.
> 
> Also using initializer lists in in class member initializers and also designated initializers as well. 
> 
> I am not sure if unions works yet but anon union members as well.
Struct initializers here aren't supported yet (that's what the "Handle initializer for non-primitive values" assert in `VisitRecordInitializer` is about). I added a FIXME comment and a test for designated initializers.


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

https://reviews.llvm.org/D134057



More information about the cfe-commits mailing list