diff options
| author | Richard Smith <richard-llvm@metafoo.co.uk> | 2017-03-09 00:58:22 +0000 |
|---|---|---|
| committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2017-03-09 00:58:22 +0000 |
| commit | 3f57cff1e821d742c71e46dae67aadd65e2f1be2 (patch) | |
| tree | 7c761e2124bec55515bb28d994e8a9743dcdeaf3 /clang/lib/Lex/HeaderSearch.cpp | |
| parent | d923a35f3424e57504b44559ba893c4402bd4b24 (diff) | |
| download | bcm5719-llvm-3f57cff1e821d742c71e46dae67aadd65e2f1be2.tar.gz bcm5719-llvm-3f57cff1e821d742c71e46dae67aadd65e2f1be2.zip | |
Fix handling of -fmodule-map-file=X where X has no directory component.
llvm-svn: 297349
Diffstat (limited to 'clang/lib/Lex/HeaderSearch.cpp')
| -rw-r--r-- | clang/lib/Lex/HeaderSearch.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/clang/lib/Lex/HeaderSearch.cpp b/clang/lib/Lex/HeaderSearch.cpp index c667f4bf220..4ee38719289 100644 --- a/clang/lib/Lex/HeaderSearch.cpp +++ b/clang/lib/Lex/HeaderSearch.cpp @@ -172,8 +172,10 @@ std::string HeaderSearch::getModuleFileName(StringRef ModuleName, // // To avoid false-negatives, we form as canonical a path as we can, and map // to lower-case in case we're on a case-insensitive file system. - auto *Dir = - FileMgr.getDirectory(llvm::sys::path::parent_path(ModuleMapPath)); + std::string Parent = llvm::sys::path::parent_path(ModuleMapPath); + if (Parent.empty()) + Parent = "."; + auto *Dir = FileMgr.getDirectory(Parent); if (!Dir) return std::string(); auto DirName = FileMgr.getCanonicalName(Dir); |

