[m-rev.] for review: inter-module analysis framework

Simon Taylor stayl at cs.mu.OZ.AU
Sat Aug 10 01:55:38 AEST 2002


On 09-Aug-2002, Peter Ross <pro at missioncriticalit.com> wrote:
> The key line is "which variables actually correspond to head variables"
> 
> Imagine
> :- pred p(list(T), list(T), list(T)).
> p(A, B, C)
> 
> p is defined with 3 `real' head variables, while the definition has 4
> actual headvariables
> 
> p(TI_T, A, B, C)
> then unused arg elimination
> 
> p_ua(TI_T, X, Y)
> 
> at this point it can be difficult to relate the arguments back to the
> original code.  ie is X variable A or B, and is Y A or B.

Why are you trying to relate the arguments back to the
original code? The "source" for the structure reuse pass
is the HLDS after several source-to-source transformations
have been applied. If you're trying to relate that back
to the original source code, then yes, you're going to get
very confused.

If you need to relate the transformed code back to the source you
will need to explicitly record at each step the transformations
on the interface. For example, `p_ua' would need an annotation
stating that it was created by removing the second argument of `p'.
Attempting to do this by matching variable numbers before and
after transformations is a brittle hack.

Simon.
--------------------------------------------------------------------------
mercury-reviews mailing list
post:  mercury-reviews at cs.mu.oz.au
administrative address: owner-mercury-reviews at cs.mu.oz.au
unsubscribe: Address: mercury-reviews-request at cs.mu.oz.au Message: unsubscribe
subscribe:   Address: mercury-reviews-request at cs.mu.oz.au Message: subscribe
--------------------------------------------------------------------------



More information about the reviews mailing list