This revision was automatically updated to reflect the committed changes.
ahatanak marked an inline comment as done.
Closed by commit rG40568fec7e3e: [CodeGen] Emit destructor calls to destruct
compound literals (authored by ahatanak).
Changed prior to commit:
https://reviews.llvm.org/D64464?vs
ahatanak marked 3 inline comments as done.
ahatanak 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());
+
rjmccall accepted this revision.
rjmccall added a comment.
This revision is now accepted and ready to land.
Minor comments; otherwise LGTM.
Comment at: clang/lib/Sema/SemaExpr.cpp:6256
+// Compound literals that have automatic storage duration are destroyed at
+// the e
ahatanak marked an inline comment as done.
ahatanak added inline comments.
Comment at: clang/lib/CodeGen/CGBlocks.cpp:869
+ if (auto *BD = C.dyn_cast())
+enterBlockScope(*this, BD);
}
rjmccall wrote:
> I wonder if we could just switch blocks to th
ahatanak updated this revision to Diff 249173.
ahatanak marked 4 inline comments as done.
ahatanak added a comment.
Address review comments
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D64464/new/
https://reviews.llvm.org/D64464
Files:
clang/inc
martong resigned from this revision.
martong added a comment.
Looks good from the ASTImporter's point of view. I don't have the competence to
review the rest, so I am resigning.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D64464/new/
https://revi
rjmccall added inline comments.
Comment at: clang/lib/CodeGen/CGBlocks.cpp:869
+ if (auto *BD = C.dyn_cast())
+enterBlockScope(*this, BD);
}
I wonder if we could just switch blocks to the same thing.
Comment at: clang/lib/Sema/S
ahatanak updated this revision to Diff 248797.
ahatanak added a comment.
Don't try to push a cleanup in C++.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D64464/new/
https://reviews.llvm.org/D64464
Files:
clang/include/clang/AST/ASTImporter.h
ahatanak marked an inline comment as done.
ahatanak 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());
+
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());
+
ahatanak wrote:
> rjmccall wrote:
> >
ahatanak marked an inline comment as done.
ahatanak 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());
+
rjmccall added a comment.
This patch looks good except for that C/C++ semantic difference. A compound
literal temporary can be lifetime-extended in C++, but only in the standard way
of binding a reference to it.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://review
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());
+
ahatanak wrote:
> rjmccall wrote:
> >
ahatanak updated this revision to Diff 248586.
ahatanak marked an inline comment as done.
ahatanak added a comment.
Return `make_error` instead of a nullptr.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D64464/new/
https://reviews.llvm.org/D64464
martong added inline comments.
Comment at: clang/lib/AST/ASTImporter.cpp:7918
+
+ return nullptr;
+}
I think
```
return make_errorhttps://reviews.llvm.org/D64464/new/
https://reviews.llvm.org/D64464
___
cfe-commit
ahatanak marked an inline comment as done.
ahatanak 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());
+
ahatanak 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.
martong wrote:
> Perhaps then this
ahatanak updated this revision to Diff 247919.
ahatanak marked 5 inline comments as done.
ahatanak retitled this revision from "[CodeGen] Emit destructor calls for
non-trivial C structs" to "[CodeGen] Emit destructor calls to destruct compound
literals".
ahatanak edited the summary of this revisi
18 matches
Mail list logo