Author: Haojian Wu Date: 2024-07-19T16:46:31+02:00 New Revision: 71e2b8df30ad78f5f86bf0d6729296282e061a5c
URL: https://github.com/llvm/llvm-project/commit/71e2b8df30ad78f5f86bf0d6729296282e061a5c DIFF: https://github.com/llvm/llvm-project/commit/71e2b8df30ad78f5f86bf0d6729296282e061a5c.diff LOG: [clang] NFC, simplify the code in CheckExprLifetime.cpp (#99637) No need to get the Owner/Pointer attr via the type. The Decl has this attr information. Added: Modified: clang/lib/Sema/CheckExprLifetime.cpp Removed: ################################################################################ diff --git a/clang/lib/Sema/CheckExprLifetime.cpp b/clang/lib/Sema/CheckExprLifetime.cpp index d9031256f235f..5c8ef564f30aa 100644 --- a/clang/lib/Sema/CheckExprLifetime.cpp +++ b/clang/lib/Sema/CheckExprLifetime.cpp @@ -308,8 +308,7 @@ static bool shouldTrackFirstArgument(const FunctionDecl *FD) { const auto *RD = FD->getParamDecl(0)->getType()->getPointeeCXXRecordDecl(); if (!FD->isInStdNamespace() || !RD || !RD->isInStdNamespace()) return false; - if (!isRecordWithAttr<PointerAttr>(QualType(RD->getTypeForDecl(), 0)) && - !isRecordWithAttr<OwnerAttr>(QualType(RD->getTypeForDecl(), 0))) + if (!RD->hasAttr<PointerAttr>() && !RD->hasAttr<OwnerAttr>()) return false; if (FD->getReturnType()->isPointerType() || isRecordWithAttr<PointerAttr>(FD->getReturnType())) { _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits