This is an archive of the discontinued LLVM Phabricator instance.

[StaticAnalyzer] Remove dead code (DO NOT COMMIT)
AbandonedPublic

Authored by kazu on Jun 14 2022, 2:27 PM.

Details

Reviewers
NoQ
Summary

DO NOT COMMIT! This untested patch deletes dead code under
clang/lib/StaticAnalyzer, including debug functions. Please
intelligently choose what to actually remove.

Diff Detail

Event Timeline

kazu created this revision.Jun 14 2022, 2:27 PM
Herald added a project: Restricted Project. · View Herald TranscriptJun 14 2022, 2:27 PM
kazu requested review of this revision.Jun 14 2022, 2:27 PM
Herald added a project: Restricted Project. · View Herald TranscriptJun 14 2022, 2:27 PM
Herald added a subscriber: cfe-commits. · View Herald Transcript

Thanks!

What was your method to discover the unused code? Did you use an automated tool?

clang/lib/StaticAnalyzer/Checkers/ArrayBoundCheckerV2.cpp
66

We shall not delete any dump or LLVM_DUMP_METHOD annotated function because they can be really useful in actual debugging, either in gdb or with other tools.

clang/lib/StaticAnalyzer/Checkers/CheckerDocumentation.cpp
30–33

As the comment says, we need this to demonstrate and document what can be the possible callbacks.

Thanks @kazu. I evaluated your results and made a patch as D127836.
I think we can abandon this one.

kazu abandoned this revision.Aug 20 2022, 9:14 AM