diff options
author | Richard Smith <richard-llvm@metafoo.co.uk> | 2015-06-22 22:20:47 +0000 |
---|---|---|
committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2015-06-22 22:20:47 +0000 |
commit | 2f633e7c3c9ad6ebe45473774332118da980027c (patch) | |
tree | 3852e56335fadfe611f5caa1465141f6001396b8 /clang/lib/Lex/ModuleMap.cpp | |
parent | 69a1d8c64674594ec3853f1bce3065d276241349 (diff) | |
download | bcm5719-llvm-2f633e7c3c9ad6ebe45473774332118da980027c.tar.gz bcm5719-llvm-2f633e7c3c9ad6ebe45473774332118da980027c.zip |
[modules] When building a module, if there are multiple matches for a header
file in the loaded module maps and one of them is from the current module,
that's the right match.
llvm-svn: 240350
Diffstat (limited to 'clang/lib/Lex/ModuleMap.cpp')
-rw-r--r-- | clang/lib/Lex/ModuleMap.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/clang/lib/Lex/ModuleMap.cpp b/clang/lib/Lex/ModuleMap.cpp index 075a17f68b1..4ef0674f8d6 100644 --- a/clang/lib/Lex/ModuleMap.cpp +++ b/clang/lib/Lex/ModuleMap.cpp @@ -346,6 +346,9 @@ ModuleMap::KnownHeader ModuleMap::findModuleForHeader(const FileEntry *File) { ModuleMap::KnownHeader Result; // 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) + return MakeResult(H); // Cannot use a module if it is unavailable. if (!H.getModule()->isAvailable()) continue; |