Re: detect empty functions

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 02/06/2014 03:15 PM, Prathamesh Kulkarni wrote:
On Thu, Feb 6, 2014 at 5:34 PM, Florian Weimer <fweimer@xxxxxxxxxx> wrote:
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.

I was looking for a way to detect empty function at GENERIC level.
Is the following correct way to do it ?

I expect it's not fully reliable because the parser will remove some constructs and add others. It depends on what you're trying to achieve.

--
Florian Weimer / Red Hat Product Security Team




[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux