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 c,h,cpp -- 
clang/test/ClangScanDeps/modules-context-hash-ignore-search-path.c 
clang/test/Driver/modules-ignore-search-path.c 
clang/test/Modules/modules-ignore-search-path.c 
clang/include/clang/Lex/HeaderSearchOptions.h 
clang/lib/DependencyScanning/ModuleDepCollector.cpp 
clang/lib/Driver/ToolChains/Clang.cpp clang/lib/Frontend/CompilerInstance.cpp 
clang/lib/Frontend/CompilerInvocation.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/DependencyScanning/ModuleDepCollector.cpp 
b/clang/lib/DependencyScanning/ModuleDepCollector.cpp
index 58b68a69c..d48ac6b45 100644
--- a/clang/lib/DependencyScanning/ModuleDepCollector.cpp
+++ b/clang/lib/DependencyScanning/ModuleDepCollector.cpp
@@ -296,12 +296,12 @@ makeCommonInvocationForModuleBuild(CompilerInvocation CI) 
{
 
   // Remove any header search paths that are explicitly ignored.
   if (!CI.getHeaderSearchOpts().ModulesIgnoreSearchPaths.empty()) {
-    llvm::erase_if(CI.getHeaderSearchOpts().UserEntries,
-                   [&CI](const HeaderSearchOptions::Entry &E) {
-                     return CI.getHeaderSearchOpts()
-                         .ModulesIgnoreSearchPaths.contains(
-                             llvm::CachedHashString(E.Path));
-                   });
+    llvm::erase_if(
+        CI.getHeaderSearchOpts().UserEntries,
+        [&CI](const HeaderSearchOptions::Entry &E) {
+          return CI.getHeaderSearchOpts().ModulesIgnoreSearchPaths.contains(
+              llvm::CachedHashString(E.Path));
+        });
     // Remove the now unused option.
     CI.getHeaderSearchOpts().ModulesIgnoreSearchPaths.clear();
   }
diff --git a/clang/lib/Frontend/CompilerInstance.cpp 
b/clang/lib/Frontend/CompilerInstance.cpp
index 2a981b8e0..1ff079320 100644
--- a/clang/lib/Frontend/CompilerInstance.cpp
+++ b/clang/lib/Frontend/CompilerInstance.cpp
@@ -1167,8 +1167,8 @@ std::unique_ptr<CompilerInstance> 
CompilerInstance::cloneForModuleCompileImpl(
 
   // Likewise for header search paths explicitly ignored by every module
   // (-fmodules-ignore-search-path). ModulesIgnoreSearchPaths itself is
-  // deliberately left in place, so a module built from this clone keeps 
ignoring
-  // the same paths in its own, further-nested module builds.
+  // deliberately left in place, so a module built from this clone keeps
+  // ignoring the same paths in its own, further-nested module builds.
   if (!HSOpts.ModulesIgnoreSearchPaths.empty())
     llvm::erase_if(HSOpts.UserEntries,
                    [&HSOpts](const HeaderSearchOptions::Entry &E) {
diff --git a/clang/lib/Frontend/CompilerInvocation.cpp 
b/clang/lib/Frontend/CompilerInvocation.cpp
index c18b17dd5..2f5e882d5 100644
--- a/clang/lib/Frontend/CompilerInvocation.cpp
+++ b/clang/lib/Frontend/CompilerInvocation.cpp
@@ -3480,8 +3480,7 @@ static bool ParseHeaderSearchArgs(HeaderSearchOptions 
&Opts, ArgList &Args,
   }
 
   for (const auto *A : Args.filtered(OPT_fmodules_ignore_search_path))
-    Opts.ModulesIgnoreSearchPaths.insert(
-        llvm::CachedHashString(A->getValue()));
+    
Opts.ModulesIgnoreSearchPaths.insert(llvm::CachedHashString(A->getValue()));
 
   // Add -I... and -F... options in order.
   bool IsSysrootSpecified =
@@ -5343,7 +5342,7 @@ std::string CompilerInvocation::computeContextHash() 
const {
       }
 
       HBuilder.add(UserEntry);
-    }   
+    }
 
     HBuilder.addRange(hsOpts.VFSOverlayFiles);
 

``````````

</details>


https://github.com/llvm/llvm-project/pull/217061
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to