public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* Dumping CPP symbol table stats
@ 2010-02-24 19:13 Victor Norman
  2010-02-24 20:52 ` Ian Lance Taylor
  2010-02-26 19:25 ` Tom Tromey
  0 siblings, 2 replies; 3+ messages in thread
From: Victor Norman @ 2010-02-24 19:13 UTC (permalink / raw)
  To: gcc

I would like to tweak cpp to dump some usage stats from its symbol  
table -- like dumping which #defines were not used at all, etc.

I'm wondering if someone can help me figure out where in the code I  
would look to start to do this.

(I know that I'll need to add a command-line argument, and I'm sure I  
could figure that part out.)
Thanks.

Prof. Victor Norman
Computer Science
Calvin College
vnorman@calvin.edu
-----
"A designer knows he has achieved perfection not when there is nothing  
left to add, but when there is nothing left to take away." -- Antoine  
de Saint Exupéry







^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Dumping CPP symbol table stats
  2010-02-24 19:13 Dumping CPP symbol table stats Victor Norman
@ 2010-02-24 20:52 ` Ian Lance Taylor
  2010-02-26 19:25 ` Tom Tromey
  1 sibling, 0 replies; 3+ messages in thread
From: Ian Lance Taylor @ 2010-02-24 20:52 UTC (permalink / raw)
  To: Victor Norman; +Cc: gcc

Victor Norman <vnorman@calvin.edu> writes:

> I would like to tweak cpp to dump some usage stats from its symbol
> table -- like dumping which #defines were not used at all, etc.
>
> I'm wondering if someone can help me figure out where in the code I
> would look to start to do this.

libcpp/identifiers.c

Ian

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Dumping CPP symbol table stats
  2010-02-24 19:13 Dumping CPP symbol table stats Victor Norman
  2010-02-24 20:52 ` Ian Lance Taylor
@ 2010-02-26 19:25 ` Tom Tromey
  1 sibling, 0 replies; 3+ messages in thread
From: Tom Tromey @ 2010-02-26 19:25 UTC (permalink / raw)
  To: Victor Norman; +Cc: gcc

>>>>> "Victor" == Victor Norman <vnorman@calvin.edu> writes:

Victor> I would like to tweak cpp to dump some usage stats from its symbol
Victor> table -- like dumping which #defines were not used at all, etc.

In addition to what Ian said, for this particular case, search for
warn_unused_macros in libcpp.  That will show you the implementation of
a similar feature.

Tom

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2010-02-26 19:03 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-02-24 19:13 Dumping CPP symbol table stats Victor Norman
2010-02-24 20:52 ` Ian Lance Taylor
2010-02-26 19:25 ` Tom Tromey

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).