[clang] [clang][deps][modules] Allocate input file paths lazily (PR #114457)

via cfe-commits cfe-commits at lists.llvm.org
Thu Oct 31 13:16:46 PDT 2024


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 a553c620b7d70dedd268aa2588e5e50e7dc6ccc8 3be61a8f1eecdc64c0df5d6635f5bf7809c31de4 --extensions cpp,c,h -- clang/include/clang/Serialization/ModuleFile.h clang/include/clang/Tooling/DependencyScanning/ModuleDepCollector.h clang/lib/Serialization/ASTReader.cpp clang/lib/Tooling/DependencyScanning/ModuleDepCollector.cpp clang/test/ClangScanDeps/diagnostics.c clang/test/ClangScanDeps/header-search-pruning-transitive.c clang/test/ClangScanDeps/link-libraries.c clang/test/ClangScanDeps/modules-context-hash.c clang/test/ClangScanDeps/modules-dep-args.c clang/test/ClangScanDeps/modules-extern-submodule.c clang/test/ClangScanDeps/modules-file-path-isolation.c clang/test/ClangScanDeps/modules-full-by-mod-name.c clang/test/ClangScanDeps/modules-full.cpp clang/test/ClangScanDeps/modules-incomplete-umbrella.c clang/test/ClangScanDeps/modules-no-undeclared-includes.c clang/test/ClangScanDeps/modules-pch-common-submodule.c clang/test/ClangScanDeps/modules-pch-common-via-submodule.c clang/test/ClangScanDeps/modules-pch.c clang/test/ClangScanDeps/modules-symlink-dir-vfs.c clang/test/ClangScanDeps/modules-transitive.c clang/test/ClangScanDeps/removed-args.c clang/tools/clang-scan-deps/ClangScanDeps.cpp
``````````

</details>

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

``````````diff
diff --git a/clang/lib/Serialization/ASTReader.cpp b/clang/lib/Serialization/ASTReader.cpp
index acccf77a5b..77a823d45a 100644
--- a/clang/lib/Serialization/ASTReader.cpp
+++ b/clang/lib/Serialization/ASTReader.cpp
@@ -2714,7 +2714,7 @@ InputFile ASTReader::getInputFile(ModuleFile &F, unsigned ID, bool Complain) {
       // Print the import stack.
       if (ImportStack.size() > 1) {
         Diag(diag::note_pch_required_by)
-          << *Filename << ImportStack[0]->FileName;
+            << *Filename << ImportStack[0]->FileName;
         for (unsigned I = 1; I < ImportStack.size(); ++I)
           Diag(diag::note_pch_required_by)
             << ImportStack[I-1]->FileName << ImportStack[I]->FileName;

``````````

</details>


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


More information about the cfe-commits mailing list