summaryrefslogtreecommitdiffstats
path: root/clang/lib/Lex/Preprocessor.cpp
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2015-05-02 00:45:56 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2015-05-02 00:45:56 +0000
commit38477db8c4a0bfddb7c749de2de50ccd47d4ef54 (patch)
treec521354f8853fe82d7105e7f5e4114d19c25877a /clang/lib/Lex/Preprocessor.cpp
parentae4c2649dce019d431b7f8e231d6f198bcab8bdf (diff)
downloadbcm5719-llvm-38477db8c4a0bfddb7c749de2de50ccd47d4ef54.tar.gz
bcm5719-llvm-38477db8c4a0bfddb7c749de2de50ccd47d4ef54.zip
[modules] If a module #includes a modular header that #undef's its macro, it
should not export the macro. ... at least, not unless we have local submodule visibility enabled. llvm-svn: 236369
Diffstat (limited to 'clang/lib/Lex/Preprocessor.cpp')
-rw-r--r--clang/lib/Lex/Preprocessor.cpp5
1 files changed, 1 insertions, 4 deletions
diff --git a/clang/lib/Lex/Preprocessor.cpp b/clang/lib/Lex/Preprocessor.cpp
index 2db109565af..1251e982533 100644
--- a/clang/lib/Lex/Preprocessor.cpp
+++ b/clang/lib/Lex/Preprocessor.cpp
@@ -763,9 +763,6 @@ void Preprocessor::LexAfterModuleImport(Token &Result) {
}
void Preprocessor::makeModuleVisible(Module *M, SourceLocation Loc) {
- if (VisibleModules.isVisible(M))
- return;
-
VisibleModules.setVisible(
M, Loc, [](Module *) {},
[&](ArrayRef<Module *> Path, Module *Conflict, StringRef Message) {
@@ -779,7 +776,7 @@ void Preprocessor::makeModuleVisible(Module *M, SourceLocation Loc) {
// Add this module to the imports list of the currently-built submodule.
if (!BuildingSubmoduleStack.empty())
- BuildingSubmoduleStack.back().M->Imports.push_back(M);
+ BuildingSubmoduleStack.back().M->Imports.insert(M);
}
bool Preprocessor::FinishLexStringLiteral(Token &Result, std::string &String,
OpenPOWER on IntegriCloud