If we have `SUBMODULE(m:s1) s2` and `s1` is already in memory (i.e. does
not need to be read from the `m-s1.mod` file), we still need to record
the fact that the name is a reference to that module symbol.
Original-commit: flang-compiler/f18@
4bb42ed6a4f7da9772903bd411146b989aff8367
Reviewed-on: https://github.com/flang-compiler/f18/pull/218
Tree-same-pre-rewrite: false
std::string ancestorName; // empty for module
if (ancestor) {
if (auto *scope{ancestor->FindSubmodule(name)}) {
+ scope->symbol()->add_occurrence(name);
return scope;
}
ancestorName = ancestor->name().ToString();