aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Lex/HeaderSearch.cpp
diff options
context:
space:
mode:
authorAaron Ballman <aaron@aaronballman.com>2023-12-07 08:24:46 -0500
committerAaron Ballman <aaron@aaronballman.com>2023-12-07 08:26:33 -0500
commit3293c088c25db5be6042d20bd95c80a0863a88d0 (patch)
tree660415f8666bac4f283832274a3699c941fe2913 /clang/lib/Lex/HeaderSearch.cpp
parent6a1badfed2dcd438d94a35cc4ab3b38c7cc06208 (diff)
downloadllvm-3293c088c25db5be6042d20bd95c80a0863a88d0.zip
llvm-3293c088c25db5be6042d20bd95c80a0863a88d0.tar.gz
llvm-3293c088c25db5be6042d20bd95c80a0863a88d0.tar.bz2
Remove dead code; NFC
This code was added 17 years ago but never enabled or tested. GCC warns that -I- is deprecated for them, and Clang gives an error when passed -I-, so we may as well remove this code rather than hook it up to the driver and maintain it.
Diffstat (limited to 'clang/lib/Lex/HeaderSearch.cpp')
-rw-r--r--clang/lib/Lex/HeaderSearch.cpp15
1 files changed, 7 insertions, 8 deletions
diff --git a/clang/lib/Lex/HeaderSearch.cpp b/clang/lib/Lex/HeaderSearch.cpp
index cf1c0cc..c03cf19 100644
--- a/clang/lib/Lex/HeaderSearch.cpp
+++ b/clang/lib/Lex/HeaderSearch.cpp
@@ -105,7 +105,7 @@ void HeaderSearch::PrintStats() {
void HeaderSearch::SetSearchPaths(
std::vector<DirectoryLookup> dirs, unsigned int angledDirIdx,
- unsigned int systemDirIdx, bool noCurDirSearch,
+ unsigned int systemDirIdx,
llvm::DenseMap<unsigned int, unsigned int> searchDirToHSEntry) {
assert(angledDirIdx <= systemDirIdx && systemDirIdx <= dirs.size() &&
"Directory indices are unordered");
@@ -113,7 +113,6 @@ void HeaderSearch::SetSearchPaths(
SearchDirsUsage.assign(SearchDirs.size(), false);
AngledDirIdx = angledDirIdx;
SystemDirIdx = systemDirIdx;
- NoCurDirSearch = noCurDirSearch;
SearchDirToHSEntry = std::move(searchDirToHSEntry);
//LookupFileCache.clear();
indexInitialHeaderMaps();
@@ -904,12 +903,12 @@ OptionalFileEntryRef HeaderSearch::LookupFile(
ModuleMap::KnownHeader MSSuggestedModule;
OptionalFileEntryRef MSFE;
- // Unless disabled, check to see if the file is in the #includer's
- // directory. This cannot be based on CurDir, because each includer could be
- // a #include of a subdirectory (#include "foo/bar.h") and a subsequent
- // include of "baz.h" should resolve to "whatever/foo/baz.h".
- // This search is not done for <> headers.
- if (!Includers.empty() && !isAngled && !NoCurDirSearch) {
+ // Check to see if the file is in the #includer's directory. This cannot be
+ // based on CurDir, because each includer could be a #include of a
+ // subdirectory (#include "foo/bar.h") and a subsequent include of "baz.h"
+ // should resolve to "whatever/foo/baz.h". This search is not done for <>
+ // headers.
+ if (!Includers.empty() && !isAngled) {
SmallString<1024> TmpDir;
bool First = true;
for (const auto &IncluderAndDir : Includers) {