chapel-lang/chapel — pull request #852 by hildeth (2014-11-17 04:49:22+00:00)
Title: Fix for verify failure in recordWithRefCopyFns

Auto-copy calls were being inserted in the parallel() pass. These calls were not being
passed through insertReferenceTemps, which inserts reference temps as necessary to make
the reference level of the formal and actual arguments match up. Since this step was
skipped, verify() flagged it reference level mismatch as an error.

For a quick fix, I added a call to insertReferenceTemps() after the offending call is
inserted into the tree. A more general solution would involve moving that mini-pass later
in translation or calling it redundantly after any pass that inserts additional calls to
functions that might contain formals having ref intent.

Removed the recordWithRefCopyFns.future and recordWithRefCopyFns.skipif.

TODO: Make a general sweep of the passes that occur after callDestructors and ensure that

###DETAILS
####compiler/include/passes.h
####compiler/resolution/callDestructors.cpp
Factored out a per-call version of insertReferenceTemps(CallExpr*) and inserted this into
the global namespace.

####compiler/passes/parallel.cpp
Call insertReferenceTemps(autoCopyCall) after the autoCopyCall is inserted.