24 #include "llvm/ADT/APInt.h"
25 #include "llvm/ADT/Hashing.h"
26 #include "llvm/ADT/SmallString.h"
27 #include "llvm/Support/Capacity.h"
28 #include "llvm/Support/FileSystem.h"
29 #include "llvm/Support/Path.h"
30 #include "llvm/Support/raw_ostream.h"
32 #if defined(LLVM_ON_UNIX)
35 using namespace clang;
59 : HSOpts(HSOpts), Diags(Diags), FileMgr(SourceMgr.getFileManager()),
60 FrameworkMap(64), ModMap(SourceMgr, Diags, LangOpts, Target, *this),
64 NoCurDirSearch =
false;
66 ExternalLookup =
nullptr;
67 ExternalSource =
nullptr;
69 NumMultiIncludeFileOptzn = 0;
70 NumFrameworkLookups = NumSubFrameworkLookups = 0;
75 for (
unsigned i = 0, e = HeaderMaps.size(); i != e; ++i)
76 delete HeaderMaps[i].second;
80 fprintf(stderr,
"\n*** HeaderSearch Stats:\n");
81 fprintf(stderr,
"%d files tracked.\n", (
int)FileInfo.size());
82 unsigned NumOnceOnlyFiles = 0, MaxNumIncludes = 0, NumSingleIncludedFiles = 0;
83 for (
unsigned i = 0, e = FileInfo.size(); i != e; ++i) {
84 NumOnceOnlyFiles += FileInfo[i].isImport;
85 if (MaxNumIncludes < FileInfo[i].NumIncludes)
86 MaxNumIncludes = FileInfo[i].NumIncludes;
87 NumSingleIncludedFiles += FileInfo[i].NumIncludes == 1;
89 fprintf(stderr,
" %d #import/#pragma once files.\n", NumOnceOnlyFiles);
90 fprintf(stderr,
" %d included exactly once.\n", NumSingleIncludedFiles);
91 fprintf(stderr,
" %d max times a file is included.\n", MaxNumIncludes);
93 fprintf(stderr,
" %d #include/#include_next/#import.\n", NumIncluded);
94 fprintf(stderr,
" %d #includes skipped due to"
95 " the multi-include optimization.\n", NumMultiIncludeFileOptzn);
97 fprintf(stderr,
"%d framework lookups.\n", NumFrameworkLookups);
98 fprintf(stderr,
"%d subframework lookups.\n", NumSubFrameworkLookups);
106 if (!HeaderMaps.empty()) {
107 for (
unsigned i = 0, e = HeaderMaps.size(); i != e; ++i)
110 if (HeaderMaps[i].first == FE)
111 return HeaderMaps[i].second;
115 HeaderMaps.push_back(std::make_pair(FE, HM));
129 StringRef ModuleMapPath) {
131 if (ModuleCachePath.empty())
132 return std::string();
135 llvm::sys::fs::make_absolute(Result);
137 if (HSOpts->DisableModuleHash) {
138 llvm::sys::path::append(Result, ModuleName +
".pcm");
148 FileMgr.
getDirectory(llvm::sys::path::parent_path(ModuleMapPath));
150 return std::string();
152 auto FileName = llvm::sys::path::filename(ModuleMapPath);
154 llvm::hash_code Hash =
155 llvm::hash_combine(DirName.lower(), FileName.lower(),
156 HSOpts->ModuleFormat);
159 llvm::APInt(64,
size_t(Hash)).toStringUnsigned(HashStr, 36);
160 llvm::sys::path::append(Result, ModuleName +
"-" + HashStr +
".pcm");
162 return Result.str().str();
168 if (Module || !AllowSearch || !HSOpts->ImplicitModuleMaps)
173 for (
unsigned Idx = 0, N = SearchDirs.size(); Idx != N; ++Idx) {
174 if (SearchDirs[Idx].isFramework()) {
177 FrameworkDirName += SearchDirs[Idx].getFrameworkDir()->getName();
178 llvm::sys::path::append(FrameworkDirName, ModuleName +
".framework");
183 Module = loadFrameworkModule(ModuleName, FrameworkDir, IsSystem);
192 if (!SearchDirs[Idx].isNormalDir())
195 bool IsSystem = SearchDirs[Idx].isSystemHeaderDirectory();
198 false) == LMM_NewlyLoaded) {
209 NestedModuleMapDirName = SearchDirs[Idx].getDir()->getName();
210 llvm::sys::path::append(NestedModuleMapDirName, ModuleName);
212 false) == LMM_NewlyLoaded){
221 if (SearchDirs[Idx].haveSearchedAllModuleMaps())
226 loadSubdirectoryModuleMaps(SearchDirs[Idx]);
248 assert(
isHeaderMap() &&
"Unknown DirectoryLookup");
259 if (SuggestedModule) {
287 bool &InUserSpecifiedSystemFramework,
290 InUserSpecifiedSystemFramework =
false;
291 HasBeenMapped =
false;
297 llvm::sys::path::append(TmpDir, Filename);
301 SearchPath->append(SearchPathRef.begin(), SearchPathRef.end());
304 RelativePath->clear();
305 RelativePath->append(Filename.begin(), Filename.end());
314 return DoFrameworkLookup(Filename, HS, SearchPath, RelativePath,
315 SuggestedModule, InUserSpecifiedSystemFramework);
317 assert(
isHeaderMap() &&
"Unknown directory lookup");
329 if (llvm::sys::path::is_relative(Dest)) {
331 MappedName.append(Dest.begin(), Dest.end());
332 Filename = StringRef(MappedName.begin(), MappedName.size());
333 HasBeenMapped =
true;
342 StringRef SearchPathRef(
getName());
344 SearchPath->append(SearchPathRef.begin(), SearchPathRef.end());
347 RelativePath->clear();
348 RelativePath->append(Filename.begin(), Filename.end());
363 assert(llvm::sys::path::extension(DirName) ==
".framework" &&
364 "Not a framework directory");
384 DirName = llvm::sys::path::parent_path(DirName);
395 if (llvm::sys::path::extension(DirName) ==
".framework") {
396 SubmodulePath.push_back(llvm::sys::path::stem(DirName));
397 TopFrameworkDir = Dir;
401 return TopFrameworkDir;
406 const FileEntry *DirectoryLookup::DoFrameworkLookup(
412 bool &InUserSpecifiedSystemFramework)
const
417 size_t SlashPos = Filename.find(
'/');
418 if (SlashPos == StringRef::npos)
return nullptr;
422 HeaderSearch::FrameworkCacheEntry &CacheEntry =
434 if (FrameworkName.empty() || FrameworkName.back() !=
'/')
435 FrameworkName.push_back(
'/');
438 StringRef ModuleName(Filename.begin(), SlashPos);
439 FrameworkName += ModuleName;
442 FrameworkName +=
".framework/";
445 if (!CacheEntry.Directory) {
450 if (!Dir)
return nullptr;
460 SystemFrameworkMarker +=
".system_framework";
461 if (llvm::sys::fs::exists(SystemFrameworkMarker)) {
462 CacheEntry.IsUserSpecifiedSystemFramework =
true;
468 InUserSpecifiedSystemFramework = CacheEntry.IsUserSpecifiedSystemFramework;
471 RelativePath->clear();
472 RelativePath->append(Filename.begin()+SlashPos+1, Filename.end());
476 unsigned OrigSize = FrameworkName.size();
478 FrameworkName +=
"Headers/";
483 SearchPath->append(FrameworkName.begin(), FrameworkName.end()-1);
486 FrameworkName.append(Filename.begin()+SlashPos+1, Filename.end());
491 const char *Private =
"Private";
492 FrameworkName.insert(FrameworkName.begin()+OrigSize, Private,
493 Private+strlen(Private));
495 SearchPath->insert(SearchPath->begin()+OrigSize, Private,
496 Private+strlen(Private));
498 FE = FileMgr.
getFile(FrameworkName, !SuggestedModule);
502 if (FE && SuggestedModule) {
505 bool FoundFramework =
false;
514 if (llvm::sys::path::extension(FrameworkPath) ==
".framework") {
515 FoundFramework =
true;
520 FrameworkPath = llvm::sys::path::parent_path(FrameworkPath);
521 if (FrameworkPath.empty())
525 if (FoundFramework) {
532 StringRef ModuleName = llvm::sys::path::stem(TopFrameworkDir->
getName());
537 HS.loadFrameworkModule(ModuleName, TopFrameworkDir, IsSystem);
566 if (MSFE && FE != MSFE) {
567 Diags.
Report(IncludeLoc, diag::ext_pp_include_search_ms) << MSFE->
getName();
573 static const char *
copyString(StringRef Str, llvm::BumpPtrAllocator &Alloc) {
574 assert(!Str.empty());
575 char *CopyStr = Alloc.Allocate<
char>(Str.size()+1);
576 std::copy(Str.begin(), Str.end(), CopyStr);
577 CopyStr[Str.size()] =
'\0';
589 ArrayRef<std::pair<const FileEntry *, const DirectoryEntry *>> Includers,
596 if (llvm::sys::path::is_absolute(Filename)) {
600 if (FromDir)
return nullptr;
605 RelativePath->clear();
606 RelativePath->append(Filename.begin(), Filename.end());
610 if (File && SuggestedModule) {
627 if (!Includers.empty() && !isAngled && !NoCurDirSearch) {
630 for (
const auto &IncluderAndDir : Includers) {
631 const FileEntry *Includer = IncluderAndDir.first;
635 TmpDir = IncluderAndDir.second->getName();
636 TmpDir.push_back(
'/');
637 TmpDir.append(Filename.begin(), Filename.end());
646 bool IncluderIsSystemHeader =
649 *
this, TmpDir, IncluderAndDir.second,
650 IncluderIsSystemHeader, SuggestedModule)) {
652 assert(First &&
"only first includer can have no file");
663 unsigned DirInfo = FromHFI.
DirInfo;
673 StringRef SearchPathRef(IncluderAndDir.second->getName());
675 SearchPath->append(SearchPathRef.begin(), SearchPathRef.end());
678 RelativePath->clear();
679 RelativePath->append(Filename.begin(), Filename.end());
687 if (Diags.
isIgnored(diag::ext_pp_include_search_ms, IncludeLoc)) {
691 if (SuggestedModule) {
692 MSSuggestedModule = *SuggestedModule;
705 unsigned i = isAngled ? AngledDirIdx : 0;
710 i = FromDir-&SearchDirs[0];
716 LookupFileCacheInfo &CacheLookup = LookupFileCache[Filename];
721 if (!SkipCache && CacheLookup.StartIdx == i+1) {
723 i = CacheLookup.HitIdx;
724 if (CacheLookup.MappedName)
725 Filename = CacheLookup.MappedName;
730 CacheLookup.reset(i+1);
736 for (; i != SearchDirs.size(); ++i) {
737 bool InUserSpecifiedSystemFramework =
false;
738 bool HasBeenMapped =
false;
740 SearchDirs[i].LookupFile(Filename, *
this, SearchPath, RelativePath,
741 SuggestedModule, InUserSpecifiedSystemFramework,
742 HasBeenMapped, MappedName);
744 CacheLookup.MappedName =
745 copyString(Filename, LookupFileCache.getAllocator());
749 CurDir = &SearchDirs[i];
763 for (
unsigned j = SystemHeaderPrefixes.size(); j; --j) {
764 if (Filename.startswith(SystemHeaderPrefixes[j-1].first)) {
774 size_t SlashPos = Filename.find(
'/');
775 if (SlashPos != StringRef::npos) {
784 *SuggestedModule = MSSuggestedModule;
789 CacheLookup.HitIdx = i;
797 if (!Includers.empty() && Includers.front().first && !isAngled &&
798 Filename.find(
'/') == StringRef::npos) {
799 HeaderFileInfo &IncludingHFI = getFileInfo(Includers.front().first);
802 ScratchFilename += IncludingHFI.
Framework;
803 ScratchFilename +=
'/';
804 ScratchFilename += Filename;
807 ScratchFilename, IncludeLoc,
true, FromDir, CurDir,
808 Includers.front(), SearchPath, RelativePath, SuggestedModule);
812 *SuggestedModule = MSSuggestedModule;
816 LookupFileCacheInfo &CacheLookup = LookupFileCache[Filename];
817 CacheLookup.HitIdx = LookupFileCache[ScratchFilename].HitIdx;
825 *SuggestedModule = MSSuggestedModule;
830 CacheLookup.HitIdx = SearchDirs.size();
845 assert(ContextFileEnt &&
"No context file?");
849 size_t SlashPos = Filename.find(
'/');
850 if (SlashPos == StringRef::npos)
return nullptr;
853 const char *ContextName = ContextFileEnt->
getName();
856 const unsigned DotFrameworkLen = 10;
857 const char *FrameworkPos = strstr(ContextName,
".framework");
858 if (FrameworkPos ==
nullptr ||
859 (FrameworkPos[DotFrameworkLen] !=
'/' &&
860 FrameworkPos[DotFrameworkLen] !=
'\\'))
866 FrameworkName +=
"Frameworks/";
867 FrameworkName.append(Filename.begin(), Filename.begin()+SlashPos);
868 FrameworkName +=
".framework/";
871 *FrameworkMap.insert(std::make_pair(Filename.substr(0, SlashPos),
872 FrameworkCacheEntry())).first;
875 if (CacheLookup.second.Directory &&
876 CacheLookup.first().size() == FrameworkName.size() &&
877 memcmp(CacheLookup.first().data(), &FrameworkName[0],
878 CacheLookup.first().size()) != 0)
882 if (!CacheLookup.second.Directory) {
883 ++NumSubFrameworkLookups;
887 if (!Dir)
return nullptr;
891 CacheLookup.second.Directory = Dir;
897 RelativePath->clear();
898 RelativePath->append(Filename.begin()+SlashPos+1, Filename.end());
903 HeadersFilename +=
"Headers/";
907 SearchPath->append(HeadersFilename.begin(), HeadersFilename.end()-1);
910 HeadersFilename.append(Filename.begin()+SlashPos+1, Filename.end());
911 if (!(FE = FileMgr.
getFile(HeadersFilename,
true))) {
914 HeadersFilename = FrameworkName;
915 HeadersFilename +=
"PrivateHeaders/";
919 SearchPath->append(HeadersFilename.begin(), HeadersFilename.end()-1);
922 HeadersFilename.append(Filename.begin()+SlashPos+1, Filename.end());
923 if (!(FE = FileMgr.
getFile(HeadersFilename,
true)))
932 unsigned DirInfo = getFileInfo(ContextFileEnt).
DirInfo;
933 getFileInfo(FE).
DirInfo = DirInfo;
936 if (SuggestedModule) {
938 FrameworkName.pop_back();
944 StringRef ModuleName = llvm::sys::path::stem(TopFrameworkDir->
getName());
948 bool IsSystem =
false;
949 if (loadFrameworkModule(ModuleName, TopFrameworkDir, IsSystem)) {
990 if (FE->
getUID() >= FileInfo.size())
991 FileInfo.resize(FE->
getUID()+1);
994 if (ExternalSource && !HFI.
Resolved)
1002 if (FE->
getUID() >= FileInfo.size())
1014 if (File->
getUID() >= FileInfo.size())
1019 if (ExternalSource && !HFI.
Resolved)
1028 bool isCompilingModuleHeader) {
1029 if (FE->
getUID() >= FileInfo.size())
1030 FileInfo.resize(FE->
getUID()+1);
1040 bool isImport,
Module *M) {
1070 ++NumMultiIncludeFileOptzn;
1082 return SearchDirs.capacity()
1083 + llvm::capacity_in_bytes(FileInfo)
1084 + llvm::capacity_in_bytes(HeaderMaps)
1085 + LookupFileCache.getAllocator().getTotalMemory()
1086 + FrameworkMap.getAllocator().getTotalMemory();
1090 return FrameworkNames.insert(Framework).first->first();
1096 if (!HSOpts->ImplicitModuleMaps)
1101 StringRef DirName = FileName;
1104 DirName = llvm::sys::path::parent_path(DirName);
1105 if (DirName.empty())
1115 llvm::sys::path::extension(Dir->
getName()) ==
1117 case LMM_NewlyLoaded:
1118 case LMM_AlreadyLoaded:
1121 for (
unsigned I = 0, N = FixUpDirectories.size(); I != N; ++I)
1122 DirectoryHasModuleMap[FixUpDirectories[I]] =
true;
1125 case LMM_NoDirectory:
1126 case LMM_InvalidModuleMap:
1136 FixUpDirectories.push_back(Dir);
1142 if (ExternalSource) {
1145 (void)getFileInfo(File);
1152 StringRef Filename = llvm::sys::path::filename(File->
getName());
1154 if (Filename ==
"module.map")
1155 llvm::sys::path::append(PrivateFilename,
"module_private.map");
1156 else if (Filename ==
"module.modulemap")
1157 llvm::sys::path::append(PrivateFilename,
"module.private.modulemap");
1160 return FileMgr.
getFile(PrivateFilename);
1171 StringRef DirName(Dir->
getName());
1172 if (llvm::sys::path::filename(DirName) ==
"Modules") {
1173 DirName = llvm::sys::path::parent_path(DirName);
1174 if (DirName.endswith(
".framework"))
1178 assert(Dir &&
"parent must exist");
1182 switch (loadModuleMapFileImpl(File, IsSystem, Dir)) {
1183 case LMM_AlreadyLoaded:
1184 case LMM_NewlyLoaded:
1186 case LMM_NoDirectory:
1187 case LMM_InvalidModuleMap:
1190 llvm_unreachable(
"Unknown load module map result");
1193 HeaderSearch::LoadModuleMapResult
1194 HeaderSearch::loadModuleMapFileImpl(
const FileEntry *File,
bool IsSystem,
1196 assert(File &&
"expected FileEntry");
1200 auto AddResult = LoadedModuleMaps.insert(std::make_pair(File,
true));
1201 if (!AddResult.second)
1202 return AddResult.first->second ? LMM_AlreadyLoaded : LMM_InvalidModuleMap;
1205 LoadedModuleMaps[File] =
false;
1206 return LMM_InvalidModuleMap;
1212 LoadedModuleMaps[File] =
false;
1213 return LMM_InvalidModuleMap;
1218 return LMM_NewlyLoaded;
1223 if (!HSOpts->ImplicitModuleMaps)
1229 llvm::sys::path::append(ModuleMapFileName,
"Modules");
1230 llvm::sys::path::append(ModuleMapFileName,
"module.modulemap");
1235 ModuleMapFileName = Dir->
getName();
1236 llvm::sys::path::append(ModuleMapFileName,
"module.map");
1237 return FileMgr.
getFile(ModuleMapFileName);
1240 Module *HeaderSearch::loadFrameworkModule(StringRef Name,
1248 case LMM_InvalidModuleMap:
1250 if (HSOpts->ImplicitModuleMaps)
1251 ModMap.inferFrameworkModule(Dir, IsSystem,
nullptr);
1254 case LMM_AlreadyLoaded:
1255 case LMM_NoDirectory:
1258 case LMM_NewlyLoaded:
1266 HeaderSearch::LoadModuleMapResult
1272 return LMM_NoDirectory;
1275 HeaderSearch::LoadModuleMapResult
1278 auto KnownDir = DirectoryHasModuleMap.find(Dir);
1279 if (KnownDir != DirectoryHasModuleMap.end())
1280 return KnownDir->second ? LMM_AlreadyLoaded : LMM_InvalidModuleMap;
1283 LoadModuleMapResult
Result =
1284 loadModuleMapFileImpl(ModuleMapFile, IsSystem, Dir);
1288 if (Result == LMM_NewlyLoaded)
1289 DirectoryHasModuleMap[Dir] =
true;
1290 else if (Result == LMM_InvalidModuleMap)
1291 DirectoryHasModuleMap[Dir] =
false;
1294 return LMM_InvalidModuleMap;
1300 if (HSOpts->ImplicitModuleMaps) {
1302 for (
unsigned Idx = 0, N = SearchDirs.size(); Idx != N; ++Idx) {
1303 bool IsSystem = SearchDirs[Idx].isSystemHeaderDirectory();
1304 if (SearchDirs[Idx].isFramework()) {
1307 llvm::sys::path::native(SearchDirs[Idx].getFrameworkDir()->getName(),
1311 for (llvm::sys::fs::directory_iterator Dir(DirNative, EC), DirEnd;
1312 Dir != DirEnd && !EC; Dir.increment(EC)) {
1313 if (llvm::sys::path::extension(Dir->path()) !=
".framework")
1322 loadFrameworkModule(llvm::sys::path::stem(Dir->path()), FrameworkDir,
1329 if (SearchDirs[Idx].isHeaderMap())
1338 loadSubdirectoryModuleMaps(SearchDirs[Idx]);
1346 Modules.push_back(M->getValue());
1351 if (!HSOpts->ImplicitModuleMaps)
1355 for (
unsigned Idx = 0, N = SearchDirs.size(); Idx != N; ++Idx) {
1357 if (!SearchDirs[Idx].isNormalDir()) {
1363 SearchDirs[Idx].isSystemHeaderDirectory(),
1364 SearchDirs[Idx].isFramework());
1368 void HeaderSearch::loadSubdirectoryModuleMaps(
DirectoryLookup &SearchDir) {
1369 assert(HSOpts->ImplicitModuleMaps &&
1370 "Should not be loading subdirectory module maps");
1377 llvm::sys::path::native(SearchDir.
getDir()->
getName(), DirNative);
1378 for (llvm::sys::fs::directory_iterator Dir(DirNative, EC), DirEnd;
1379 Dir != DirEnd && !EC; Dir.increment(EC)) {
1380 bool IsFramework = llvm::sys::path::extension(Dir->path()) ==
".framework";
std::string Name
The name of this module.
bool parseModuleMapFile(const FileEntry *File, bool IsSystem, const DirectoryEntry *HomeDir, SourceLocation ExternModuleLoc=SourceLocation())
Parse the given module map file, and record any modules we encounter.
module_iterator module_begin() const
Implements support for file system lookup, file system caching, and directory search management...
Defines the clang::FileManager interface and associated types.
Module * findModule(StringRef Name) const
Retrieve a module with the given name.
SrcMgr::CharacteristicKind getDirCharacteristic() const
virtual IdentifierInfo * GetIdentifier(unsigned ID)=0
Return the identifier associated with the given ID number.
DiagnosticBuilder Report(SourceLocation Loc, unsigned DiagID)
Issue the message to the client.
const DirectoryEntry * Dir
Keeps track of the various options that can be enabled, which controls the dialect of C or C++ that i...
Describes a module or submodule.
bool isOutOfDate() const
Determine whether the information for this identifier is out of date with respect to the external sou...
Concrete class used by the front-end to report problems and issues.
bool isMacroDefinedInLocalModule(const IdentifierInfo *II, Module *M)
Determine whether II is defined as a macro within the module M, if that is a module that we've alread...
module_iterator module_end() const
void setTarget(const TargetInfo &Target)
Set the target information.
llvm::StringMap< Module * >::const_iterator module_iterator
const FileEntry * getFile(StringRef Filename, bool OpenFile=false, bool CacheFailure=true)
Lookup, cache, and verify the specified file (real or virtual).
const DirectoryEntry * getDirectory(StringRef DirName, bool CacheFailure=true)
Lookup, cache, and verify the specified directory (real or virtual).
const HeaderMap * getHeaderMap() const
ModuleHeaderRole
Flags describing the role of a module header.
Exposes information about the current target.
Abstract interface for external sources of preprocessor information.
bool isSystemHeaderDirectory() const
Whether this describes a system header directory.
Defines the clang::Preprocessor interface.
bool isNormalDir() const
isNormalDir - Return true if this is a normal directory, not a header map.
Defines the clang::IdentifierInfo, clang::IdentifierTable, and clang::Selector interfaces.
The result type of a method or function.
bool haveSearchedAllModuleMaps() const
Determine whether we have already searched this entire directory for module maps. ...
const char * getName() const
const DirectoryEntry * getFrameworkDir() const
Encodes a location in the source. The SourceManager can decode this to get at the full include stack...
Cached information about one file (either on disk or in the virtual file system). ...
bool isIgnored(unsigned DiagID, SourceLocation Loc) const
Determine whether the diagnostic is known to be ignored.
const char * getName() const
bool isMacroDefined(StringRef Id)
if(T->getSizeExpr()) TRY_TO(TraverseStmt(T-> getSizeExpr()))
StringRef getCanonicalName(const DirectoryEntry *Dir)
Retrieve the canonical name for a given directory.
const FileEntry * getModuleMapFileForUniquing(const Module *M) const
Get the module map file that (along with the module name) uniquely identifies this module...
virtual void updateOutOfDateIdentifier(IdentifierInfo &II)=0
Update an out-of-date identifier.
const char * getName() const
KnownHeader findModuleForHeader(const FileEntry *File)
Retrieve the module that owns the given header file, if any.
Cached information about one directory (either on disk or in the virtual file system).
const FileEntry * LookupFile(StringRef &Filename, HeaderSearch &HS, SmallVectorImpl< char > *SearchPath, SmallVectorImpl< char > *RelativePath, ModuleMap::KnownHeader *SuggestedModule, bool &InUserSpecifiedSystemFramework, bool &HasBeenMapped, SmallVectorImpl< char > &MappedName) const
bool isHeaderMap() const
isHeaderMap - Return true if this is a header map, not a normal directory.
bool isIndexHeaderMap() const
Whether this header map is building a framework or not.
const DirectoryEntry * getDir() const
void setSearchedAllModuleMaps(bool SAMM)
Specify whether we have already searched all of the subdirectories for module maps.
const DirectoryEntry * getDir() const
Return the directory the file lives in.
This class handles loading and caching of source files into memory.
Engages in a tight little dance with the lexer to efficiently preprocess tokens.