This is an archive of the discontinued LLVM Phabricator instance.

[analyzer] Refactor recursive symbol reachability check to use symbol_iterator
ClosedPublic

Authored by ddcc on Nov 16 2016, 4:16 PM.

Diff Detail

Repository
rL LLVM

Event Timeline

ddcc updated this revision to Diff 78285.Nov 16 2016, 4:16 PM
ddcc retitled this revision from to [analyzer] Refactor recursive symbol reachability check to use symbol_iterator.
ddcc updated this object.
ddcc added reviewers: zaks.anna, dcoughlin.
ddcc added a subscriber: cfe-commits.
zaks.anna accepted this revision.Nov 16 2016, 9:13 PM
zaks.anna edited edge metadata.

Thank you for the cleanup!!! For bonus points, please add comments to the class APIs:)

This revision is now accepted and ready to land.Nov 16 2016, 9:13 PM
NoQ added a subscriber: NoQ.Nov 17 2016, 10:38 AM
NoQ added inline comments.
lib/StaticAnalyzer/Core/ProgramState.cpp
542 ↗(On Diff #78285)

I guess we should break the loop here.

NoQ added inline comments.Nov 17 2016, 10:45 AM
lib/StaticAnalyzer/Core/ProgramState.cpp
535 ↗(On Diff #78285)

Hmm, the original code does actually visit non-SymbolData.

ddcc updated this revision to Diff 78392.Nov 17 2016, 11:01 AM
ddcc edited edge metadata.

Fix visitation, add early termination, add comments

ddcc added a comment.Nov 17 2016, 11:03 AM

I believe you're correct, the original code terminates early because of the short circuit evaluation on line 553, and visits all reachable nodes but doesn't recurse on non-SymbolData.

NoQ added a comment.Nov 17 2016, 11:37 PM

Yep, looks correct now :)

This revision was automatically updated to reflect the committed changes.