NumHiddenOverrides[O] = -1;
// Collect all macros that are not overridden by a visible macro.
- llvm::SmallVector<ModuleMacro *, 16> Worklist(Leaf->second.begin(),
- Leaf->second.end());
+ llvm::SmallVector<ModuleMacro *, 16> Worklist;
+ for (auto *LeafMM : Leaf->second) {
+ assert(LeafMM->getNumOverridingMacros() == 0 && "leaf macro overridden");
+ if (NumHiddenOverrides.lookup(LeafMM) == 0)
+ Worklist.push_back(LeafMM);
+ }
while (!Worklist.empty()) {
auto *MM = Worklist.pop_back_val();
if (CurSubmoduleState->VisibleModules.isVisible(MM->getOwningModule())) {
// expected-note@Inputs/macros_right.h:12{{expanding this definition of 'LEFT_RIGHT_DIFFERENT'}}
// expected-note@Inputs/macros_right.h:13{{expanding this definition of 'LEFT_RIGHT_DIFFERENT2'}}
// expected-note@Inputs/macros_left.h:14{{other definition of 'LEFT_RIGHT_DIFFERENT'}}
-// expected-note@Inputs/macros_left.h:11{{other definition of 'LEFT_RIGHT_DIFFERENT2'}}
@import macros;
# error TOP should not be visible
#endif
+#undef INTEGER
+#define INTEGER int
+
// Import left module (which also imports top)
@import macros_left;
+INTEGER my_integer = 0;
+
#ifndef LEFT
# error LEFT should be visible
#endif