[clang] [llvm] [clang][DependencyScanner] Remove unused -ivfsoverlay files (PR #73734)
via llvm-commits
llvm-commits at lists.llvm.org
Thu Jan 25 00:06:20 PST 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 df08350dcfc515c5a7c08e1e08047467263cb701 3c7f36b087e09e1b7ab3231e8267bcdd8400fac4 -- clang/include/clang/Basic/FileManager.h clang/include/clang/Lex/HeaderSearch.h clang/include/clang/Serialization/ASTBitCodes.h clang/include/clang/Serialization/ASTReader.h clang/include/clang/Serialization/ModuleFile.h clang/include/clang/Tooling/DependencyScanning/DependencyScanningFilesystem.h clang/include/clang/Tooling/DependencyScanning/DependencyScanningService.h clang/lib/Basic/FileManager.cpp clang/lib/Frontend/CompilerInvocation.cpp clang/lib/Lex/HeaderSearch.cpp clang/lib/Serialization/ASTReader.cpp clang/lib/Serialization/ASTWriter.cpp clang/lib/Tooling/DependencyScanning/DependencyScanningFilesystem.cpp clang/lib/Tooling/DependencyScanning/DependencyScanningWorker.cpp clang/lib/Tooling/DependencyScanning/ModuleDepCollector.cpp clang/tools/clang-scan-deps/ClangScanDeps.cpp llvm/include/llvm/Support/VirtualFileSystem.h llvm/lib/Support/VirtualFileSystem.cpp llvm/unittests/Support/VirtualFileSystemTest.cpp
``````````
</details>
<details>
<summary>
View the diff from clang-format here.
</summary>
``````````diff
diff --git a/clang/include/clang/Serialization/ASTReader.h b/clang/include/clang/Serialization/ASTReader.h
index 117f50e3b7..c09869934b 100644
--- a/clang/include/clang/Serialization/ASTReader.h
+++ b/clang/include/clang/Serialization/ASTReader.h
@@ -1780,13 +1780,13 @@ public:
/// Read the control block for the named AST file.
///
/// \returns true if an error occurred, false otherwise.
- static bool readASTFileControlBlock(StringRef Filename, FileManager &FileMgr,
- const InMemoryModuleCache &ModuleCache,
- const PCHContainerReader &PCHContainerRdr,
- bool FindModuleFileExtensions,
- ASTReaderListener &Listener,
- bool ValidateDiagnosticOptions,
- unsigned DefaultClientLoadCapabilities = ARR_ConfigurationMismatch | ARR_OutOfDate);
+ static bool readASTFileControlBlock(
+ StringRef Filename, FileManager &FileMgr,
+ const InMemoryModuleCache &ModuleCache,
+ const PCHContainerReader &PCHContainerRdr, bool FindModuleFileExtensions,
+ ASTReaderListener &Listener, bool ValidateDiagnosticOptions,
+ unsigned DefaultClientLoadCapabilities = ARR_ConfigurationMismatch |
+ ARR_OutOfDate);
/// Determine whether the given AST file is acceptable to load into a
/// translation unit with the given language and target options.
diff --git a/clang/include/clang/Tooling/DependencyScanning/DependencyScanningService.h b/clang/include/clang/Tooling/DependencyScanning/DependencyScanningService.h
index b1409f9d6a..4f9867262a 100644
--- a/clang/include/clang/Tooling/DependencyScanning/DependencyScanningService.h
+++ b/clang/include/clang/Tooling/DependencyScanning/DependencyScanningService.h
@@ -45,8 +45,8 @@ enum class ScanningOutputFormat {
P1689,
};
-#define DSS_LAST_BITMASK_ENUM(Id) LLVM_MARK_AS_BITMASK_ENUM(Id), \
- All = llvm::NextPowerOf2(Id) - 1
+#define DSS_LAST_BITMASK_ENUM(Id) \
+ LLVM_MARK_AS_BITMASK_ENUM(Id), All = llvm::NextPowerOf2(Id) - 1
enum class ScanningOptimizations {
None = 0,
diff --git a/clang/lib/Serialization/ASTWriter.cpp b/clang/lib/Serialization/ASTWriter.cpp
index 8e61caedf9..8fc6e726c1 100644
--- a/clang/lib/Serialization/ASTWriter.cpp
+++ b/clang/lib/Serialization/ASTWriter.cpp
@@ -4701,7 +4701,8 @@ void ASTWriter::collectNonAffectingInputFiles() {
FileManager &FileMgr = PP->getFileManager();
FileMgr.trackVFSUsage(true);
- for (StringRef Path : PP->getHeaderSearchInfo().getHeaderSearchOpts().VFSOverlayFiles)
+ for (StringRef Path :
+ PP->getHeaderSearchInfo().getHeaderSearchOpts().VFSOverlayFiles)
FileMgr.getVirtualFileSystem().exists(Path);
for (unsigned I = 1; I != N; ++I) {
@@ -4720,7 +4721,8 @@ void ASTWriter::collectNonAffectingInputFiles() {
AffectingModuleMaps.empty() ||
llvm::is_contained(AffectingModuleMaps, *Cache->OrigEntry)) {
// Lookup the path in the VFS to trigger `-ivfsoverlay` usage tracking.
- FileMgr.getVirtualFileSystem().exists(File.getContentCache().OrigEntry->getNameAsRequested());
+ FileMgr.getVirtualFileSystem().exists(
+ File.getContentCache().OrigEntry->getNameAsRequested());
continue;
}
diff --git a/clang/lib/Tooling/DependencyScanning/DependencyScanningWorker.cpp b/clang/lib/Tooling/DependencyScanning/DependencyScanningWorker.cpp
index d5511ef3c9..7f54f36eff 100644
--- a/clang/lib/Tooling/DependencyScanning/DependencyScanningWorker.cpp
+++ b/clang/lib/Tooling/DependencyScanning/DependencyScanningWorker.cpp
@@ -94,8 +94,7 @@ public:
PrebuiltModuleListener(PrebuiltModuleFilesT &PrebuiltModuleFiles,
llvm::SmallVector<std::string> &NewModuleFiles,
const HeaderSearchOptions &HSOpts,
- const LangOptions &LangOpts,
- DiagnosticsEngine &Diags)
+ const LangOptions &LangOpts, DiagnosticsEngine &Diags)
: PrebuiltModuleFiles(PrebuiltModuleFiles),
NewModuleFiles(NewModuleFiles), ExistingHSOpts(HSOpts),
ExistingLangOpts(LangOpts), Diags(Diags) {}
@@ -108,8 +107,9 @@ public:
}
bool ReadHeaderSearchPaths(const HeaderSearchOptions &HSOpts,
- bool Complain) override {
- return checkHeaderSearchPaths(HSOpts, ExistingHSOpts, Complain ? &Diags : nullptr, ExistingLangOpts);
+ bool Complain) override {
+ return checkHeaderSearchPaths(
+ HSOpts, ExistingHSOpts, Complain ? &Diags : nullptr, ExistingLangOpts);
}
private:
@@ -128,21 +128,22 @@ static bool visitPrebuiltModule(StringRef PrebuiltModuleFilename,
DiagnosticsEngine &Diags) {
// List of module files to be processed.
llvm::SmallVector<std::string> Worklist;
- PrebuiltModuleListener Listener(ModuleFiles, Worklist, CI.getHeaderSearchOpts(), CI.getLangOpts(), Diags);
+ PrebuiltModuleListener Listener(
+ ModuleFiles, Worklist, CI.getHeaderSearchOpts(), CI.getLangOpts(), Diags);
if (ASTReader::readASTFileControlBlock(
- PrebuiltModuleFilename, CI.getFileManager(), CI.getModuleCache(),
- CI.getPCHContainerReader(),
- /*FindModuleFileExtensions=*/false, Listener,
- /*ValidateDiagnosticOptions=*/false, ASTReader::ARR_OutOfDate))
+ PrebuiltModuleFilename, CI.getFileManager(), CI.getModuleCache(),
+ CI.getPCHContainerReader(),
+ /*FindModuleFileExtensions=*/false, Listener,
+ /*ValidateDiagnosticOptions=*/false, ASTReader::ARR_OutOfDate))
return true;
while (!Worklist.empty()) {
if (ASTReader::readASTFileControlBlock(
- Worklist.pop_back_val(), CI.getFileManager(), CI.getModuleCache(),
- CI.getPCHContainerReader(),
- /*FindModuleFileExtensions=*/false, Listener,
- /*ValidateDiagnosticOptions=*/false))
+ Worklist.pop_back_val(), CI.getFileManager(), CI.getModuleCache(),
+ CI.getPCHContainerReader(),
+ /*FindModuleFileExtensions=*/false, Listener,
+ /*ValidateDiagnosticOptions=*/false))
return true;
}
return false;
@@ -246,8 +247,10 @@ public:
// force reuse of the existing prebuilt module files instead.
if (!ScanInstance.getPreprocessorOpts().ImplicitPCHInclude.empty())
if (visitPrebuiltModule(
- ScanInstance.getPreprocessorOpts().ImplicitPCHInclude, ScanInstance,
- ScanInstance.getHeaderSearchOpts().PrebuiltModuleFiles, ScanInstance.getDiagnostics()))
+ ScanInstance.getPreprocessorOpts().ImplicitPCHInclude,
+ ScanInstance,
+ ScanInstance.getHeaderSearchOpts().PrebuiltModuleFiles,
+ ScanInstance.getDiagnostics()))
return false;
// Use the dependency scanning optimized file system if requested to do so.
``````````
</details>
https://github.com/llvm/llvm-project/pull/73734
More information about the llvm-commits
mailing list