I see when LLVM builds the CallGraph SCCs. a function calling through
a function pointer is conservatively assumed to call internal and
external functions. Therefore, it has an edges pointing to the
externalnode2, ie. the externalnode representing outgoing calls from
does LLVM have any function pointer analysis capabilities in the mainline ?
I’m not aware of such analyses in the mainline. Did you try DSAA in the poolalloc project? Also, how precise do you need the analysis to be?
If you use DSA, I recommend using the analysis in CallTargets.cpp and using the pass that uses TD instead of EQTD. As an FYI, I recently discovered that DSA (but not poolalloc) mainline compiles with LLVM mainline (thanks Will Dietz!). On , I have the LLVM tree and the poolalloc tree set up to compile LLVM and DSA. If you look at the source code for CallTargetMarker in , you’ll see what you need to do to get the targets of an indirect function call. If you have any questions, please let me know. Regards, John Criswell