Lines Matching refs:Header
145 /// header, supplied by Clang to replace, override, or augment existing system
191 // an umbrella header.
212 ModuleMap::KnownHeader Header) {
214 if (Header.getRole() & ModuleMap::PrivateHeader) {
215 // Check for consistency between the module header role
219 SmallVectorImpl<Module::Header> *HeaderList[] = {
220 &Header.getModule()->Headers[Module::HK_Private],
221 &Header.getModule()->Headers[Module::HK_PrivateTextual]};
224 std::find_if(Hs->begin(), Hs->end(), [&](const Module::Header &H) {
230 return !Header.isAccessibleFrom(RequestingModule);
256 for (const KnownHeader &Header : Known->second) {
258 if (violatesPrivateInclude(RequestingModule, File, Header)) {
259 Private = Header.getModule();
266 !RequestingModule->directlyUses(Header.getModule())) {
267 NotUsed = Header.getModule();
278 // We have found a header, but it is private.
314 // Prefer a public header over a private header.
319 // Prefer a non-textual header over a textual header.
340 // Prefer a header from the source module over all others.
354 assert(!Headers.count(File) && "already have a module for this header");
372 // the directory of the umbrella header and the directory where
373 // the actual header is located.
395 // Infer a submodule with the same name as this header file.
411 // the module we found, since the umbrella header covers them all.
416 KnownHeader Header(Result, NormalHeader);
417 Headers[File].push_back(Header);
418 return Header;
432 bool ModuleMap::isHeaderInUnavailableModule(const FileEntry *Header) const {
433 return isHeaderUnavailableInModule(Header, nullptr);
437 ModuleMap::isHeaderUnavailableInModule(const FileEntry *Header,
439 HeadersMap::const_iterator Known = Headers.find(Header);
452 const DirectoryEntry *Dir = Header->getDir();
462 // an umbrella header.
491 // Infer a submodule with the same name as this header file.
494 llvm::sys::path::stem(Header->getName()),
668 // Look for an umbrella header.
673 // FIXME: If there's no umbrella header, we could probably scan the
695 // umbrella header "umbrella-header-name"
766 // Notify callbacks that we just added a new header.
780 default: llvm_unreachable("unknown header role");
792 void ModuleMap::addHeader(Module *Mod, Module::Header Header,
796 // Only add each header to the headers list once.
797 // FIXME: Should we diagnose if a header is listed twice in the
799 auto &HeaderList = Headers[Header.Entry];
805 Mod->Headers[headerRoleToKind(Role)].push_back(std::move(Header));
812 HeaderInfo.MarkFileModuleHeader(Header.Entry, Role,
816 // Notify callbacks that we just added a new header.
818 Cb->moduleMapAddHeader(Header.Entry->getName());
821 void ModuleMap::excludeHeader(Module *Mod, Module::Header Header) {
822 // Add this as a known header so we won't implicitly add it to any
826 (void) Headers[Header.Entry];
828 Mod->Headers[Module::HK_Excluded].push_back(std::move(Header));
933 // Find the module that owns this header (if any).
937 // No module owns this header, so look up the inclusion chain to see if
938 // any included header has an associated module.
1028 /// \brief Whether this module map is in a system header directory.
1122 .Case("header", MMToken::HeaderKeyword)
1304 /// header-declaration
1717 /// \brief Parse a header declaration.
1719 /// header-declaration:
1720 /// 'textual'[opt] 'header' string-literal
1721 /// 'private' 'textual'[opt] 'header' string-literal
1722 /// 'exclude' 'header' string-literal
1723 /// 'umbrella' 'header' string-literal
1725 /// FIXME: Support 'private textual header'.
1743 // Mark this header 'textual' (see doc comment for
1759 // Parse the header name.
1762 << "header";
1766 Module::UnresolvedHeaderDirective Header;
1767 Header.FileName = Tok.getString();
1768 Header.FileNameLoc = consumeToken();
1772 Diags.Report(Header.FileNameLoc, diag::err_mmap_umbrella_clash)
1782 if (llvm::sys::path::is_absolute(Header.FileName)) {
1783 RelativePathName = Header.FileName;
1786 // Search for the header file within the search directory.
1794 llvm::sys::path::append(RelativePathName, "Headers", Header.FileName);
1804 Header.FileName);
1810 llvm::sys::path::append(RelativePathName, Header.FileName);
1814 // If this is a system module with a top-level header, this header
1816 // supplied by Clang. Find that builtin header.
1819 isBuiltinHeader(Header.FileName)) {
1821 llvm::sys::path::append(BuiltinPathName, Header.FileName);
1824 // If Clang supplies this header but the underlying system does not,
1830 // from our header to the system one if we #include_next it.
1852 // Record this umbrella header.
1856 Module::Header H = {RelativePathName.str(), File};
1860 // the "real" header, so we build the built-in one first when building
1866 Module::Header H = { BuiltinFile->getName(), BuiltinFile };
1870 // Record this header.
1871 Module::Header H = { RelativePathName.str(), File };
1875 // Ignore excluded header files. They're optional anyway.
1877 // If we find a module that has a missing header, we mark this module as
1878 // unavailable and store the header directive for displaying diagnostics.
1879 Header.IsUmbrella = LeadingToken == MMToken::UmbrellaKeyword;
1881 ActiveModule->MissingHeaders.push_back(Header);
1885 static int compareModuleHeaders(const Module::Header *A,
1886 const Module::Header *B) {
1933 // Mark this header 'textual' (see doc comment for
1938 SmallVector<Module::Header, 6> Headers;
1945 Module::Header Header = {I->getName(), FE};
1946 Headers.push_back(std::move(Header));
1950 // Sort header paths so that the pcm doesn't depend on iteration order.
1953 for (auto &Header : Headers)
1954 Map.addHeader(ActiveModule, std::move(Header), ModuleMap::TextualHeader);