From: Florian Weimer <fweimer@redhat.com>
To: Prathamesh Kulkarni <bilbotheelffriend@gmail.com>
Cc: gcc-help@gcc.gnu.org
Subject: Re: detect empty functions
Date: Thu, 06 Feb 2014 12:05:00 -0000 [thread overview]
Message-ID: <52F37A6A.4020209@redhat.com> (raw)
In-Reply-To: <CAJXstsBS1dFXr2gW94HbN=sf7T7Y3e9AT33Ok+b_ZUiDbqDq2A@mail.gmail.com>
On 02/05/2014 03:30 PM, Prathamesh Kulkarni wrote:
> I wanted to ask, is there a way to detect if a function has empty body
> using GCC API ?
Yes, you can write a plug-in and iterate over all the basic blocks in a
function and check if they are empty.
A function-like entity which contains no statements might still emit
code, so you need to figure what you need exactly.
--
Florian Weimer / Red Hat Product Security Team
next prev parent reply other threads:[~2014-02-06 12:05 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-02-05 13:30 Prathamesh Kulkarni
2014-02-05 14:03 ` vijay nag
2014-02-05 14:03 ` vijay nag
2014-02-05 14:30 ` Prathamesh Kulkarni
2014-02-06 10:14 ` vijay nag
2014-02-06 12:05 ` Florian Weimer [this message]
2014-02-06 14:16 ` Prathamesh Kulkarni
2014-02-06 14:18 ` Florian Weimer
2014-02-06 14:30 ` Prathamesh Kulkarni
2014-02-06 16:33 ` Florian Weimer
2014-02-06 11:40 ` Nicholas Mc Guire
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=52F37A6A.4020209@redhat.com \
--to=fweimer@redhat.com \
--cc=bilbotheelffriend@gmail.com \
--cc=gcc-help@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).