Index: lib/Lex/HeaderSearch.cpp =================================================================== --- lib/Lex/HeaderSearch.cpp +++ lib/Lex/HeaderSearch.cpp @@ -690,6 +690,17 @@ } } + // If no includers (as in case of module build), and not an angled + // include, do a final check in the current directory + if (Includers.empty() && !isAngled && !NoCurDirSearch) { + const FileEntry *Result = FileMgr.getFile(Filename, /*openFile=*/true); + if (Result) { + CacheLookup.second + = LookupFileCache.GetOrCreateValue(Filename).getValue().second; + return Result; + } + } + // Otherwise, didn't find it. Remember we didn't find this. CacheLookup.second = SearchDirs.size(); return 0;