[clang] [C23] Correctly handle missing embed with -MG (PR #166188)

via cfe-commits cfe-commits at lists.llvm.org
Mon Nov 3 09:56:36 PST 2025


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 cpp,c -- clang/lib/Frontend/DependencyFile.cpp clang/lib/Lex/PPDirectives.cpp clang/test/Driver/mg.c --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/Frontend/DependencyFile.cpp b/clang/lib/Frontend/DependencyFile.cpp
index 313ad5fb9..93e012b16 100644
--- a/clang/lib/Frontend/DependencyFile.cpp
+++ b/clang/lib/Frontend/DependencyFile.cpp
@@ -78,10 +78,10 @@ struct DepCollectorPPCallbacks : public PPCallbacks {
   bool EmbedFileNotFound(StringRef FileName) override {
     DepCollector.maybeAddDependency(
         llvm::sys::path::remove_leading_dotslash(FileName),
-        /*FromModule=*/ false,
-        /*IsSystem=*/ false,
-        /*IsModuleFile=*/ false,
-        /*IsMissing=*/ true);
+        /*FromModule=*/false,
+        /*IsSystem=*/false,
+        /*IsModuleFile=*/false,
+        /*IsMissing=*/true);
     // Return true to silence the file not found diagnostic.
     return true;
   }

``````````

</details>


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


More information about the cfe-commits mailing list