Author: Kazu Hirata
Date: 2024-09-23T06:45:59-07:00
New Revision: d6a6e25c5158be8a1b820aedf067fce394f7a313

URL: 
https://github.com/llvm/llvm-project/commit/d6a6e25c5158be8a1b820aedf067fce394f7a313
DIFF: 
https://github.com/llvm/llvm-project/commit/d6a6e25c5158be8a1b820aedf067fce394f7a313.diff

LOG: [AST] Avoid repeated hash lookups (NFC) (#109603)

Added: 
    

Modified: 
    clang/lib/AST/ASTContext.cpp

Removed: 
    


################################################################################
diff  --git a/clang/lib/AST/ASTContext.cpp b/clang/lib/AST/ASTContext.cpp
index 8bd5abf2bf9643..fd8aa8de79b49f 100644
--- a/clang/lib/AST/ASTContext.cpp
+++ b/clang/lib/AST/ASTContext.cpp
@@ -12587,8 +12587,7 @@ void ASTContext::forEachMultiversionedFunctionVersion(
        FD->getDeclContext()->getRedeclContext()->lookup(FD->getDeclName())) {
     FunctionDecl *CurFD = CurDecl->getAsFunction()->getMostRecentDecl();
     if (CurFD && hasSameType(CurFD->getType(), FD->getType()) &&
-        !SeenDecls.contains(CurFD)) {
-      SeenDecls.insert(CurFD);
+        SeenDecls.insert(CurFD).second) {
       Pred(CurFD);
     }
   }


        
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to