This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: C++ and gather-detailed-mem-stats


Or no explicit parameters at all ...

void do_something (T1 t1, T2 t2) __attribute__ ((caller_info));

All this will do (with appropriate compilation switches
and/or pre-defined macros) is pass one/more hidden
arguments, which in turn can be accessed in the
function body via a built-in function.

#if CALLER_INFO_ENABLED
   __caller_info_t caller_info = __builtin_caller_info ();
   [...]
#endif

In this way, the programmer-visible function prototype
is unaffected, though the caller and the function
body have to be compiled with compatible settings.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]