diff options
author | Douglas Gregor <dgregor@apple.com> | 2011-09-12 20:41:59 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2011-09-12 20:41:59 +0000 |
commit | 9a6da6930644b4f2dbe4885b0eb4fc1274ff56a4 (patch) | |
tree | 564e160bd3733af36124ca3b947aaa947eed5763 /lib/Lex/HeaderSearch.cpp | |
parent | 48822fbd088c4821f15fee5a2957a69a1f98e746 (diff) |
Introduce a cc1-level option to provide the path to the module cache,
where the compiler will look for module files. Eliminates the
egregious hack where we looked into the header search paths for
modules.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139538 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Lex/HeaderSearch.cpp')
-rw-r--r-- | lib/Lex/HeaderSearch.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/Lex/HeaderSearch.cpp b/lib/Lex/HeaderSearch.cpp index 0ba7632742..36826756b8 100644 --- a/lib/Lex/HeaderSearch.cpp +++ b/lib/Lex/HeaderSearch.cpp @@ -98,6 +98,16 @@ const HeaderMap *HeaderSearch::CreateHeaderMap(const FileEntry *FE) { return 0; } +const FileEntry *HeaderSearch::lookupModule(StringRef ModuleName) { + // If we don't have a module cache path, we can't do anything. + if (ModuleCachePath.empty()) + return 0; + + llvm::SmallString<256> FileName(ModuleCachePath); + llvm::sys::path::append(FileName, ModuleName + ".pcm"); + return getFileMgr().getFile(FileName); +} + //===----------------------------------------------------------------------===// // File lookup within a DirectoryLookup scope //===----------------------------------------------------------------------===// |