This is an archive of the discontinued LLVM Phabricator instance.

[analyzer] Another RetainCountChecker cleanup
ClosedPublic

Authored by george.karpenkov on Jan 15 2019, 4:42 PM.

Details

Summary

This is not NFC strictly speaking, since it unifies CleanupAttr handling,
so that out parameters now also understand it.

Diff Detail

Repository
rC Clang

Event Timeline

NoQ added a comment.Jan 15 2019, 5:06 PM

This is not NFC strictly speaking

Test? (:

clang/lib/StaticAnalyzer/Checkers/RetainCountChecker/RetainCountChecker.cpp
1162–1166 ↗(On Diff #181931)

Slightly shorter:

const MemRegion *MR = loc.getAsRegion();
if (!MR)
  return;

if (shouldEscapeRegion(MR)) { ... }

It should be equivalent because the only other case in which getAsRegion() succeeds is when the value is nonloc::LocAsInteger but it's something you can bind *to*.

george.karpenkov marked an inline comment as done.

Added test.

NoQ accepted this revision.Jan 16 2019, 3:23 PM

Thx (:

This revision is now accepted and ready to land.Jan 16 2019, 3:23 PM
This revision was automatically updated to reflect the committed changes.