================ @@ -23,12 +24,27 @@ using ast_matchers::pointerType; using ast_matchers::referenceType; using ast_matchers::returns; -bool hasSmartPointerClassShape(const CXXRecordDecl &RD, bool &HasGet, - bool &HasValue) { +CanQualType getLikeReturnType(QualType RT) { + if (!RT.isNull() && RT->isPointerType()) { + return RT->getPointeeType() + ->getCanonicalTypeUnqualified() + .getUnqualifiedType(); + } + return {}; +} + +CanQualType valueLikeReturnType(QualType RT) { + if (!RT.isNull() && RT->isReferenceType()) { + return RT.getNonReferenceType() + ->getCanonicalTypeUnqualified() + .getUnqualifiedType(); + } + return {}; +} + +CanQualType pointerLikeReturnType(const CXXRecordDecl &RD) { // We may want to cache this search, but in current profiles it hasn't shown // up as a hot spot (possibly because there aren't many hits, relatively). - bool HasArrow = false; - bool HasStar = false; CanQualType StarReturnType, ArrowReturnType, GetReturnType, ValueReturnType; ---------------- jvoung wrote:
Can remove the 'GetReturnType, ValueReturnType' variables too https://github.com/llvm/llvm-project/pull/133350 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits