|Function Referencing in C email@example.com (1993-06-29)|
|Re: Function Referencing in C firstname.lastname@example.org (1993-06-30)|
|Re: Function Referencing in C synaptx!thymus!daveg@uunet.UU.NET (Dave Gillespie) (1993-06-30)|
|From:||Dave Gillespie <synaptx!thymus!daveg@uunet.UU.NET>|
|Date:||Wed, 30 Jun 1993 18:10:17 GMT|
Eric Martinson writes:
> We are looking for a tool that will allow us to scan many (very many) C
> source files to determine which functions are no longer used.
> [If you're compiling them on a Unix system, I've often hacked up a little
> cross-referencer which uses nm, sort, and some awk scripts ... -John]
GCC has a debug switch, "-dr" I believe, that tells it to dump its RTL
(intermediate code). I once wrote a call grapher in a few minutes that
ran GCC and then picked out the function-call cookies from the RTL.
If you look at a sample RTL file, you'll see that every function
call uses the same idiom. It's also easy to identify calls through
You'll need to find the set of functions whose address is taken.
You may be able to get that from prior knowledge; otherwise, look
for "symbol_ref" cookies whose arguments are function names and
which are not themselves the arguments of "call"s.
Return to the
Search the comp.compilers archives again.