From: Erick Ochoa <eochoa@gcc.gnu.org>
To: gcc@gcc.gnu.org
Subject: How to dump_decl_name to a string instead to a file?
Date: Thu, 1 Jul 2021 09:35:15 +0200 [thread overview]
Message-ID: <CAJ_nqzhz_-TQc2YK17XTweJnq9LRS2n5SRCY-w=DSk_TNguWdQ@mail.gmail.com> (raw)
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?
Thanks!
next reply other threads:[~2021-07-01 7:35 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-07-01 7:35 Erick Ochoa [this message]
2021-07-01 9:28 ` Richard Biener
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CAJ_nqzhz_-TQc2YK17XTweJnq9LRS2n5SRCY-w=DSk_TNguWdQ@mail.gmail.com' \
--to=eochoa@gcc.gnu.org \
--cc=gcc@gcc.gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).