This is an archive of the discontinued LLVM Phabricator instance.

[analyzer][NFC] Factor out the copy-paste code repetition of assumeDual and assumeInclusiveRangeDual
ClosedPublic

Authored by martong on May 19 2022, 2:26 AM.

Details

Summary

Depends on D125892. There might be efficiency and performance
implications by using a lambda. Thus, I am going to conduct measurements
to see if there is any noticeable impact.
I've been thinking about two more alternatives:

  1. Make assumeDualImpl a variadic template and (perfect) forward the arguments for the used assume function.
  2. Use a macros.

I have concerns though, whether these alternatives would deteriorate the
readability of the code.

Diff Detail

Event Timeline

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

Okay, it still looks a bit odd, but this is definitely an increment.

clang/lib/StaticAnalyzer/Core/ConstraintManager.cpp
48

Although this is a variable referring to a function, it's still a variable.
I find it difficult to read if a variable name is a verb.

This revision is now accepted and ready to land.May 19 2022, 8:02 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.