[PATCH] D36441: Add Support for Reference Counting of Parameters on the Callee Side in RetainCountChecker
Devin Coughlin via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Mon Aug 14 14:42:20 PDT 2017
dcoughlin added a comment.
Thanks! This looks good to me, with the note about factoring out the duplicated logic addressed, Would you factor out that logic into a static function and update phabricator summary to be a commit message. Then I will commit!
================
Comment at: lib/StaticAnalyzer/Checkers/RetainCountChecker.cpp:3971
+ const ArgEffect *AE = CalleeSideArgEffects.lookup(idx);
+ if (AE && *AE == DecRef && Ty.getAsString().substr(0, 4) == "isl_")
+ state = setRefBinding(state, Sym, RefVal::makeOwned(RetEffect::ObjKind::Generalized, Ty));
----------------
Can you factor out the logic that looks whether the type name starts with "isl_" to a static function that types a type and is called something 'isGeneralizedObjectRef"? This will avoid duplicating the logic twice here and will also give us a single place to update when we add an attribute indicating that a type is reference counted.
Repository:
rL LLVM
https://reviews.llvm.org/D36441
More information about the cfe-commits
mailing list