From: Chris Wilson <cwilson@CS.Stanford.EDU>
Date: Tue, 6 Sep 94 23:42:55 PDT
Subject: Re: Porky
Message-Id: <CMM.0.90.4.778920175.cwilson@Xenon.Stanford.EDU>
> Hello!
>
> I have a question about 'porky'.
> Is it possible to use or modify 'porky', so that it steps through single
> procedures like 'suif_proc_iter'?
>
> The goal is, that only want to use 'porky', if a procedure of a given
> program fulfills certain conditions.
>
> -- M.M.
First of all, just to make sure we're talking about the same thing (I
apologize if I'm stating the obvious), I want to point out that
suif_proc_iter is a function in a library, and porky is a pass, a
complete program that reads an input SUIF file and writes an output
SUIF file. So porky and suif_proc_iter are entirely different things.
Porky steps through all the procedures itself.
Since porky is a pass, it can't be ``called'' from your code, though
it can be run after some of your passes and before others. The way
you would communicate with porky would be by placing annnotations on
the code that porky would understand.
There is no feature in porky to allow you to specify which procedures
to work on, but you could modify your own copy of porky to add this
feature. It should only take a couple of lines added to porky to make
it look for an annotation name you choose (something like
"porky, ignore this procedure"), and if such an annotation were on the
proc_sym, it would not do anything to that procedure.
Then you would write your own pass to test the conditions for ignoring
a procedure and put annotations on the correct proc_syms. Then you
would run your pass before porky. That way you could make the
conditions as complicated as you'd like and change your own code as
often as necessary without making any more changes to porky, or
risking breaking something in porky.
--Chris