@@ -756,9 +756,10 @@ void HeaderSearch::setTarget(const TargetInfo &Target) {
756
756
// / fails to match the one that Clang would have found with MSVC header search
757
757
// / disabled.
758
758
static bool checkMSVCHeaderSearch (DiagnosticsEngine &Diags,
759
- const FileEntry *MSFE, const FileEntry *FE,
759
+ OptionalFileEntryRef MSFE,
760
+ const FileEntry *FE,
760
761
SourceLocation IncludeLoc) {
761
- if (MSFE && FE != MSFE) {
762
+ if (MSFE && FE != * MSFE) {
762
763
Diags.Report (IncludeLoc, diag::ext_pp_include_search_ms) << MSFE->getName ();
763
764
return true ;
764
765
}
@@ -1110,8 +1111,7 @@ OptionalFileEntryRef HeaderSearch::LookupFile(
1110
1111
getUniqueFrameworkName (StringRef (Filename.begin (), SlashPos));
1111
1112
}
1112
1113
1113
- if (checkMSVCHeaderSearch (Diags, MSFE ? &MSFE->getFileEntry () : nullptr ,
1114
- &File->getFileEntry (), IncludeLoc)) {
1114
+ if (checkMSVCHeaderSearch (Diags, MSFE, &File->getFileEntry (), IncludeLoc)) {
1115
1115
if (SuggestedModule)
1116
1116
*SuggestedModule = MSSuggestedModule;
1117
1117
return MSFE;
@@ -1146,7 +1146,7 @@ OptionalFileEntryRef HeaderSearch::LookupFile(
1146
1146
Includers.front (), SearchPath, RelativePath, RequestingModule,
1147
1147
SuggestedModule, IsMapped, /* IsFrameworkFound=*/ nullptr );
1148
1148
1149
- if (checkMSVCHeaderSearch (Diags, MSFE ? &MSFE-> getFileEntry () : nullptr ,
1149
+ if (checkMSVCHeaderSearch (Diags, MSFE,
1150
1150
File ? &File->getFileEntry () : nullptr ,
1151
1151
IncludeLoc)) {
1152
1152
if (SuggestedModule)
@@ -1161,8 +1161,7 @@ OptionalFileEntryRef HeaderSearch::LookupFile(
1161
1161
}
1162
1162
}
1163
1163
1164
- if (checkMSVCHeaderSearch (Diags, MSFE ? &MSFE->getFileEntry () : nullptr ,
1165
- nullptr , IncludeLoc)) {
1164
+ if (checkMSVCHeaderSearch (Diags, MSFE, nullptr , IncludeLoc)) {
1166
1165
if (SuggestedModule)
1167
1166
*SuggestedModule = MSSuggestedModule;
1168
1167
return MSFE;
0 commit comments