Gabriel Charette <gch...@google.com> a écrit: > On Thu, Aug 11, 2011 at 12:27 AM, Richard Guenther > <richard.guent...@gmail.com> wrote: >> On Wed, Aug 10, 2011 at 8:22 PM, Gabriel Charette <gch...@google.com> wrote: >>> There was a bug where c_finish_options would create some builtins and >>> assign them source_locations in the linemap other than BUILTINS_LOCATION == >>> 1. >>> >>> Thus, when calling DECL_IS_BUILTIN to know if a decl is a builtin, some of >>> them would return false as they had a source_location other than >>> BUILTINS_LOCATION within the line_map entry that was incorrectly created in >>> c_finish_options. >> >> DECL_IS_BUILTIN is almost never the appropriate thing to use, instead >> you should use DECL_BUILT_IN (and grepping, I see some suspicious uses >> ...). > > Why don't all builtins have BUILTINS_LOCATION as their location? It > doesn't make sense to me that we need to create a line_table entry for > builtins as they don't have line/col information.
Good observation. I wonder the same thing. FWIW, record_builtin_type in c-decl.c set the location of that the TYPE_DECL of builtin types to UNKNOWN_LOCATION, whereas the record_builtin_type of cp/decl.c correctly sets it to BUILTINS_LOCATION. I think the c-decls.c case should be changed to use BUILTINS_LOCATION too. -- Dodji