Go to the first, previous, next, last section, table of contents.


Call-By-Reference Annotations

Fortran and other languages pass procedure parameters by reference but SUIF uses call-by-value. To implement call-by-reference parameters, SUIF passes pointers to the actual parameters and then dereferences those pointers when the formal parameters are used. While this is perfectly adequate for many compiler passes, the pointer dereferences are difficult to handle in some high-level Fortran passes. The SUIF Fortran mode automatically converts the code to make it appear that the parameters are passed by reference. The library uses two predefined annotations to implement this.

k_call_by_ref
The Fortran front-end puts this annotation on pointer types that are used to implement call-by-reference parameter passing. The library uses this to detect parameters that should be modified when converting to Fortran mode. This annotation has no data on its immed list.
k_orig_type
While in Fortran mode, the types of the call-by-reference parameters are temporarily replaced. The orig_type annotations are attached to the parameter variables to record their original types. The immed list contains a single entry, the original pointer type of the parameter. These annotations are never written to the output files.


Go to the first, previous, next, last section, table of contents.