@@ -973,12 +973,10 @@ OptionalFileEntryRef HeaderSearch::LookupFile(
973973 const HeaderFileInfo *FromHFI = getExistingFileInfo (*Includer);
974974 assert (FromHFI && " includer without file info" );
975975 unsigned DirInfo = FromHFI->DirInfo ;
976- bool IndexHeaderMapHeader = FromHFI->IndexHeaderMapHeader ;
977976 StringRef Framework = FromHFI->Framework ;
978977
979978 HeaderFileInfo &ToHFI = getFileInfo (*FE);
980979 ToHFI.DirInfo = DirInfo;
981- ToHFI.IndexHeaderMapHeader = IndexHeaderMapHeader;
982980 ToHFI.Framework = Framework;
983981
984982 if (SearchPath) {
@@ -1124,14 +1122,7 @@ OptionalFileEntryRef HeaderSearch::LookupFile(
11241122 // Set the `Framework` info if this file is in a header map with framework
11251123 // style include spelling or found in a framework dir. The header map case
11261124 // is possible when building frameworks which use header maps.
1127- if (CurDir->isHeaderMap () && isAngled) {
1128- size_t SlashPos = Filename.find (' /' );
1129- if (SlashPos != StringRef::npos)
1130- HFI.Framework =
1131- getUniqueFrameworkName (StringRef (Filename.begin (), SlashPos));
1132- if (CurDir->isIndexHeaderMap ())
1133- HFI.IndexHeaderMapHeader = 1 ;
1134- } else if (CurDir->isFramework ()) {
1125+ if ((CurDir->isHeaderMap () && isAngled) || CurDir->isFramework ()) {
11351126 size_t SlashPos = Filename.find (' /' );
11361127 if (SlashPos != StringRef::npos)
11371128 HFI.Framework =
@@ -1155,41 +1146,6 @@ OptionalFileEntryRef HeaderSearch::LookupFile(
11551146 return File;
11561147 }
11571148
1158- // If we are including a file with a quoted include "foo.h" from inside
1159- // a header in a framework that is currently being built, and we couldn't
1160- // resolve "foo.h" any other way, change the include to <Foo/foo.h>, where
1161- // "Foo" is the name of the framework in which the including header was found.
1162- if (!Includers.empty () && Includers.front ().first && !isAngled &&
1163- !Filename.contains (' /' )) {
1164- const HeaderFileInfo *IncludingHFI =
1165- getExistingFileInfo (*Includers.front ().first );
1166- assert (IncludingHFI && " includer without file info" );
1167- if (IncludingHFI->IndexHeaderMapHeader ) {
1168- SmallString<128 > ScratchFilename;
1169- ScratchFilename += IncludingHFI->Framework ;
1170- ScratchFilename += ' /' ;
1171- ScratchFilename += Filename;
1172-
1173- OptionalFileEntryRef File = LookupFile (
1174- ScratchFilename, IncludeLoc, /* isAngled=*/ true , FromDir, &CurDir,
1175- Includers.front (), SearchPath, RelativePath, RequestingModule,
1176- SuggestedModule, IsMapped, /* IsFrameworkFound=*/ nullptr );
1177-
1178- if (checkMSVCHeaderSearch (Diags, MSFE,
1179- File ? &File->getFileEntry () : nullptr ,
1180- IncludeLoc)) {
1181- if (SuggestedModule)
1182- *SuggestedModule = MSSuggestedModule;
1183- return MSFE;
1184- }
1185-
1186- cacheLookupSuccess (LookupFileCache[Filename],
1187- LookupFileCache[ScratchFilename].HitIt , IncludeLoc);
1188- // FIXME: SuggestedModule.
1189- return File;
1190- }
1191- }
1192-
11931149 if (checkMSVCHeaderSearch (Diags, MSFE, nullptr , IncludeLoc)) {
11941150 if (SuggestedModule)
11951151 *SuggestedModule = MSSuggestedModule;
@@ -1357,7 +1313,6 @@ static void mergeHeaderFileInfo(HeaderFileInfo &HFI,
13571313 HFI.DirInfo = OtherHFI.DirInfo ;
13581314 HFI.External = (!HFI.IsValid || HFI.External );
13591315 HFI.IsValid = true ;
1360- HFI.IndexHeaderMapHeader = OtherHFI.IndexHeaderMapHeader ;
13611316
13621317 if (HFI.Framework .empty ())
13631318 HFI.Framework = OtherHFI.Framework ;
0 commit comments