================
@@ -2770,6 +2770,40 @@ bool CXXMethodDecl::isMoveAssignmentOperator() const {
return Context.hasSameUnqualifiedType(ClassType, ParamType);
}
+bool CXXMethodDecl::isCopyOrMoveConstructor() const {
+ if (const auto *Ctor = dyn_cast<CXXConstructorDecl>(this))
+ return Ctor->isCopyOrMoveConstructor();
+ return false;
+}
+
+bool CXXMethodDecl::isCopyOrMoveConstructorOrAssignment() const {
+ return isCopyOrMoveConstructor() || isCopyAssignmentOperator() ||
+ isMoveAssignmentOperator();
+}
+
+bool CXXMethodDecl::isMemcpyEquivalentSpecialMember() const {
+ if (!isCopyOrMoveConstructorOrAssignment())
+ return false;
+
+ const ASTContext &Ctx = getASTContext();
----------------
efriedma-quic wrote:
Please pass in `ASTContext&` instead of calling `getASTContext()`; it's
relatively expensive. (We have to walk the DeclContexts to find the
TranslationUnitDecl.)
https://github.com/llvm/llvm-project/pull/186700
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits