[clang] [modulemap] Add -fno-implicit-module-map-file= to exclude from implicit discovery (PR #208191)

via cfe-commits cfe-commits at lists.llvm.org
Wed Jul 8 03:24:13 PDT 2026


github-actions[bot] wrote:

<!--LLVM CODE FORMAT COMMENT: {clang-format}-->


:warning: C/C++ code formatter, clang-format found issues in your code. :warning:

<details>
<summary>
You can test this locally with the following command:
</summary>

``````````bash
git-clang-format --diff origin/main HEAD --extensions h,c,cpp -- clang/test/Modules/no-implicit-module-map-file.c clang/include/clang/Lex/HeaderSearch.h clang/include/clang/Lex/HeaderSearchOptions.h clang/lib/Lex/HeaderSearch.cpp --diff_from_common_commit
``````````

:warning:
The reproduction instructions above might return results for more than one PR
in a stack if you are using a stacked PR workflow. You can limit the results by
changing `origin/main` to the base branch/commit you want to compare against.
:warning:

</details>

<details>
<summary>
View the diff from clang-format here.
</summary>

``````````diff
diff --git a/clang/lib/Lex/HeaderSearch.cpp b/clang/lib/Lex/HeaderSearch.cpp
index 8abec291d..dba643ed8 100644
--- a/clang/lib/Lex/HeaderSearch.cpp
+++ b/clang/lib/Lex/HeaderSearch.cpp
@@ -2197,8 +2197,7 @@ HeaderSearch::lookupModuleMapFile(DirectoryEntryRef Dir, bool IsFramework) {
   // Return the given implicitly-discovered module map file unless it has been
   // excluded via -fno-implicit-module-map-file=, in which case discovery
   // continues as if the file were not present.
-  auto ReturnUnlessExcluded =
-      [&](FileEntryRef F) -> OptionalFileEntryRef {
+  auto ReturnUnlessExcluded = [&](FileEntryRef F) -> OptionalFileEntryRef {
     if (isModuleMapFileExcludedFromImplicitDiscovery(F))
       return std::nullopt;
     return F;

``````````

</details>


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


More information about the cfe-commits mailing list