[clang] [AST] Replace localUncachedLookup with noload_lookup in ASTImporterFixtures (PR #91955)

via cfe-commits cfe-commits at lists.llvm.org
Mon May 13 05:55:47 PDT 2024


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-clang

Author: AtariDreams (AtariDreams)

<details>
<summary>Changes</summary>



---
Full diff: https://github.com/llvm/llvm-project/pull/91955.diff


1 Files Affected:

- (modified) clang/unittests/AST/ASTImporterFixtures.cpp (+3-4) 


``````````diff
diff --git a/clang/unittests/AST/ASTImporterFixtures.cpp b/clang/unittests/AST/ASTImporterFixtures.cpp
index 897b370dd3cdc..e9864cca24c9f 100644
--- a/clang/unittests/AST/ASTImporterFixtures.cpp
+++ b/clang/unittests/AST/ASTImporterFixtures.cpp
@@ -157,11 +157,10 @@ std::tuple<Decl *, Decl *> ASTImporterTestBase::getImportedDecl(
   assert(ImportedII && "Declaration with the given identifier "
                        "should be specified in test!");
   DeclarationName ImportDeclName(ImportedII);
-  SmallVector<NamedDecl *, 1> FoundDecls;
-  FromCtx.getTranslationUnitDecl()->localUncachedLookup(ImportDeclName,
-                                                        FoundDecls);
+  DeclContext::lookup_result FoundDecls =
+      FromCtx.getTranslationUnitDecl()->noload_lookup(ImportDeclName);
 
-  assert(FoundDecls.size() == 1);
+  assert(FoundDecls && !FoundDecls.empty());
 
   Decl *Imported =
       FromTU.import(SharedStatePtr, ToAST.get(), FoundDecls.front());

``````````

</details>


https://github.com/llvm/llvm-project/pull/91955


More information about the cfe-commits mailing list