I am trying to print all functions' names in my C/C++ code by parsing the code through LLVM. I referred the example given here http://llvm.org/docs/WritingAnLLVMPass.html#basic-code-required The example works fine for C code input but for C++ input, it displays following function names in a simple Hello World program
__cxx_global_var_init
main
GLOBAL_I_a
Then I found that LLVM has a certain issue with iostream as explained here: http://llvm.org/docs/FAQ.html#what-is-this-llvm-global-ctors-and-global-i-a-stuff-that-happens-when-i-include-iostream
I removed iostream from my code and then I got only "main" as output.
But for a multi-function C++ program that lets say contains the following functions: convertperm, findType and main (does not have iostream), I got the following output
_Z11convertpermSs
_Z8findtypeSs
main
Multi-function C programs work properly
Can anyone provide a fix to this problem?