Finding the functions whose addresses are taken.

Hi,
How to find in a module, the list of functions whose addresses are ever taken into some variables?

- Sanjiv

Each function is a GlobalValue. Find all the uses of them... any uses
that are not a "call" with the function as callee goes into your list.

Global variables work the same way. Find the uses of them that are
not "Load" or "Store" instructions with the global value as the
pointer operand.

Kenneth Uildriks <kennethuil <at> gmail.com> writes:

Each function is a GlobalValue. Find all the uses of them... any uses
that are not a "call" with the function as callee goes into your list.

One fun possibility is the following "call which is not
a call" (was actually spotted in the wild):

call void (...)* bitcast (void (i32)* @exit to void (...)*)(i32
73) noreturn nounwind