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