[CodeGen][ObjC] Destroy callee-destroyed arguments in the caller
function when the receiver is nil
Callee-destroyed arguments to a method have to be destroyed in the
caller function when the receiver is nil as the method doesn't get
executed. This fixes PR48207.
rdar://71808391
Differential Revision: https://reviews.llvm.org/D93273
diff --git a/clang/include/clang/AST/Decl.h b/clang/include/clang/AST/Decl.h
index ab24c87..47c282f 100644
--- a/clang/include/clang/AST/Decl.h
+++ b/clang/include/clang/AST/Decl.h
@@ -1664,6 +1664,9 @@
return ParmVarDeclBits.IsObjCMethodParam;
}
+ /// Determines whether this parameter is destroyed in the callee function.
+ bool isDestroyedInCallee() const;
+
unsigned getFunctionScopeDepth() const {
if (ParmVarDeclBits.IsObjCMethodParam) return 0;
return ParmVarDeclBits.ScopeDepthOrObjCQuals;