[Chapel Merge] Implement promotion for procedure pointers

Branch: refs/heads/main
Revision: a2f01028fadbcdd5176e0aa54b7feb656552dfe5
Author: benharsh
Link: Implement promotion for procedure pointers by benharsh · Pull Request #28691 · chapel-lang/chapel · GitHub
Log Message:
Implement promotion for procedure pointers (#28691)

This PR adds support for promotion of procedure pointers.

The current infrastructure to support promotion does not work with
procedure pointers directly. Instead of trying to refactor this code, we
can wrap the indirect call in a function and invoke promotion generation
on that function, like normal. A fix to canDispatch is also needed to
account for FunctionType*s.

[reviewed-by @dlongnecke-cray]

Compare: Comparing cf89e76b42636962f198992fe0d32340863ff376...e7ee6439113a512000dd8b7d2e4e7138dcd67636 · chapel-lang/chapel · GitHub

Diff:
M compiler/AST/type.cpp
M compiler/include/resolution.h
M compiler/optimizations/inferConstRefs.cpp
M compiler/passes/StreamlineProcPtrTypesForCodegen.cpp
M compiler/passes/resolveIntents.cpp
M compiler/resolution/functionResolution.cpp
https://github.com/chapel-lang/chapel/pull/28691.diff