Issue #3517423: refactor HookCollectorPass::checkForProceduralOnlyHooks() so it can be used by other code
Closes #3517423