[clang-tools-extra] [clangd] [Modules] Add VFS to ASTUnit::LoadFromASTFile (PR #113879)
via cfe-commits
cfe-commits at lists.llvm.org
Mon Oct 28 01:58:43 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 5155c38ceef019f3225c5eaeba6b986e2430752f b6abb7365c439eaf631b04ee31dd8426df009ec5 --extensions cpp -- clang-tools-extra/clangd/ModulesBuilder.cpp
``````````
</details>
<details>
<summary>
View the diff from clang-format here.
</summary>
``````````diff
diff --git a/clang-tools-extra/clangd/ModulesBuilder.cpp b/clang-tools-extra/clangd/ModulesBuilder.cpp
index 83df35acbc..d1b6fb48f6 100644
--- a/clang-tools-extra/clangd/ModulesBuilder.cpp
+++ b/clang-tools-extra/clangd/ModulesBuilder.cpp
@@ -127,11 +127,10 @@ struct ModuleFile {
std::string ModuleFilePath;
};
-bool IsModuleFileUpToDate(
- PathRef ModuleFilePath,
- const PrerequisiteModules &RequisiteModules,
- const CompilerInvocation &CI,
- llvm::IntrusiveRefCntPtr<llvm::vfs::FileSystem> VFS) {
+bool IsModuleFileUpToDate(PathRef ModuleFilePath,
+ const PrerequisiteModules &RequisiteModules,
+ const CompilerInvocation &CI,
+ llvm::IntrusiveRefCntPtr<llvm::vfs::FileSystem> VFS) {
CompilerInstance Clang;
Clang.setInvocation(std::make_shared<CompilerInvocation>(CI));
@@ -157,7 +156,8 @@ bool IsModuleFileUpToDate(
return false;
if (Reader->ReadAST(ModuleFilePath, serialization::MK_MainFile,
- SourceLocation(), ASTReader::ARR_None) != ASTReader::Success)
+ SourceLocation(),
+ ASTReader::ARR_None) != ASTReader::Success)
return false;
bool UpToDate = true;
@@ -177,12 +177,12 @@ bool IsModuleFileUpToDate(
bool IsModuleFilesUpToDate(
llvm::SmallVector<PathRef> ModuleFilePaths,
- const PrerequisiteModules &RequisiteModules,
- const CompilerInvocation &CI,
+ const PrerequisiteModules &RequisiteModules, const CompilerInvocation &CI,
llvm::IntrusiveRefCntPtr<llvm::vfs::FileSystem> VFS) {
- return llvm::all_of(ModuleFilePaths, [&RequisiteModules, &CI, VFS](auto ModuleFilePath) {
- return IsModuleFileUpToDate(ModuleFilePath, RequisiteModules, CI, VFS);
- });
+ return llvm::all_of(
+ ModuleFilePaths, [&RequisiteModules, &CI, VFS](auto ModuleFilePath) {
+ return IsModuleFileUpToDate(ModuleFilePath, RequisiteModules, CI, VFS);
+ });
}
// StandalonePrerequisiteModules - stands for PrerequisiteModules for which all
``````````
</details>
https://github.com/llvm/llvm-project/pull/113879
More information about the cfe-commits
mailing list