From: Steven Watanabe (watanabesj_at_[hidden])
Date: 2008-05-09 15:46:27
Simonson, Lucanus J wrote:
> Later on you would use -prof-gen-sampling to, among other things, create
> a map from object code to line number in the source code. This map
> should be a superset of data you are looking for, which is instantiation
> count for templates. For templates that don't end up with any object
> code (meta-functions) I think you would find no instantiations in the
> map, whereas you might still find that the compiler evaluated the
> meta-function many times with your warning based approach. I guess it
> depends on what you are looking for.
Metafunction instantiations are my primary concern.
> My own interest is that I would like to do performance profiling and
> tuning of template instantiated code with VTune. It looks like these
> compiler options in icc are more well suited to that than the static
> information you are looking for.
Yep. Oh well.
> Is there a way to write a meta-function that implements a counter?
There is no legal way to implement such a counter, AFAIK.
There are illegal ways, though.