[clang] d5ba066 - [clang][lex] NFC: Move some HeaderSearch functions to .cpp file
Jan Svoboda via cfe-commits
cfe-commits at lists.llvm.org
Thu Jan 6 07:32:07 PST 2022
Author: Jan Svoboda
Date: 2022-01-06T16:32:02+01:00
New Revision: d5ba066cb6641d1923dca90bb4e1a1cecbcd02b7
URL: https://github.com/llvm/llvm-project/commit/d5ba066cb6641d1923dca90bb4e1a1cecbcd02b7
DIFF: https://github.com/llvm/llvm-project/commit/d5ba066cb6641d1923dca90bb4e1a1cecbcd02b7.diff
LOG: [clang][lex] NFC: Move some HeaderSearch functions to .cpp file
Added:
Modified:
clang/include/clang/Lex/HeaderSearch.h
clang/lib/Lex/HeaderSearch.cpp
Removed:
################################################################################
diff --git a/clang/include/clang/Lex/HeaderSearch.h b/clang/include/clang/Lex/HeaderSearch.h
index b3445703f7823..0482bf6c053f1 100644
--- a/clang/include/clang/Lex/HeaderSearch.h
+++ b/clang/include/clang/Lex/HeaderSearch.h
@@ -281,27 +281,10 @@ class HeaderSearch {
/// Interface for setting the file search paths.
void SetSearchPaths(std::vector<DirectoryLookup> dirs, unsigned angledDirIdx,
unsigned systemDirIdx, bool noCurDirSearch,
- llvm::DenseMap<unsigned, unsigned> searchDirToHSEntry) {
- assert(angledDirIdx <= systemDirIdx && systemDirIdx <= dirs.size() &&
- "Directory indices are unordered");
- SearchDirs = std::move(dirs);
- SearchDirsUsage.assign(SearchDirs.size(), false);
- AngledDirIdx = angledDirIdx;
- SystemDirIdx = systemDirIdx;
- NoCurDirSearch = noCurDirSearch;
- SearchDirToHSEntry = std::move(searchDirToHSEntry);
- //LookupFileCache.clear();
- }
+ llvm::DenseMap<unsigned, unsigned> searchDirToHSEntry);
/// Add an additional search path.
- void AddSearchPath(const DirectoryLookup &dir, bool isAngled) {
- unsigned idx = isAngled ? SystemDirIdx : AngledDirIdx;
- SearchDirs.insert(SearchDirs.begin() + idx, dir);
- SearchDirsUsage.insert(SearchDirsUsage.begin() + idx, false);
- if (!isAngled)
- AngledDirIdx++;
- SystemDirIdx++;
- }
+ void AddSearchPath(const DirectoryLookup &dir, bool isAngled);
/// Set the list of system header prefixes.
void SetSystemHeaderPrefixes(ArrayRef<std::pair<std::string, bool>> P) {
diff --git a/clang/lib/Lex/HeaderSearch.cpp b/clang/lib/Lex/HeaderSearch.cpp
index 5cb009dd68d1d..f9d61ecef7964 100644
--- a/clang/lib/Lex/HeaderSearch.cpp
+++ b/clang/lib/Lex/HeaderSearch.cpp
@@ -109,6 +109,30 @@ void HeaderSearch::PrintStats() {
<< NumSubFrameworkLookups << " subframework lookups.\n";
}
+void HeaderSearch::SetSearchPaths(
+ std::vector<DirectoryLookup> dirs, unsigned int angledDirIdx,
+ unsigned int systemDirIdx, bool noCurDirSearch,
+ llvm::DenseMap<unsigned int, unsigned int> searchDirToHSEntry) {
+ assert(angledDirIdx <= systemDirIdx && systemDirIdx <= dirs.size() &&
+ "Directory indices are unordered");
+ SearchDirs = std::move(dirs);
+ SearchDirsUsage.assign(SearchDirs.size(), false);
+ AngledDirIdx = angledDirIdx;
+ SystemDirIdx = systemDirIdx;
+ NoCurDirSearch = noCurDirSearch;
+ SearchDirToHSEntry = std::move(searchDirToHSEntry);
+ //LookupFileCache.clear();
+}
+
+void HeaderSearch::AddSearchPath(const DirectoryLookup &dir, bool isAngled) {
+ unsigned idx = isAngled ? SystemDirIdx : AngledDirIdx;
+ SearchDirs.insert(SearchDirs.begin() + idx, dir);
+ SearchDirsUsage.insert(SearchDirsUsage.begin() + idx, false);
+ if (!isAngled)
+ AngledDirIdx++;
+ SystemDirIdx++;
+}
+
std::vector<bool> HeaderSearch::computeUserEntryUsage() const {
std::vector<bool> UserEntryUsage(HSOpts->UserEntries.size());
for (unsigned I = 0, E = SearchDirsUsage.size(); I < E; ++I) {
More information about the cfe-commits
mailing list