================
@@ -67,6 +68,48 @@ class DerefFuncDeleteExprVisitor
const Decl *D = CE->getCalleeDecl();
if (D && D->hasBody())
return VisitBody(D->getBody());
+ else {
+ auto name = safeGetName(D);
+ if (name == "ensureOnMainThread" || name == "ensureOnMainRunLoop") {
+ for (unsigned i = 0; i < CE->getNumArgs(); ++i) {
+ auto *Arg = CE->getArg(i);
+ if (FindLabmda(Arg))
+ return true;
+ }
+ }
+ }
+ return false;
+ }
+
+ bool FindLabmda(const Expr *E) {
+ while (E) {
+ if (auto *TempE = dyn_cast<MaterializeTemporaryExpr>(E)) {
----------------
haoNoQ wrote:
Aha great!
`Expr->IgnoreParenCasts()` skips all of these automatically, recursively too,
except `CXXBindTemporaryExpr`. But IIRC `CXXBindTemporaryExpr` doesn't need to
be skipped recursively anyway, it's a one-time thing that always appears
immediately before the constructor.
https://github.com/llvm/llvm-project/pull/107676
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits