aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Lex/ModuleMap.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2011-11-11 23:20:24 +0000
committerDouglas Gregor <dgregor@apple.com>2011-11-11 23:20:24 +0000
commit88bdfb0ed9225d1028a7615ba8280b67f315f147 (patch)
tree9e595c5f33e7e71492ab42a1e26c397b5ebab7fc /clang/lib/Lex/ModuleMap.cpp
parent7f89f4c91ce3b1e3b1752e5d18f5b414f754148d (diff)
downloadllvm-88bdfb0ed9225d1028a7615ba8280b67f315f147.zip
llvm-88bdfb0ed9225d1028a7615ba8280b67f315f147.tar.gz
llvm-88bdfb0ed9225d1028a7615ba8280b67f315f147.tar.bz2
Teach the search for modules to consider modules described by a module
map, so long as they have an umbrella header. This makes it possible to introduce a module map + umbrella header for a given set of headers, to turn it into a module. There are two major deficiencies here: first, we don't go hunting for module map files when we just see a module import (so we won't know about the modules described therein). Second, we don't yet have a way to build modules that don't have umbrella headers, or have incomplete umbrella headers. llvm-svn: 144424
Diffstat (limited to 'clang/lib/Lex/ModuleMap.cpp')
-rw-r--r--clang/lib/Lex/ModuleMap.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/clang/lib/Lex/ModuleMap.cpp b/clang/lib/Lex/ModuleMap.cpp
index 7defe01..6695e42 100644
--- a/clang/lib/Lex/ModuleMap.cpp
+++ b/clang/lib/Lex/ModuleMap.cpp
@@ -84,6 +84,14 @@ ModuleMap::Module *ModuleMap::findModuleForHeader(const FileEntry *File) {
return 0;
}
+ModuleMap::Module *ModuleMap::findModule(StringRef Name) {
+ llvm::StringMap<Module *>::iterator Known = Modules.find(Name);
+ if (Known != Modules.end())
+ return Known->getValue();
+
+ return 0;
+}
+
static void indent(llvm::raw_ostream &OS, unsigned Spaces) {
OS << std::string(' ', Spaces);
}