diff options
author | Lawrence Crowl <crowl@google.com> | 2013-06-20 21:14:14 +0000 |
---|---|---|
committer | Lawrence Crowl <crowl@google.com> | 2013-06-20 21:14:14 +0000 |
commit | b53e5483b0490894b67a59ac4913a5229993591a (patch) | |
tree | c8387b8a8bff9e04371a6f754492097deb8b353a /clang/lib/Lex/HeaderSearch.cpp | |
parent | 664c4c678b5144b217f2773102adb3bc9ea8734a (diff) | |
download | llvm-b53e5483b0490894b67a59ac4913a5229993591a.zip llvm-b53e5483b0490894b67a59ac4913a5229993591a.tar.gz llvm-b53e5483b0490894b67a59ac4913a5229993591a.tar.bz2 |
This patch adds new private headers to the module map. Private
headers may be included from within the module, but not from outside
the module.
llvm-svn: 184471
Diffstat (limited to 'clang/lib/Lex/HeaderSearch.cpp')
-rw-r--r-- | clang/lib/Lex/HeaderSearch.cpp | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/clang/lib/Lex/HeaderSearch.cpp b/clang/lib/Lex/HeaderSearch.cpp index 8a99ed2..d2bc5ad 100644 --- a/clang/lib/Lex/HeaderSearch.cpp +++ b/clang/lib/Lex/HeaderSearch.cpp @@ -223,7 +223,7 @@ const FileEntry *DirectoryLookup::LookupFile( HeaderSearch &HS, SmallVectorImpl<char> *SearchPath, SmallVectorImpl<char> *RelativePath, - Module **SuggestedModule, + ModuleMap::KnownHeader *SuggestedModule, bool &InUserSpecifiedSystemFramework) const { InUserSpecifiedSystemFramework = false; @@ -337,7 +337,7 @@ const FileEntry *DirectoryLookup::DoFrameworkLookup( HeaderSearch &HS, SmallVectorImpl<char> *SearchPath, SmallVectorImpl<char> *RelativePath, - Module **SuggestedModule, + ModuleMap::KnownHeader *SuggestedModule, bool &InUserSpecifiedSystemFramework) const { FileManager &FileMgr = HS.getFileMgr(); @@ -496,11 +496,11 @@ const FileEntry *HeaderSearch::LookupFile( const FileEntry *CurFileEnt, SmallVectorImpl<char> *SearchPath, SmallVectorImpl<char> *RelativePath, - Module **SuggestedModule, + ModuleMap::KnownHeader *SuggestedModule, bool SkipCache) { if (SuggestedModule) - *SuggestedModule = 0; + *SuggestedModule = ModuleMap::KnownHeader(); // If 'Filename' is absolute, check to see if it exists and no searching. if (llvm::sys::path::is_absolute(Filename)) { @@ -676,7 +676,7 @@ LookupSubframeworkHeader(StringRef Filename, const FileEntry *ContextFileEnt, SmallVectorImpl<char> *SearchPath, SmallVectorImpl<char> *RelativePath, - Module **SuggestedModule) { + ModuleMap::KnownHeader *SuggestedModule) { assert(ContextFileEnt && "No context file?"); // Framework names must have a '/' in the filename. Find it. @@ -867,6 +867,7 @@ bool HeaderSearch::isFileMultipleIncludeGuarded(const FileEntry *File) { } void HeaderSearch::MarkFileModuleHeader(const FileEntry *FE, + ModuleMap::ModuleHeaderRole Role, bool isCompilingModuleHeader) { if (FE->getUID() >= FileInfo.size()) FileInfo.resize(FE->getUID()+1); @@ -874,6 +875,7 @@ void HeaderSearch::MarkFileModuleHeader(const FileEntry *FE, HeaderFileInfo &HFI = FileInfo[FE->getUID()]; HFI.isModuleHeader = true; HFI.isCompilingModuleHeader = isCompilingModuleHeader; + HFI.setHeaderRole(Role); } bool HeaderSearch::ShouldEnterIncludeFile(const FileEntry *File, bool isImport){ @@ -966,16 +968,14 @@ bool HeaderSearch::hasModuleMap(StringRef FileName, } while (true); } -Module *HeaderSearch::findModuleForHeader(const FileEntry *File) const { +ModuleMap::KnownHeader +HeaderSearch::findModuleForHeader(const FileEntry *File) const { if (ExternalSource) { // Make sure the external source has handled header info about this file, // which includes whether the file is part of a module. (void)getFileInfo(File); } - if (Module *Mod = ModMap.findModuleForHeader(File)) - return Mod; - - return 0; + return ModMap.findModuleForHeader(File); } bool HeaderSearch::loadModuleMapFile(const FileEntry *File) { |