Now all the prerequisite demangler patches are in, here's the patch for module demangling. As with the mangler patch (D118352) this is the updated scheme described at: https://drive.google.com/file/d/1quPYyByXqOpCyAPlxYt1JleA70TSFMrp/view?usp=sharing
We have two new demangler nodes -- ModuleName and ModuleEntity. The former represents a module name in a hierarchical fashion. The latter is the combination of a (name) node and a module name. Because module names and entity identities use the same substitution encoding, we have to adjust the flow of how substitutions are handled, and examine the substituted node to know how to deal with it.
There is one difference to that doc, the global initializer _ZGI <module-name> lacks the 'v' suffix. I don't think that necessary -- my original thought was of describing something more like a regular void function mangling. I'll be updating the google doc with this alteration and some other clarifications that don't affect the demangler.