[NFC] [clangd] [C++20] [Modules] Rename and move scanningProjectModules (#193128)
I am going to add more stuff to ProjectModules and the current structure and the file name scanningProjectModules may be confusing. This NFC patch changes that.
This commit is contained in:
parent
b906cf354b
commit
4acbf99789
6 changed files with 13 additions and 33 deletions
|
|
@ -98,12 +98,12 @@ add_clang_library(clangDaemon STATIC
|
|||
JSONTransport.cpp
|
||||
ModulesBuilder.cpp
|
||||
PathMapping.cpp
|
||||
ProjectModules.cpp
|
||||
Protocol.cpp
|
||||
Quality.cpp
|
||||
ParsedAST.cpp
|
||||
Preamble.cpp
|
||||
RIFF.cpp
|
||||
ScanningProjectModules.cpp
|
||||
Selection.cpp
|
||||
SemanticHighlighting.cpp
|
||||
SemanticSelection.cpp
|
||||
|
|
|
|||
|
|
@ -10,7 +10,6 @@
|
|||
#include "Config.h"
|
||||
#include "FS.h"
|
||||
#include "ProjectModules.h"
|
||||
#include "ScanningProjectModules.h"
|
||||
#include "SourceCode.h"
|
||||
#include "support/Logger.h"
|
||||
#include "support/Path.h"
|
||||
|
|
@ -772,7 +771,7 @@ DirectoryBasedGlobalCompilationDatabase::getProjectModules(PathRef File) const {
|
|||
if (!Res)
|
||||
return {};
|
||||
|
||||
return scanningProjectModules(Res->CDB, Opts.TFS);
|
||||
return clang::clangd::getProjectModules(Res->CDB, Opts.TFS);
|
||||
}
|
||||
|
||||
OverlayCDB::OverlayCDB(const GlobalCompilationDatabase *Base,
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
//===------------------ ProjectModules.h -------------------------*- C++-*-===//
|
||||
//===------------------ ProjectModules.cpp -------------------------*-
|
||||
//C++-*-===//
|
||||
//
|
||||
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
|
||||
// See https://llvm.org/LICENSE.txt for license information.
|
||||
|
|
@ -231,7 +232,7 @@ private:
|
|||
CommandMangler Mangler;
|
||||
};
|
||||
|
||||
std::unique_ptr<ProjectModules> scanningProjectModules(
|
||||
std::unique_ptr<ProjectModules> getProjectModules(
|
||||
std::shared_ptr<const clang::tooling::CompilationDatabase> CDB,
|
||||
const ThreadsafeFS &TFS) {
|
||||
return std::make_unique<ScanningAllProjectModules>(CDB, TFS);
|
||||
|
|
@ -51,6 +51,11 @@ public:
|
|||
virtual ~ProjectModules() = default;
|
||||
};
|
||||
|
||||
/// Providing modules information for the project by scanning every file.
|
||||
std::unique_ptr<ProjectModules> getProjectModules(
|
||||
std::shared_ptr<const clang::tooling::CompilationDatabase> CDB,
|
||||
const ThreadsafeFS &TFS);
|
||||
|
||||
} // namespace clangd
|
||||
} // namespace clang
|
||||
|
||||
|
|
|
|||
|
|
@ -1,26 +0,0 @@
|
|||
//===------------ ScanningProjectModules.h -----------------------*- C++-*-===//
|
||||
//
|
||||
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
|
||||
// See https://llvm.org/LICENSE.txt for license information.
|
||||
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANGD_SCANNINGPROJECTMODULES_H
|
||||
#define LLVM_CLANG_TOOLS_EXTRA_CLANGD_SCANNINGPROJECTMODULES_H
|
||||
|
||||
#include "ProjectModules.h"
|
||||
#include "clang/Tooling/CompilationDatabase.h"
|
||||
|
||||
namespace clang {
|
||||
namespace clangd {
|
||||
|
||||
/// Providing modules information for the project by scanning every file.
|
||||
std::unique_ptr<ProjectModules> scanningProjectModules(
|
||||
std::shared_ptr<const clang::tooling::CompilationDatabase> CDB,
|
||||
const ThreadsafeFS &TFS);
|
||||
|
||||
} // namespace clangd
|
||||
} // namespace clang
|
||||
|
||||
#endif
|
||||
|
|
@ -15,7 +15,7 @@
|
|||
#include "CodeComplete.h"
|
||||
#include "Compiler.h"
|
||||
#include "ModulesBuilder.h"
|
||||
#include "ScanningProjectModules.h"
|
||||
#include "ProjectModules.h"
|
||||
#include "TestTU.h"
|
||||
#include "support/Path.h"
|
||||
#include "support/ThreadsafeFS.h"
|
||||
|
|
@ -73,7 +73,8 @@ public:
|
|||
|
||||
std::unique_ptr<ProjectModules> getProjectModules(PathRef) const override {
|
||||
return std::make_unique<GlobalScanningCounterProjectModules>(
|
||||
scanningProjectModules(MockedCDBPtr, TFS), GlobalScanningCount);
|
||||
clang::clangd::getProjectModules(MockedCDBPtr, TFS),
|
||||
GlobalScanningCount);
|
||||
}
|
||||
|
||||
unsigned getGlobalScanningCount() const { return GlobalScanningCount; }
|
||||
|
|
|
|||
Loading…
Reference in a new issue