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