Lines Matching defs:File
5 // This file is distributed under the University of Illinois Open Source
10 // This file defines the ModuleMap implementation, which describes the layout
144 /// \brief Determine whether the given file name is the name of a builtin
164 ModuleMap::findKnownHeader(const FileEntry *File) {
165 HeadersMap::iterator Known = Headers.find(File);
167 Known == Headers.end() && File->getDir() == BuiltinIncludeDir &&
168 isBuiltinHeader(llvm::sys::path::filename(File->getName()))) {
170 return Headers.find(File);
176 ModuleMap::findHeaderInUmbrellaDirs(const FileEntry *File,
181 const DirectoryEntry *Dir = File->getDir();
182 assert(Dir && "file in no directory");
241 const FileEntry *File) {
254 HeadersMap::iterator Known = findKnownHeader(File);
258 if (violatesPrivateInclude(RequestingModule, File, Header)) {
292 if (Excluded || isHeaderInUmbrellaDirs(File))
328 ModuleMap::KnownHeader ModuleMap::findModuleForHeader(const FileEntry *File) {
335 HeadersMap::iterator Known = findKnownHeader(File);
338 // Iterate over all modules that 'File' is part of to find the best fit.
349 return MakeResult(findOrCreateModuleForHeaderInUmbrellaDir(File));
353 ModuleMap::findOrCreateModuleForHeaderInUmbrellaDir(const FileEntry *File) {
354 assert(!Headers.count(File) && "already have a module for this header");
357 KnownHeader H = findHeaderInUmbrellaDirs(File, SkippedDirs);
395 // Infer a submodule with the same name as this header file.
398 llvm::sys::path::stem(File->getName()), NameBuf);
403 Result->addTopHeader(File);
417 Headers[File].push_back(Header);
425 ModuleMap::findAllModulesForHeader(const FileEntry *File) const {
426 auto It = Headers.find(File);
491 // Infer a submodule with the same name as this header file.
950 // Module map file parser
954 /// \brief A token in a module map file.
1018 /// \brief The current module map file.
1021 /// \brief The directory that file names in this module map file should
1058 /// (or the end of the file).
1401 "submodule defined in same file as 'module *' that allowed its "
1586 // Parse the referenced module map file name.
1602 if (const FileEntry *File = SourceMgr.getFileManager().getFile(FileNameRef))
1604 File, /*IsSystem=*/false,
1607 : File->getDir(), ExternLoc);
1778 // Look for this file.
1779 const FileEntry *File = nullptr;
1784 File = SourceMgr.getFileManager().getFile(RelativePathName);
1786 // Search for the header file within the search directory.
1793 // Check whether this file is in the public headers.
1796 File = SourceMgr.getFileManager().getFile(FullPathName);
1798 if (!File) {
1799 // Check whether this file is in the private headers.
1806 File = SourceMgr.getFileManager().getFile(FullPathName);
1812 File = SourceMgr.getFileManager().getFile(FullPathName);
1828 // For local visibility, entirely replace the system file with our
1833 if (BuiltinFile && (!File || Map.LangOpts.ModulesLocalVisibility)) {
1834 File = BuiltinFile;
1842 // FIXME: We shouldn't be eagerly stat'ing every file named in a module map.
1844 if (File) {
1846 const DirectoryEntry *UmbrellaDir = File->getDir();
1853 Map.setUmbrellaHeader(ActiveModule, File, RelativePathName.str());
1856 Module::Header H = {RelativePathName.str(), File};
1859 // If there is a builtin counterpart to this file, add it now, before
1864 // different results depending on how we've previously named that file
1871 Module::Header H = { RelativePathName.str(), File };
1914 // Look for this file.
2394 /// \brief Parse a module map file.
2396 /// module-map-file:
2440 bool ModuleMap::parseModuleMapFile(const FileEntry *File, bool IsSystem,
2444 = ParsedModuleMap.find(File);
2450 FileID ID = SourceMgr.createFileID(File, ExternModuleLoc, FileCharacter);
2453 return ParsedModuleMap[File] = true;
2455 // Parse this module map file.
2458 ModuleMapParser Parser(L, SourceMgr, Target, Diags, *this, File, Dir,
2461 ParsedModuleMap[File] = Result;
2465 Cb->moduleMapFileRead(Start, *File, IsSystem);