aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Lex/HeaderSearch.cpp
diff options
context:
space:
mode:
authorCyndy Ishida <cyndy_ishida@apple.com>2021-10-15 08:12:54 -0700
committerCyndy Ishida <cyndy_ishida@apple.com>2021-10-15 09:12:31 -0700
commit395e1fe3057482576eb0bc38d1079fcc1ff29193 (patch)
tree525f84e24bc27fe7fac19d47916238045d924676 /clang/lib/Lex/HeaderSearch.cpp
parentc294715e2e0c90761e69fd3a7db221601289d803 (diff)
downloadllvm-395e1fe3057482576eb0bc38d1079fcc1ff29193.zip
llvm-395e1fe3057482576eb0bc38d1079fcc1ff29193.tar.gz
llvm-395e1fe3057482576eb0bc38d1079fcc1ff29193.tar.bz2
[clang] Capture Framework when HeaderSearch is resolved via headermap
When building frameworks, headermaps responsible for mapping angle-included headers to their source file location are passed via `-I` and not `-index-header-map`. Also, `-index-header-map` is only used for indexing purposes and not during most builds. This patch holds on to the framework's name in HeaderFileInfo as this is retrieveable for cases outside of IndexHeaderMaps and still represents the framework that is being built. resolves: rdar://84046893 Reviewed By: jansvoboda11 Differential Revision: https://reviews.llvm.org/D111468
Diffstat (limited to 'clang/lib/Lex/HeaderSearch.cpp')
-rw-r--r--clang/lib/Lex/HeaderSearch.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/clang/lib/Lex/HeaderSearch.cpp b/clang/lib/Lex/HeaderSearch.cpp
index b2fc2d4..866ebb1 100644
--- a/clang/lib/Lex/HeaderSearch.cpp
+++ b/clang/lib/Lex/HeaderSearch.cpp
@@ -1005,13 +1005,13 @@ Optional<FileEntryRef> HeaderSearch::LookupFile(
// If this file is found in a header map and uses the framework style of
// includes, then this header is part of a framework we're building.
- if (CurDir->isIndexHeaderMap()) {
+ if (CurDir->isHeaderMap() && isAngled) {
size_t SlashPos = Filename.find('/');
- if (SlashPos != StringRef::npos) {
+ if (SlashPos != StringRef::npos)
+ HFI.Framework =
+ getUniqueFrameworkName(StringRef(Filename.begin(), SlashPos));
+ if (CurDir->isIndexHeaderMap())
HFI.IndexHeaderMapHeader = 1;
- HFI.Framework = getUniqueFrameworkName(StringRef(Filename.begin(),
- SlashPos));
- }
}
if (checkMSVCHeaderSearch(Diags, MSFE ? &MSFE->getFileEntry() : nullptr,