[PATCH] D66094: [CodeGen] Emit destructor calls for non-trivial C structs returned by function calls and loaded from volatile objects

John McCall via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sat Mar 7 15:09:42 PST 2020


rjmccall added inline comments.


================
Comment at: clang/lib/CodeGen/CGExprAgg.cpp:822
+        Dest.setExternallyDestructed();
+      }
+
----------------
I don't think `setExternallyDestructed` can be used to communicate outwards like this; the code isn't set up to just do modifications on a single `AggValueSlot` that's passed around by reference.  Instead, the flags are used to communicate downwards to the callees, and the expectation needs to be that callees will push a destructor when they're done initializing unless `isExternallyDestructed` is set on the dest slot they receive.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D66094





More information about the cfe-commits mailing list