Michael137 updated this revision to Diff 460420. Michael137 added a comment.
- Merge if-blocks - Reword commit Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D133945/new/ https://reviews.llvm.org/D133945 Files: clang/lib/AST/DeclBase.cpp clang/unittests/AST/ASTImporterTest.cpp lldb/test/API/lang/cpp/gmodules/base-template-with-same-arg/TestBaseTemplateWithSameArg.py Index: lldb/test/API/lang/cpp/gmodules/base-template-with-same-arg/TestBaseTemplateWithSameArg.py =================================================================== --- lldb/test/API/lang/cpp/gmodules/base-template-with-same-arg/TestBaseTemplateWithSameArg.py +++ lldb/test/API/lang/cpp/gmodules/base-template-with-same-arg/TestBaseTemplateWithSameArg.py @@ -30,7 +30,6 @@ class TestBaseTemplateWithSameArg(TestBase): @add_test_categories(["gmodules"]) - @skipIf(bugnumber='rdar://96581048') def test_same_base_template_arg(self): self.build() Index: clang/unittests/AST/ASTImporterTest.cpp =================================================================== --- clang/unittests/AST/ASTImporterTest.cpp +++ clang/unittests/AST/ASTImporterTest.cpp @@ -4924,9 +4924,9 @@ FooDC->getRedeclContext()->localUncachedLookup(FooName, FoundDecls); EXPECT_EQ(FoundDecls.size(), 0u); - // Cannot find in the LookupTable of its LexicalDC (A). + // Finds via linear search of its LexicalDC (A). FooLexicalDC->getRedeclContext()->localUncachedLookup(FooName, FoundDecls); - EXPECT_EQ(FoundDecls.size(), 0u); + EXPECT_EQ(FoundDecls.size(), 1u); // Can't find in the list of Decls of the DC. EXPECT_EQ(findInDeclListOfDC(FooDC, FooName), nullptr); Index: clang/lib/AST/DeclBase.cpp =================================================================== --- clang/lib/AST/DeclBase.cpp +++ clang/lib/AST/DeclBase.cpp @@ -1771,13 +1771,11 @@ if (!hasExternalVisibleStorage() && !hasExternalLexicalStorage() && Name) { lookup_result LookupResults = lookup(Name); Results.insert(Results.end(), LookupResults.begin(), LookupResults.end()); - return; - } + if (!Results.empty()) + return; - // If we have a lookup table, check there first. Maybe we'll get lucky. - // FIXME: Should we be checking these flags on the primary context? - if (Name && !hasLazyLocalLexicalLookups() && - !hasLazyExternalLexicalLookups()) { + // If we have a lookup table, check there first. Maybe we'll get lucky. + // FIXME: Should we be checking these flags on the primary context? if (StoredDeclsMap *Map = LookupPtr) { StoredDeclsMap::iterator Pos = Map->find(Name); if (Pos != Map->end()) {
Index: lldb/test/API/lang/cpp/gmodules/base-template-with-same-arg/TestBaseTemplateWithSameArg.py =================================================================== --- lldb/test/API/lang/cpp/gmodules/base-template-with-same-arg/TestBaseTemplateWithSameArg.py +++ lldb/test/API/lang/cpp/gmodules/base-template-with-same-arg/TestBaseTemplateWithSameArg.py @@ -30,7 +30,6 @@ class TestBaseTemplateWithSameArg(TestBase): @add_test_categories(["gmodules"]) - @skipIf(bugnumber='rdar://96581048') def test_same_base_template_arg(self): self.build() Index: clang/unittests/AST/ASTImporterTest.cpp =================================================================== --- clang/unittests/AST/ASTImporterTest.cpp +++ clang/unittests/AST/ASTImporterTest.cpp @@ -4924,9 +4924,9 @@ FooDC->getRedeclContext()->localUncachedLookup(FooName, FoundDecls); EXPECT_EQ(FoundDecls.size(), 0u); - // Cannot find in the LookupTable of its LexicalDC (A). + // Finds via linear search of its LexicalDC (A). FooLexicalDC->getRedeclContext()->localUncachedLookup(FooName, FoundDecls); - EXPECT_EQ(FoundDecls.size(), 0u); + EXPECT_EQ(FoundDecls.size(), 1u); // Can't find in the list of Decls of the DC. EXPECT_EQ(findInDeclListOfDC(FooDC, FooName), nullptr); Index: clang/lib/AST/DeclBase.cpp =================================================================== --- clang/lib/AST/DeclBase.cpp +++ clang/lib/AST/DeclBase.cpp @@ -1771,13 +1771,11 @@ if (!hasExternalVisibleStorage() && !hasExternalLexicalStorage() && Name) { lookup_result LookupResults = lookup(Name); Results.insert(Results.end(), LookupResults.begin(), LookupResults.end()); - return; - } + if (!Results.empty()) + return; - // If we have a lookup table, check there first. Maybe we'll get lucky. - // FIXME: Should we be checking these flags on the primary context? - if (Name && !hasLazyLocalLexicalLookups() && - !hasLazyExternalLexicalLookups()) { + // If we have a lookup table, check there first. Maybe we'll get lucky. + // FIXME: Should we be checking these flags on the primary context? if (StoredDeclsMap *Map = LookupPtr) { StoredDeclsMap::iterator Pos = Map->find(Name); if (Pos != Map->end()) {
_______________________________________________ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits