Branch: refs/heads/main
Revision: 74e2e16d9ccdf541287d1e04f0351c275c9587c8
Author: benharsh
Link: Various procedure pointer fixes by benharsh · Pull Request #28847 · chapel-lang/chapel · GitHub
Log Message:
Various procedure pointer fixes (#28847)
This PR includes a few fixes that improve the state of procedure
pointers:
- implement proper casting of procedure pointers to strings (which
prints the proc's name) - allow procedure pointers to return types that normally need to return
via an argument - implement implicit coercion of actuals by wrapping each invocation of
a procedure pointer in a wrapper - this allows us to more easily re-use code in 'wrappers.cpp' without a
huge refactor.- this wrapper is immediately removed except in the case of promotion
- move codegen of class prototypes to be before function types, which
helps prevent recursion - fixes an issue with denormalization of procedure pointer temporaries
[reviewed-by @dlongnecke-cray]
Diff:
M compiler/codegen/codegen.cpp
M compiler/passes/denormalize.cpp
M compiler/resolution/callDestructors.cpp
M compiler/resolution/functionResolution.cpp
M modules/standard/ChapelIO.chpl
A test/functions/fcf/pointers/TestCoercions.chpl
A test/functions/fcf/pointers/TestCoercions.good
A test/functions/fcf/pointers/TestPromotion.chpl
A test/functions/fcf/pointers/TestPromotion.good
https://github.com/chapel-lang/chapel/pull/28847.diff