This is an archive of the discontinued LLVM Phabricator instance.

[analyzer] Implement assumeInclusiveRange in terms of assumeInclusiveRangeDual
ClosedPublic

Authored by martong on May 18 2022, 8:02 AM.

Details

Summary

Depends on D124758. This is the very same thing we have done for
assumeDual, but this time we do it for assumeInclusiveRange. This patch
is basically a no-brainer copy of that previous patch.

Diff Detail

Event Timeline

martong created this revision.May 18 2022, 8:02 AM
Herald added a project: Restricted Project. · View Herald Transcript
martong requested review of this revision.May 18 2022, 8:02 AM
Herald added a project: Restricted Project. · View Herald TranscriptMay 18 2022, 8:02 AM
Herald added a subscriber: cfe-commits. · View Herald Transcript

Okay, it took me a while to get what's going on.
Do you have anything in mind to express it by slightly less indirection, references, templates and well, virtual functions xD

Okay, it took me a while to get what's going on.
Do you have anything in mind to express it by slightly less indirection, references, templates and well, virtual functions xD

Okay, I see your point. Therefore, I am splitting up this patch into two:

  1. The no-brainer copy-paste from assumeDual implementaton.
  2. An NFC that tries to eliminate the copy paste coding. Efficiency and performance discussions should go there.
martong updated this revision to Diff 430611.May 19 2022, 2:24 AM
  • Split into two patches, this first patch will be just the no-brainer copy-paste from assumeDual implementaton.

Now I see, the summary confused me.

This includes the refactoring of the common assumle*Dual logic into the
function template assumeDualImpl.

I felt like this is a refactoring change, but it was not. It's about fixing the behavior by using the cloneAsPosteriorlyOverconstrained().
Please reword the summary.

clang/include/clang/StaticAnalyzer/Core/PathSensitive/SimpleConstraintManager.h
42–46

Why is this in the public: section, if the name of it suggests its a detail?

martong edited the summary of this revision. (Show Details)May 19 2022, 3:49 AM
martong updated this revision to Diff 430637.May 19 2022, 3:55 AM
martong marked an inline comment as done.
martong edited the summary of this revision. (Show Details)
  • Move SimpleConstraintManager's assume*Internal functions to be protected

Now I see, the summary confused me.

This includes the refactoring of the common assumle*Dual logic into the
function template assumeDualImpl.

I felt like this is a refactoring change, but it was not. It's about fixing the behavior by using the cloneAsPosteriorlyOverconstrained().
Please reword the summary.

Ok, done.

clang/include/clang/StaticAnalyzer/Core/PathSensitive/SimpleConstraintManager.h
42–46

Good point. I moved them under protected:.

martong edited the summary of this revision. (Show Details)May 19 2022, 3:56 AM
steakhal accepted this revision.May 19 2022, 4:39 AM
This revision is now accepted and ready to land.May 19 2022, 4:39 AM
This revision was landed with ongoing or failed builds.May 23 2022, 12:47 AM
This revision was automatically updated to reflect the committed changes.