chapel-lang/chapel — pull request #78 by noakesmichael (2014-07-29 20:24:15+00:00)
Title: Migrate the code to insert module initFn from docs to normalize.

This is the effort to move the module initFn code from the start of the
chpldoc pass to the start of the normalize pass.

In brief chpldoc relied on

ModuleSymbol::getClasses()
ModuleSymbol::getConfigVars()

ModuleSymbol::getFunctions()

ModuleSymbol::getModules()

to collect the information it wants to display.

In the original code:

getClasses() and getConfigVars() were only used by chpldocs and these
functions expected the required information to be buried inside the
initFn.

getModules() was only used by chpldocs and expected that the required
information would not be in the initFn.

getFunctions() was used by both chpldocs() and insertTaskFunctions and,
effectively, had two paths; one for functions buried inside initFn and
the other for when they aren't inside the initFn.

1) I noted that	these functions only attempt to get the "module level"
instances of each of these and so I renamed them to hightlight this.

2) I updated the first two functions to handle the before/after story.

3) Then I actually moved	the code that installs the initFn from the start
of docs to the start of normalize.

4) Determined there was	a latent bug in	getFunctions() that caused it to
return EXTERN functions for chpldoc but not for createTaskFunctions. Did
some rework and then added a parameter to the call to enable the two
calls to work in a backwards compatible	way.

5) Altered the .good file for 2	chpldoc tests to reflect the fact that the
module initFn was no longer in the named output	list.

It is now the case that the new version of 3 of the functions has
the ability to step in to the initFn. This provides some ability
for a short-term roll-back and enables these fcuntiosn to be called
from with the normalize	pass. I imagine that there will be more
cleanup	in the future.