Page MenuHomePhabricator

[analyzer] A better CFG-based suppress-on-sink.
ClosedPublic

Authored by NoQ on Jul 20 2017, 3:37 AM.

Details

Summary

Because D28023 wasn't enough, as i've just seen an assertion-like macro with as many as 12 CFG blocks (including do..while(false) loops), i mocked up a quick CFG depth-first search to easily detect blocks dominated by noreturn blocks.

Diff Detail

Repository
rL LLVM

Event Timeline

NoQ created this revision.Jul 20 2017, 3:37 AM
a.sidorin accepted this revision.Jul 21 2017, 1:27 AM

Just a minor nit.

lib/StaticAnalyzer/Core/BugReporter.cpp
3332 ↗(On Diff #107476)

The check for visited can be placed into the loop below so we won't even add such blocks to the worklist.

This revision is now accepted and ready to land.Jul 21 2017, 1:27 AM
NoQ updated this revision to Diff 107871.Jul 24 2017, 2:49 AM

Reduce stack operations as Alexey suggested.

This revision was automatically updated to reflect the committed changes.
dcoughlin added inline comments.Jul 25 2017, 1:02 PM
cfe/trunk/lib/StaticAnalyzer/Core/BugReporter.cpp
3313

Do you really mean "is dominated by"? That is, "every path from the entry to N's block goes through a no-return block"? Or do you mean "the exit block is not reachable from N's block"?