[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
diff --git a/clang/lib/Lex/Preprocessor.cpp b/clang/lib/Lex/Preprocessor.cpp
index 2db1095..1251e98 100644
--- a/clang/lib/Lex/Preprocessor.cpp
+++ b/clang/lib/Lex/Preprocessor.cpp
@@ -763,9 +763,6 @@
 }
 
 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 @@
 
   // 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,