From ec8e95640f066dfe2b97865cc2ce018e7a5f64b9 Mon Sep 17 00:00:00 2001 From: Artem Dergachev Date: Mon, 1 Jul 2019 23:02:03 +0000 Subject: [analyzer] NFC: Add a convenient CallDescriptionMap class. It encapsulates the procedure of figuring out whether a call event corresponds to a function that's modeled by a checker. Checker developers no longer need to worry about performance of lookups into their own custom maps. Add unittests - which finally test CallDescription itself as well. Differential Revision: https://reviews.llvm.org/D62441 llvm-svn: 364866 --- clang/lib/StaticAnalyzer/Core/CallEvent.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'clang/lib/StaticAnalyzer') diff --git a/clang/lib/StaticAnalyzer/Core/CallEvent.cpp b/clang/lib/StaticAnalyzer/Core/CallEvent.cpp index 11dda7c3acb..6339423f112 100644 --- a/clang/lib/StaticAnalyzer/Core/CallEvent.cpp +++ b/clang/lib/StaticAnalyzer/Core/CallEvent.cpp @@ -393,8 +393,7 @@ bool CallEvent::isCalled(const CallDescription &CD) const { return false; } - return (CD.RequiredArgs == CallDescription::NoArgRequirement || - CD.RequiredArgs == getNumArgs()); + return (!CD.RequiredArgs || CD.RequiredArgs == getNumArgs()); } SVal CallEvent::getArgSVal(unsigned Index) const { -- cgit v1.2.3