On Thu, Jul 1, 2021 at 9:40 AM Erick Ochoa via Gcc <gcc@gcc.gnu.org> wrote: > > Hello, > > I have a function that looks at identifiers of formal parameters. I > found that when I ran this function on larger projects, the compiler > segfaulted. I looked into this and I found that there are some formal > parameters which have NULL in their DECL_NAME and that triggered a > NULL dereference. > > I also noticed that these parameters when printed with > dump_function_to_file were displayed using their DECL_UIDs. Digging a > little bit deeper, the function responsible for printing parameters > names is dump_decl_name. However, I am interested not in printing the > names but having them as strings. > > I noticed that dump_decl_name takes a pretty_printer argument. Is it > possible to somehow pass a pretty_printer and get the string instead > of printing it?
You can look at its buffer I think. Richard. > Thanks!