Lines Matching refs:Module
11 // of a module as it relates to headers.
38 Module::ExportDecl
39 ModuleMap::resolveExport(Module *Mod,
40 const Module::UnresolvedExportDecl &Unresolved,
45 return Module::ExportDecl(0, true);
48 // Resolve the module-id.
49 Module *Context = resolveModuleId(Unresolved.Id, Mod, Complain);
51 return Module::ExportDecl();
53 return Module::ExportDecl(Context, Unresolved.Wildcard);
56 Module *ModuleMap::resolveModuleId(const ModuleId &Id, Module *Mod,
58 // Find the starting module.
59 Module *Context = lookupModuleUnqualified(Id[0].first, Mod);
68 // Dig into the module path.
70 Module *Sub = lookupModuleQualified(Id[I].first, Context);
101 for (llvm::StringMap<Module *>::iterator I = Modules.begin(),
182 // load all of the module maps to see if it will get associated with a
183 // specific module (e.g., in /usr/include).
211 llvm::DenseMap<const DirectoryEntry *, Module *>::iterator KnownDir
214 Module *Result = KnownDir->second;
216 // Search up the module stack until we find a module with an umbrella
218 Module *UmbrellaModule = Result;
229 // Find or create the module that corresponds to this directory name.
237 // Associate the module and the directory.
243 Result->Exports.push_back(Module::ExportDecl(0, true));
257 Result->Exports.push_back(Module::ExportDecl(0, true));
260 // the module we found, since the umbrella header covers them all.
267 // If a header corresponds to an unavailable module, don't report
301 llvm::DenseMap<const DirectoryEntry *, Module *>::const_iterator KnownDir
304 Module *Found = KnownDir->second;
308 // Search up the module stack until we find a module with an umbrella
310 Module *UmbrellaModule = Found;
316 // Find or create the module that corresponds to this directory name.
355 Module *ModuleMap::findModule(StringRef Name) const {
356 llvm::StringMap<Module *>::const_iterator Known = Modules.find(Name);
363 Module *ModuleMap::lookupModuleUnqualified(StringRef Name,
364 Module *Context) const {
366 if (Module *Sub = lookupModuleQualified(Name, Context))
373 Module *ModuleMap::lookupModuleQualified(StringRef Name, Module *Context) const{
380 std::pair<Module *, bool>
381 ModuleMap::findOrCreateModule(StringRef Name, Module *Parent, bool IsFramework,
383 // Try to find an existing module with this name.
384 if (Module *Sub = lookupModuleQualified(Name, Parent))
387 // Create a new module with this name.
388 Module *Result = new Module(Name, SourceLocation(), Parent, IsFramework,
403 // for a module map.
413 // to infer this particular module.
424 /// \brief For a framework module, infer the framework against which we
426 static void inferFrameworkLink(Module *Mod, const DirectoryEntry *FrameworkDir,
436 Mod->LinkLibraries.push_back(Module::LinkLibrary(Mod->Name,
441 Module *
445 Module *Parent) {
446 // Check whether we've already found this module.
447 if (Module *Mod = lookupModuleQualified(ModuleName, Parent))
453 // a framework module, do so.
455 // Determine whether we're allowed to infer a module map.
470 // for a module map.
474 // We haven't looked here before. Load a module map, if there is
477 llvm::sys::path::append(ModMapPath, "module.map");
490 // to infer this particular module.
502 // If we're not allowed to infer a framework module, don't.
519 Module *Result = new Module(ModuleName, SourceLocation(), Parent,
533 Result->Exports.push_back(Module::ExportDecl(0, true));
535 // module * { export * }
585 // If the module is a top-level framework, automatically link against the
594 void ModuleMap::setUmbrellaHeader(Module *Mod, const FileEntry *UmbrellaHeader){
600 void ModuleMap::setUmbrellaDir(Module *Mod, const DirectoryEntry *UmbrellaDir) {
605 void ModuleMap::addHeader(Module *Mod, const FileEntry *Header,
621 ModuleMap::getContainingModuleMapFile(Module *Module) const {
622 if (Module->DefinitionLoc.isInvalid() || !SourceMgr)
626 SourceMgr->getFileID(Module->DefinitionLoc));
631 for (llvm::StringMap<Module *>::iterator M = Modules.begin(),
644 bool ModuleMap::resolveExports(Module *Mod, bool Complain) {
647 Module::ExportDecl Export = resolveExport(Mod, Mod->UnresolvedExports[I],
658 bool ModuleMap::resolveConflicts(Module *Mod, bool Complain) {
661 Module *OtherMod = resolveModuleId(Mod->UnresolvedConflicts[I].Id,
668 Module::Conflict Conflict;
677 Module *ModuleMap::inferModuleFromLocation(FullSourceLoc Loc) {
681 // Use the expansion location to determine which module we're in.
692 // Find the module that owns this header (if any).
693 if (Module *Mod = findModuleForHeader(ExpansionFile).getModule())
696 // No module owns this header, so look up the inclusion chain to see if
697 // any included header has an associated module.
709 // Module map file parser
713 /// \brief A token in a module map file.
762 /// \brief The set of attributes that can be attached to a module.
766 /// \brief Whether this is a system module.
785 /// \brief The directory that this module map resides in.
791 /// \brief Whether this module map is in a system header directory.
804 /// \brief The active module.
805 Module *ActiveModule;
871 .Case("module", MMToken::ModuleKeyword)
994 module-id.
996 /// module-id:
998 /// identifier '.' module-id
1033 /// \brief Parse a module declaration.
1035 /// module-declaration:
1036 /// 'explicit'[opt] 'framework'[opt] 'module' module-id attributes[opt]
1037 /// { module-member* }
1039 /// module-member:
1047 /// module-declaration
1069 // Parse 'module' keyword.
1076 consumeToken(); // 'module' keyword
1078 // If we have a wildcard for the module name, this is an inferred submodule.
1083 // Parse the module name.
1106 Module *PreviousActiveModule = ActiveModule;
1108 // This module map defines a submodule. Go find the module of which it
1112 if (Module *Next = Map.lookupModuleQualified(Id[I].first, ActiveModule)) {
1144 // Determine whether this (sub)module has already been defined.
1145 if (Module *Existing = Map.lookupModuleQualified(ModuleName, ActiveModule)) {
1147 // Skip the module definition.
1163 // Skip the module definition.
1172 // Start defining this module.
1263 // If the active module is a top-level framework, and there are no link
1270 // We're done parsing this module. Pop back to the previous module.
1312 /// subframework in which the given module lives.
1313 static void appendSubframeworkPaths(Module *Mod,
1315 // Collect the framework names from the given module to the top-level module.
1392 // If this is a system module with a top-level header, this header
1413 // FIXME: We shouldn't be eagerly stat'ing every file named in a module map.
1422 if (Module *UmbrellaModule = Map.UmbrellaDirs[UmbrellaDir]) {
1497 if (Module *OwningModule = Map.UmbrellaDirs[Dir]) {
1508 /// \brief Parse a module export declaration.
1511 /// 'export' wildcard-module-id
1513 /// wildcard-module-id:
1516 /// identifier '.' wildcard-module-id
1521 // Parse the module-id with an optional wildcard at the end.
1549 Module::UnresolvedExportDecl Unresolved = {
1557 /// module-declaration:
1580 ActiveModule->LinkLibraries.push_back(Module::LinkLibrary(LibraryName,
1586 /// module-declaration:
1637 /// \brief Format a module-id into a string.
1655 /// module-declaration:
1656 /// 'conflict' module-id ',' string-literal
1660 Module::UnresolvedConflict Conflict;
1662 // Parse the module-id.
1687 /// \brief Parse an inferred module declaration (wildcard modules).
1689 /// module-declaration:
1690 /// 'explicit'[opt] 'framework'[opt] 'module' * attributes[opt]
1691 /// { inferred-module-member* }
1693 /// inferred-module-member:
1714 // Check for redefinition of an inferred module.
1904 for (Module *Mod = ActiveModule; Mod; Mod = Mod->Parent) {
1917 /// \brief Parse a module map file.
1919 /// module-map-file:
1920 /// module-declaration*
1971 // Parse this module map file.