aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Lex/HeaderSearch.cpp
diff options
context:
space:
mode:
authorJan Svoboda <jan_svoboda@apple.com>2024-10-31 16:33:28 -0700
committerGitHub <noreply@github.com>2024-10-31 16:33:28 -0700
commite494e2694a90ac6fb18976b8cb6aab849b6279b4 (patch)
tree4e913a6a569b763e0928ece53de9f38c851728ec /clang/lib/Lex/HeaderSearch.cpp
parenta1987beac58765b7df9690eb898c14f629449210 (diff)
downloadllvm-e494e2694a90ac6fb18976b8cb6aab849b6279b4.zip
llvm-e494e2694a90ac6fb18976b8cb6aab849b6279b4.tar.gz
llvm-e494e2694a90ac6fb18976b8cb6aab849b6279b4.tar.bz2
[clang][lex] Remove `HeaderFileInfo::Framework` (#114460)
This PR removes the `HeaderFileInfo::Framework` member and reduces the size of this data type from 32B to 16B. This should improve Clang's memory usage in situations where it keeps track of lots of header files. NFCI. Depends on #114459.
Diffstat (limited to 'clang/lib/Lex/HeaderSearch.cpp')
-rw-r--r--clang/lib/Lex/HeaderSearch.cpp15
1 files changed, 0 insertions, 15 deletions
diff --git a/clang/lib/Lex/HeaderSearch.cpp b/clang/lib/Lex/HeaderSearch.cpp
index fb53c13..c5614a8 100644
--- a/clang/lib/Lex/HeaderSearch.cpp
+++ b/clang/lib/Lex/HeaderSearch.cpp
@@ -974,11 +974,9 @@ OptionalFileEntryRef HeaderSearch::LookupFile(
const HeaderFileInfo *FromHFI = getExistingFileInfo(*Includer);
assert(FromHFI && "includer without file info");
unsigned DirInfo = FromHFI->DirInfo;
- StringRef Framework = FromHFI->Framework;
HeaderFileInfo &ToHFI = getFileInfo(*FE);
ToHFI.DirInfo = DirInfo;
- ToHFI.Framework = Framework;
if (SearchPath) {
StringRef SearchPathRef(IncluderAndDir.second.getName());
@@ -1120,16 +1118,6 @@ OptionalFileEntryRef HeaderSearch::LookupFile(
}
}
- // Set the `Framework` info if this file is in a header map with framework
- // style include spelling or found in a framework dir. The header map case
- // is possible when building frameworks which use header maps.
- if ((CurDir->isHeaderMap() && isAngled) || CurDir->isFramework()) {
- size_t SlashPos = Filename.find('/');
- if (SlashPos != StringRef::npos)
- HFI.Framework =
- getUniqueFrameworkName(StringRef(Filename.begin(), SlashPos));
- }
-
if (checkMSVCHeaderSearch(Diags, MSFE, &File->getFileEntry(), IncludeLoc)) {
if (SuggestedModule)
*SuggestedModule = MSSuggestedModule;
@@ -1314,9 +1302,6 @@ static void mergeHeaderFileInfo(HeaderFileInfo &HFI,
HFI.DirInfo = OtherHFI.DirInfo;
HFI.External = (!HFI.IsValid || HFI.External);
HFI.IsValid = true;
-
- if (HFI.Framework.empty())
- HFI.Framework = OtherHFI.Framework;
}
HeaderFileInfo &HeaderSearch::getFileInfo(FileEntryRef FE) {