This is an archive of the discontinued LLVM Phabricator instance.

[analyzer][solver][NFC] Refactor how we detect (dis)equalities
ClosedPublic

Authored by vsavchenko on Jul 9 2021, 4:50 AM.

Details

Summary

This patch simplifies the way we deal with (dis)equalities.
Due to the symmetry between constraint handler and range inferrer,
we can have very similar implementations of logic handling
questions about (dis)equality and assumptions involving (dis)equality.

It also helps us to remove one more visitor, and removes uncertainty
that we got all the right places to put trackNE and trackEQ.

Diff Detail

Event Timeline

vsavchenko created this revision.Jul 9 2021, 4:50 AM
vsavchenko requested review of this revision.Jul 9 2021, 4:50 AM
Herald added a project: Restricted Project. · View Herald TranscriptJul 9 2021, 4:51 AM
Herald added a subscriber: cfe-commits. · View Herald Transcript
martong accepted this revision.Jul 9 2021, 8:22 AM

LGTM!

clang/lib/StaticAnalyzer/Core/RangeConstraintManager.cpp
687

This is no longer a structure.

clang/test/Analysis/equality_tracking.c
223–235

Thanks, for the new test cases!

This revision is now accepted and ready to land.Jul 9 2021, 8:22 AM
vsavchenko marked an inline comment as done.

Fix comments

clang/lib/StaticAnalyzer/Core/RangeConstraintManager.cpp
687

Good catch!

This revision was landed with ongoing or failed builds.Jul 13 2021, 11:01 AM
This revision was automatically updated to reflect the committed changes.