================
@@ -516,19 +516,35 @@ class TrivialFunctionAnalysisVisitor
return Result;
}
+ bool CanTriviallyDestruct(const Type *T) {
+ if (T->isIntegralOrEnumerationType())
+ return true;
+ if (isa<PointerType>(T) || T->isNullPtrType())
+ return true;
+ auto *R = T->getAsCXXRecordDecl();
+ if (!R)
+ return false;
+ auto *Dtor = R->getDestructor();
+ return !Dtor || Dtor->isTrivial() || IsFunctionTrivial(Dtor);
+ }
----------------
steakhal wrote:
Usually, in the clang codebase we prefer QualTypes over Types unless there is a
reason not to.
https://github.com/llvm/llvm-project/pull/181576
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits