On Mon, Sep 21, 2015 at 12:29:36PM +0200, Richard Biener wrote: > On Mon, Sep 21, 2015 at 11:59 AM, Manuel López-Ibáñez > <lopeziba...@gmail.com> wrote: > > On 21 September 2015 at 10:18, Richard Biener > > <richard.guent...@gmail.com> wrote: > >> input_location is set from the call stmt: > >> > >> /* FIXME: instantiate_decl isn't called by inlinable_function_p. */ > >> saved_location = input_location; > >> input_location = gimple_location (stmt); > >> > >> it would be nice to get rid of that. > > > > I could replace all uses of input_location in this function by > > gimple_location(stmt) as I noted in the comments. Would that be ok if > > it works? I'm not sure I can prove that input_location is not used > > behind the scenes for some other purpose (all the more reason to kill > > input_location once and for all). Friends, don't let friends use > > input_location in new code! > > Yeah... not sure how to check but to look for any changes in > generated cc1/cc1plus > debug info. You could also try making it invalid (-1?) and hope > libcpp would eventually > blow up if that is used.
I've been kind of meaning to add some raii classes like auto_assert_no_input_location that assert if you use input_location while its on the stack. It shouldn't be that hard to do, so it'd be cool if someone beat me to getting it done :) Trev