On Thu, Jul 15, 2021 at 10:01:01AM +0200, Richard Biener wrote: > On Thu, Jul 15, 2021 at 4:24 AM Trevor Saunders <tbsau...@tbsaunde.org> wrote: > > > > On Wed, Jul 14, 2021 at 01:27:54PM +0200, Richard Biener wrote: > > > On Wed, Jul 14, 2021 at 10:20 AM Trevor Saunders <tbsau...@tbsaunde.org> > > > wrote: > > > > > > > > prior to this commit all calls to build_decl used input_location, even > > > > if > > > > temporarily until build_decl reset the location to something else that > > > > it was > > > > told was the proper location. To avoid using the global we need the > > > > caller to > > > > pass in the location it wants, however that's not possible with > > > > make_node since > > > > it makes other types of nodes. So we force all callers who wish to > > > > make a decl > > > > to go through build_decl which already takes a location argument. To > > > > avoid > > > > changing behavior this just explicitly passes in input_location to > > > > build_decl > > > > for callers of make_node that create a decl, however it would seem in > > > > many of > > > > these cases that the location of the decl being coppied might be a > > > > better > > > > location. > > > > > > > > bootstrapped and regtested on x86_64-linux-gnu, ok? > > > > > > I think all eventually DECL_ARTIFICIAL decls should better use > > > UNKNOWN_LOCATION instead of input_location. > > > > You'd know if that might break something better than me, but that seems > > sensible in principal. That said, I would like to incrementally do one > > thing at a time, rather than change make_node to use unknown_location, > > and set the location to something else all at once, but I suppose I > > could first change some callers to be build_decl (unknown_location, ...) > > and then come back to changing make_node when there's fewer callers to > > reason about if that's preferable. > > Sure, we can defer changing make_node (I thought the patch catched all > but three callers ...). But it feels odd to introduce so many explicit > input_location uses for cases where it clearly doesn't matter (the > DECL_ARTIFICIAL), > so I'd prefer to "fix" those immediately,
Fair enough, I think you just have more expereience and confidence it can't matter than I do yet, I'll work on fixing them immediately. Trev