This is an archive of the discontinued LLVM Phabricator instance.

[analyzer] MoveChecker Pt.9: Add a "peaceful" mode in which it finds only 100% authentic bugs.
ClosedPublic

Authored by NoQ on Dec 14 2018, 5:16 PM.

Details

Summary

(whoops accidentally sent too early, fixing now)

As a safety net, allow disabling the mode in which the checker warns on use-after-move of locals. Despite seeming to be successful and probably good to be on by default, it's still speculative and risky.

Diff Detail

Repository
rL LLVM

Event Timeline

NoQ created this revision.Dec 14 2018, 5:16 PM
NoQ retitled this revision from [analyzer] MoveChecker Pt.9: Add a "peaceful" to [analyzer] MoveChecker Pt.9: Add a "peaceful" mode in which it finds only 100% authentic bugs..Dec 14 2018, 5:18 PM
NoQ edited the summary of this revision. (Show Details)
NoQ set the repository for this revision to rC Clang.
NoQ removed subscribers: xazax.hun, szepet, Szelethus.
Szelethus added inline comments.Dec 15 2018, 2:49 AM
lib/StaticAnalyzer/Checkers/MoveChecker.cpp
29 ↗(On Diff #178322)

Somewhat unrelated, but the size of this anonymous namespace is far too great.

188–195 ↗(On Diff #178322)

You can acquire a DiagnosticsEngine through ASTContext, which can be acquired from CheckerManager. I think it'd prefer to see an error if I messed up the input.

NoQ added inline comments.Dec 15 2018, 5:44 PM
lib/StaticAnalyzer/Checkers/MoveChecker.cpp
188–195 ↗(On Diff #178322)

Hmm. I should probably also honor the compatibility mode then.

NoQ added inline comments.Dec 16 2018, 10:09 AM
lib/StaticAnalyzer/Checkers/MoveChecker.cpp
188–195 ↗(On Diff #178322)

And think if i want to bail out entirely.

Maybe next time? Let's figure out how exactly do we want these errors to look and behave before introducing restrictions.

Szelethus added inline comments.Dec 16 2018, 11:10 AM
lib/StaticAnalyzer/Checkers/MoveChecker.cpp
188–195 ↗(On Diff #178322)

Hmmm, maybe adding an error handling method to CheckerManager would be elegant enough. I'll leave it up to you.

This revision was not accepted when it landed; it landed in state Needs Review.Dec 16 2018, 10:23 PM
This revision was automatically updated to reflect the committed changes.