diff --git a/clang/include/clang/Lex/HeaderSearch.h b/clang/include/clang/Lex/HeaderSearch.h --- a/clang/include/clang/Lex/HeaderSearch.h +++ b/clang/include/clang/Lex/HeaderSearch.h @@ -561,6 +561,7 @@ /// Determine which HeaderSearchOptions::UserEntries have been successfully /// used so far and mark their index with 'true' in the resulting bit vector. + /// Note: implicit module maps don't contribute to entry usage. std::vector computeUserEntryUsage() const; /// This method returns a HeaderMap for the specified diff --git a/clang/lib/Lex/HeaderSearch.cpp b/clang/lib/Lex/HeaderSearch.cpp --- a/clang/lib/Lex/HeaderSearch.cpp +++ b/clang/lib/Lex/HeaderSearch.cpp @@ -365,9 +365,6 @@ break; } - if (Module) - noteLookupUsage(It.Idx, ImportLoc); - return Module; } diff --git a/clang/test/Preprocessor/search-path-usage.m b/clang/test/Preprocessor/search-path-usage.m --- a/clang/test/Preprocessor/search-path-usage.m +++ b/clang/test/Preprocessor/search-path-usage.m @@ -129,7 +129,7 @@ #endif #endif -// Check that search paths with module maps are reported. +// Check that search paths with module maps are NOT reported. // // RUN: mkdir %t/modulemap_abs // RUN: sed "s|DIR|%/S/Inputs/search-path-usage|g" \ @@ -142,5 +142,5 @@ // RUN: -DMODMAP_ABS -verify #ifdef MODMAP_ABS @import b; // \ -// expected-remark-re {{search path used: '{{.*}}/modulemap_abs'}} +// expected-no-diagnostics #endif