This is an archive of the discontinued LLVM Phabricator instance.

[analyzer] Do not duplicate call graph nodes for function that has definition and forward declaration.
ClosedPublic

Authored by IvanSidorenko on Feb 7 2017, 7:46 AM.

Details

Summary

Fix in call graph construction: don't build call graph node for callee function twice for functions with forward declarations.

Maybe the same fix should be done and for VisitObjCMethodDecl. Unfortunately, I have not enough expertise in ObjC, so I did not touch this code.

Test case:
void do_nothing() {}
void test_single_call();
void test_single_call() {

do_nothing();

}

Output for the test case WITHOUT patch:
Function: test_single_call calls: do_nothing do_nothing
Function: do_nothing calls:

Output for the test case WITH patch:
Function: test_single_call calls: do_nothing
Function: do_nothing calls:

Diff Detail

Repository
rL LLVM

Event Timeline

IvanSidorenko created this revision.Feb 7 2017, 7:46 AM
zaks.anna accepted this revision.Feb 17 2017, 5:31 PM

Looks good. Thank you for catching this!

Do you have commit access or should I commit on your behalf?

This revision is now accepted and ready to land.Feb 17 2017, 5:31 PM

Anna, I will commit. Thank you!

This revision was automatically updated to reflect the committed changes.