From e19529b3d819415c64bbd543827dbf17ba2d016e Mon Sep 17 00:00:00 2001 From: Ted Kremenek Date: Fri, 16 Aug 2013 23:14:22 +0000 Subject: [PATCH] Use the number of parameters in the actual method or function to determine the CallEffects size. llvm-svn: 188587 --- clang/lib/StaticAnalyzer/Checkers/RetainCountChecker.cpp | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/clang/lib/StaticAnalyzer/Checkers/RetainCountChecker.cpp b/clang/lib/StaticAnalyzer/Checkers/RetainCountChecker.cpp index be2f220..a6ddf1df 100644 --- a/clang/lib/StaticAnalyzer/Checkers/RetainCountChecker.cpp +++ b/clang/lib/StaticAnalyzer/Checkers/RetainCountChecker.cpp @@ -318,12 +318,6 @@ public: return DefaultArgEffect; } - /// Return the number of argument effects. This is O(n) in the number - /// of arguments. - unsigned getNumArgs() const { - return std::distance(Args.begin(), Args.end()); - } - void addArg(ArgEffects::Factory &af, unsigned idx, ArgEffect e) { Args = af.add(Args, idx, e); } @@ -3689,7 +3683,7 @@ namespace clang { namespace ento { namespace objc_retain { const RetainSummary *S = M.get ## KIND ## Summary(D);\ CallEffects CE(S->getRetEffect());\ CE.Receiver = S->getReceiverEffect();\ - unsigned N = S->getNumArgs();\ + unsigned N = D->param_size();\ for (unsigned i = 0; i < N; ++i) {\ CE.Args.push_back(S->getArg(i));\ } -- 2.7.4