martong added inline comments.
Comment at: test/Import/objc-arc/Inputs/cleanup-objects.m:6
+id getObj(int c, id a) {
+ // Commenting out the following line because AST importer crashes when trying
+ // to import a BlockExpr.
Perhaps then this patch depends on a
ahatanak marked an inline comment as done.
ahatanak added inline comments.
Comment at: lib/CodeGen/CGExpr.cpp:4647
+pushDestroy(QualType::DK_nontrivial_c_struct, RV.getAggregateAddress(),
+E->getType());
+
rjmccall wrote:
> Does `EmitCallExpr`
rjmccall added inline comments.
Herald added a subscriber: rnkovacs.
Comment at: include/clang/AST/ExprCXX.h:3220
+ /// It's useful to remember the set of blocks and compound literals; we could
+ /// also remember the set of temporaries, but there's currently no need.
+ using
ahatanak updated this revision to Diff 212942.
ahatanak marked 2 inline comments as done.
ahatanak added a comment.
Herald added a reviewer: martong.
Herald added a reviewer: shafik.
- Emit member access, compound literal, and call expressions as subexpressions
of `ExprWithCleanups` if the expres
rjmccall added inline comments.
Comment at: lib/CodeGen/CGExpr.cpp:4100
+ if (E->getType().isDestructedType() == QualType::DK_nontrivial_c_struct)
+pushDestroy(QualType::DK_nontrivial_c_struct, DeclPtr, E->getType());
+
Unfortunately, the lifetime of compoun
ahatanak marked an inline comment as done.
ahatanak added inline comments.
Comment at: lib/CodeGen/CGExprAgg.cpp:248
bool RequiresDestruction =
- Dest.isIgnored() &&
+ !Dest.isExternallyDestructed() &&
RetTy.isDestructedType() == QualType::DK_nontrivial_c_stru
ahatanak created this revision.
ahatanak added a reviewer: rjmccall.
ahatanak added a project: clang.
Herald added subscribers: dexonsmith, jkorous.
This patch fixes a bug in IRGen where it wasn't calling the destructors for
non-trivial C structs in the following cases:
- member access of struct