[PATCH] D64464: [CodeGen] Emit destructor calls for non-trivial C structs

2019-08-16 Thread Gabor Marton via Phabricator via cfe-commits
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

[PATCH] D64464: [CodeGen] Emit destructor calls for non-trivial C structs

2019-08-12 Thread Akira Hatanaka via Phabricator via cfe-commits
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

[PATCH] D64464: [CodeGen] Emit destructor calls for non-trivial C structs

2019-08-02 Thread John McCall via Phabricator via cfe-commits
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

[PATCH] D64464: [CodeGen] Emit destructor calls for non-trivial C structs

2019-08-01 Thread Akira Hatanaka via Phabricator via cfe-commits
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

[PATCH] D64464: [CodeGen] Emit destructor calls for non-trivial C structs

2019-07-09 Thread John McCall via Phabricator via cfe-commits
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

[PATCH] D64464: [CodeGen] Emit destructor calls for non-trivial C structs

2019-07-09 Thread Akira Hatanaka via Phabricator via cfe-commits
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() ==

[PATCH] D64464: [CodeGen] Emit destructor calls for non-trivial C structs

2019-07-09 Thread Akira Hatanaka via Phabricator via cfe-commits
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