diff options
author | Richard Smith <richard-llvm@metafoo.co.uk> | 2015-07-10 20:09:49 +0000 |
---|---|---|
committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2015-07-10 20:09:49 +0000 |
commit | 8692a4d1995097e4e4e3949af783f0da73f117fa (patch) | |
tree | 385b86bcfb74e89b9199c0a77538c9c14e976d64 /clang/lib/Lex | |
parent | 45be9e0d24e1c04d1f3acab22c83a0e4374a6b93 (diff) | |
download | bcm5719-llvm-8692a4d1995097e4e4e3949af783f0da73f117fa.tar.gz bcm5719-llvm-8692a4d1995097e4e4e3949af783f0da73f117fa.zip |
[modules] Fix "prefer own module over others" rule when selecting a module for a header to work in the presence of module hierarchy.
llvm-svn: 241936
Diffstat (limited to 'clang/lib/Lex')
-rw-r--r-- | clang/lib/Lex/ModuleMap.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/clang/lib/Lex/ModuleMap.cpp b/clang/lib/Lex/ModuleMap.cpp index e6fe38927e2..6faae818bc1 100644 --- a/clang/lib/Lex/ModuleMap.cpp +++ b/clang/lib/Lex/ModuleMap.cpp @@ -347,7 +347,7 @@ ModuleMap::KnownHeader ModuleMap::findModuleForHeader(const FileEntry *File) { // Iterate over all modules that 'File' is part of to find the best fit. for (KnownHeader &H : Known->second) { // Prefer a header from the current module over all others. - if (H.getModule() == CompilingModule) + if (H.getModule()->getTopLevelModule() == CompilingModule) return MakeResult(H); // Cannot use a module if it is unavailable. if (!H.getModule()->isAvailable()) |