This is an archive of the discontinued LLVM Phabricator instance.

Extend misc-unused-parameters to delete parameters of static functions
ClosedPublic

Authored by djasper on Jul 19 2015, 8:03 PM.

Details

Reviewers
chandlerc
Summary

Also see: llvm.org/PR24180.

Diff Detail

Event Timeline

djasper updated this revision to Diff 30132.Jul 19 2015, 8:03 PM
djasper retitled this revision from to Extend misc-unused-parameters to delete parameters of static functions.
djasper updated this object.
djasper added a reviewer: chandlerc.
djasper added subscribers: alexfh, cfe-commits.
chandlerc accepted this revision.Jul 19 2015, 8:14 PM
chandlerc edited edge metadata.

Feel free to address the comments below in a follow-up patch. This seems a fine next step, LGTM

clang-tidy/misc/UnusedParametersCheck.cpp
76

Hmm, I thought of a reason to not delete parameters from local functions -- if they're used in some way other than calling them such as using them as an argument to a template.

Maybe check for non-CallExpr DeclRefExprs of the function, and fall back to the commenting strategy?

test/clang-tidy/misc-unused-parameters.cpp
23–24

Does this already handle function in anonymous namespaces? Want to add those as a follow-up? The next obvious chunk is to handle non-virtual methods of classes in anonymous namespaces. Perhaps those will be handled automatically though.

This revision is now accepted and ready to land.Jul 19 2015, 8:14 PM
djasper closed this revision.Jul 19 2015, 8:43 PM

Addressed both comments and submitted as r242659.