In any case, I can determine if the function is called by the user by the user or not? For instance:
void foo() { printf("hello world again"); } int main() { printf("hello world\n"); foo(); }
As in this case, foo () is the defining user, while printf () is the library function.
The method I'm currently using is to iterate over all the modules and check if its size is greater than 0 or not. i.e:
for(Module::iterator F = M.begin(); F != M.end(); ++F) { Function &Func = *F; if(F->size()>0) errs() << "User Define"; }
But I'm not sure of its accuracy?
source share