[clang] [clang][NFC] Refactor replaceExternalDecls to use llvm::any_of (PR #143275)
Chuanqi Xu via cfe-commits
cfe-commits at lists.llvm.org
Sun Jun 8 19:03:27 PDT 2025
================
@@ -176,14 +176,10 @@ class StoredDeclsList {
DeclListNode::Decls *Tail = erase_if([Decls](NamedDecl *ND) {
if (ND->isFromASTFile())
return true;
- // FIXME: Can we get rid of this loop completely?
- for (NamedDecl *D : Decls)
- // Only replace the local declaration if the external declaration has
- // higher visibilities.
- if (D->getModuleOwnershipKind() <= ND->getModuleOwnershipKind() &&
- D->declarationReplaces(ND, /*IsKnownNewer=*/false))
- return true;
- return false;
+ return llvm::any_of(Decls, [ND](NamedDecl *D) {
----------------
ChuanqiXu9 wrote:
Please remain the comments.
https://github.com/llvm/llvm-project/pull/143275
More information about the cfe-commits
mailing list