This commit is mostly for experimentation purposes so far.
If the new iteration order is more successful, it would replace the previous one.
Details
- Reviewers
dcoughlin NoQ - Commits
- rGd1dd5c3a8872: [analyzer] Experiment with an iteration order only based on location, and not…
rC344313: [analyzer] Experiment with an iteration order only based on location, and not…
rL344313: [analyzer] Experiment with an iteration order only based on location, and not…
Diff Detail
Event Timeline
I remember when I joined the project how my team used to analyze projects with every iteration order to which is the best, so I think this patch will be appreciated.
clang/include/clang/StaticAnalyzer/Core/PathSensitive/WorkList.h | ||
---|---|---|
61 | Completely unrelated to this revision, but this class needs some doc desperately IMO :/ | |
clang/lib/StaticAnalyzer/Core/WorkList.cpp | ||
258 | CFGBlock::getBlockID returns with an unsigned int, did you mean this to be signed? I don't mean to be a living and breathing clang-tidy, but you explicitly mentioned using signed integer in the comment below. | |
272 | I believe some bots like to complain if you don't make operator() const. | |
299 | How about queue.push({U, {-NumVisited, ++Counter}});? |
Let's see how it goes!
That's a lot of code duplication, i guess it might make sense to refactor later.
clang/lib/StaticAnalyzer/Core/WorkList.cpp | ||
---|---|---|
258 | No, it doesn't need to be int; the comment below is about the other int. |
A few post-commit thoughts.
cfe/trunk/lib/StaticAnalyzer/Core/WorkList.cpp | ||
---|---|---|
284 ↗ | (On Diff #169335) | I usually imagine queue as a horizontal thing, so it's unclear to me whether "top" is "left" or "right". |
297 ↗ | (On Diff #169335) | Does this mean that Block 1 in foo() and Block 1 in bar() will always have the same NumReached value? |
cfe/trunk/lib/StaticAnalyzer/Core/WorkList.cpp | ||
---|---|---|
297 ↗ | (On Diff #169335) | That's a great point. Pushing an update. |
Completely unrelated to this revision, but this class needs some doc desperately IMO :/