On Fri, 24 Aug 2012, Diego Novillo wrote: > On 2012-08-24 12:03 , Gabriel Dos Reis wrote: > > > I would just use C++ standard function `at()' (e.g. as found in vector<T>) > > for this. > > Sure. For regular functions, using default-valued arguments would be fine. > But I think the mechanism would be much more transparent if the compiler did > the heavy lifting. > > 1- Add a class/function attribute that makes the compiler add 3 hidden > args for the caller location. > > 2- During code generation, the compiler fills in these values at call > sites.
I don't think we want this ... how do you handle passing on this hidden argument to callees in the function? How do you distinguish between pass-through and passing a new pack? Consider bar () __attribute__((pack)); foo () __attribute__((pack)) { malloc (); record (__builtin_file()); bar (); } so we want to record calls of foo but also calls of bar. How do you distinguish the case where the pack needs to be passed down to bar from the case where bar itself needs to be tracked. Richard.