|
@@ -647,6 +647,8 @@ void Preprocessor::EnterSubmodule(Module *M, SourceLocation ImportLoc,
|
|
|
BuildingSubmoduleStack.push_back(
|
|
|
BuildingSubmoduleInfo(M, ImportLoc, ForPragma, CurSubmoduleState,
|
|
|
PendingModuleMacroNames.size()));
|
|
|
+ if (Callbacks)
|
|
|
+ Callbacks->EnteredSubmodule(M, ImportLoc, ForPragma);
|
|
|
return;
|
|
|
}
|
|
|
|
|
@@ -691,6 +693,9 @@ void Preprocessor::EnterSubmodule(Module *M, SourceLocation ImportLoc,
|
|
|
BuildingSubmoduleInfo(M, ImportLoc, ForPragma, CurSubmoduleState,
|
|
|
PendingModuleMacroNames.size()));
|
|
|
|
|
|
+ if (Callbacks)
|
|
|
+ Callbacks->EnteredSubmodule(M, ImportLoc, ForPragma);
|
|
|
+
|
|
|
// Switch to this submodule as the current submodule.
|
|
|
CurSubmoduleState = &State;
|
|
|
|
|
@@ -731,6 +736,10 @@ Module *Preprocessor::LeaveSubmodule(bool ForPragma) {
|
|
|
// are tracking macro visibility, don't build any, and preserve the list
|
|
|
// of pending names for the surrounding submodule.
|
|
|
BuildingSubmoduleStack.pop_back();
|
|
|
+
|
|
|
+ if (Callbacks)
|
|
|
+ Callbacks->LeftSubmodule(LeavingMod, ImportLoc, ForPragma);
|
|
|
+
|
|
|
makeModuleVisible(LeavingMod, ImportLoc);
|
|
|
return LeavingMod;
|
|
|
}
|
|
@@ -815,6 +824,9 @@ Module *Preprocessor::LeaveSubmodule(bool ForPragma) {
|
|
|
|
|
|
BuildingSubmoduleStack.pop_back();
|
|
|
|
|
|
+ if (Callbacks)
|
|
|
+ Callbacks->LeftSubmodule(LeavingMod, ImportLoc, ForPragma);
|
|
|
+
|
|
|
// A nested #include makes the included submodule visible.
|
|
|
makeModuleVisible(LeavingMod, ImportLoc);
|
|
|
return LeavingMod;
|