[Chapel Merge] Minor cleanup in visibleFunctions et al.

Branch: refs/heads/master
Revision: a0e6e80
Author: vasslitvinov
Log Message:

Merge pull request #16695 from vasslitvinov/cleanup-visibleFunctions

Minor cleanup in visibleFunctions et al.

Reduces calls to getModule() and getFunction() and improves code clarity.

Removes or conditional-izes a couple of calls to getModule() and getFunction()
in visibleFunctions.cpp where that does not affect business logic.
This was triggered by an assertion failure on my w.i.p. CG branch.

Replaces some code in getVisibleMethodsImpl() with calls to
getVisibleFnsInstantiationPt() and getVisibleFnsShowBlock(),
sharing these with getVisibleFunctionsImpl().

Moves the check for rootModule->block to be the first thing in
getVisibleMethodsImpl() and getVisibleFunctionsImpl(), to
avoid unnecessary work.

Reworks some comments for clarity or conciseness.
The changes in createTaskFunctions.cpp were triggered
by the discovery that tiMarkHost was the only function
with a defPoint directly in rootModule.

r: @lydia-duncan

Modified Files:
M compiler/AST/ModuleSymbol.cpp
M compiler/include/ModuleSymbol.h
M compiler/passes/createTaskFunctions.cpp
M compiler/resolution/visibleFunctions.cpp

Compare: https://github.com/chapel-lang/chapel/compare/837c3f3de173...a0e6e808ca6c