Lines Matching defs:Name
111 static StringRef sanitizeFilenameAsIdentifier(StringRef Name,
113 if (Name.empty())
114 return Name;
116 if (!isValidIdentifier(Name)) {
118 // create a buffer with the sanitized name.
120 if (isDigit(Name[0]))
122 Buffer.reserve(Buffer.size() + Name.size());
123 for (unsigned I = 0, N = Name.size(); I != N; ++I) {
124 if (isIdentifierBody(Name[I]))
125 Buffer.push_back(Name[I]);
130 Name = StringRef(Buffer.data(), Buffer.size());
133 while (llvm::StringSwitch<bool>(Name)
138 if (Name.data() != Buffer.data())
139 Buffer.append(Name.begin(), Name.end());
141 Name = StringRef(Buffer.data(), Buffer.size());
144 return Name;
147 /// \brief Determine whether the given file name is the name of a builtin
394 // Find or create the module that corresponds to this directory name.
396 StringRef Name = sanitizeFilenameAsIdentifier(
398 Result = findOrCreateModule(Name, Result, /*IsFramework=*/false,
412 // Infer a submodule with the same name as this header file.
414 StringRef Name = sanitizeFilenameAsIdentifier(
416 Result = findOrCreateModule(Name, Result, /*IsFramework=*/false,
493 // Find or create the module that corresponds to this directory name.
495 StringRef Name = sanitizeFilenameAsIdentifier(
498 Found = lookupModuleQualified(Name, Found);
505 // Infer a submodule with the same name as this header file.
507 StringRef Name = sanitizeFilenameAsIdentifier(
510 Found = lookupModuleQualified(Name, Found);
532 Module *ModuleMap::findModule(StringRef Name) const {
533 llvm::StringMap<Module *>::const_iterator Known = Modules.find(Name);
540 Module *ModuleMap::lookupModuleUnqualified(StringRef Name,
543 if (Module *Sub = lookupModuleQualified(Name, Context))
547 return findModule(Name);
550 Module *ModuleMap::lookupModuleQualified(StringRef Name, Module *Context) const{
552 return findModule(Name);
554 return Context->findSubmodule(Name);
558 ModuleMap::findOrCreateModule(StringRef Name, Module *Parent, bool IsFramework,
560 // Try to find an existing module with this name.
561 if (Module *Sub = lookupModuleQualified(Name, Parent))
564 // Create a new module with this name.
565 Module *Result = new Module(Name, SourceLocation(), Parent,
567 if (LangOpts.CurrentModule == Name) {
569 SourceModuleName = Name;
572 Modules[Name] = Result;
574 Name == LangOpts.CurrentModule) {
591 llvm::sys::path::append(LibName, Mod->Name);
593 Mod->LinkLibraries.push_back(Module::LinkLibrary(Mod->Name,
632 // directory name matches ModuleName exactly. Modules are case-sensitive.
664 StringRef Name = llvm::sys::path::stem(FrameworkDirName);
667 Name) == inferred->second.ExcludedModules.end();
711 // umbrella header "umbrella-header-name"
743 // Get the parent directory name.
1330 // If we have a wildcard for the module name, this is an inferred submodule.
1335 // Parse the module name.
1561 // Parse the module name.
1568 // Parse the referenced module map file name.
1623 // Consume the feature name.
1647 Paths.push_back(Mod->Name);
1653 // Add Frameworks/Name.framework for each subframework.
1693 // Parse the header name.
1791 // FIXME: Taking the name from the FileEntry is unstable and can give
1818 // Parse the directory name.
1946 // Parse the library name
1984 // FIXME: Support macros with the same name as a keyword here.
2000 // We expect to see a macro name here.
2001 // FIXME: Support macros with the same name as a keyword here.
2007 // Consume the macro name.
2237 // Check whether we have an attribute name here.
2246 // Decode the attribute name.