I got this question in the mail today.
Seems like a simple enough question, but grep won’t provide that answer :) It also happens to be an excellent usecase for Dehydra.
My script:
1 2 3 4 5 6 | |
1 2 3 4 5 6 | |
process_type is called every time GCC hits a class declaration or a template is instantiated(also for enums and unions, but those get ignored with the .kind check). Then input_end is called when GCC is done processing the file. this.aux_base_name is the input filename.
I hooked up this script to the mozilla build by adding the following to .mozconfig:
1 2 3 | |
Then I built:
1 2 | |
Count:
1 2 3 | |
Answer: 15001
There are a million other trivial queries that could be accomplished in a similar manner that weren’t easy or possible before.
Update: Fixed typo, had an extra zero in the answer