This is an archive of the discontinued LLVM Phabricator instance.

[analyzer] [NFC] Simplify some visitors by giving a convenient getter from state to analysis manager
ClosedPublic

Authored by george.karpenkov on Jul 24 2018, 6:06 PM.

Diff Detail

Repository
rL LLVM

Event Timeline

@NoQ should be fine to commit?

NoQ added inline comments.Jul 30 2018, 2:38 PM
clang/lib/StaticAnalyzer/Core/BugReporterVisitors.cpp
289–290 ↗(On Diff #157178)

You can easily obtain SM from Ctx. Moreover, in fact Ctx can be obtained from R->getMemRegionManager() (i've no idea why do we keep a manager pointer in every region).

clang/lib/StaticAnalyzer/Core/ProgramState.cpp
500 ↗(On Diff #157178)

Unnecessary whitespace.

george.karpenkov marked 2 inline comments as done.
NoQ accepted this revision.Jul 30 2018, 3:11 PM
This revision is now accepted and ready to land.Jul 30 2018, 3:11 PM
This revision was automatically updated to reflect the committed changes.
NoQ added inline comments.Jul 30 2018, 3:55 PM
cfe/trunk/lib/StaticAnalyzer/Core/BugReporterVisitors.cpp
739

Btw why isn't this field private? I guess nobody cares because it's anyway exposed as a mutable reference, but we might have as well had consistency.

cfe/trunk/lib/StaticAnalyzer/Core/BugReporterVisitors.cpp
739

yeah that's how we always got it. No idea why.