summaryrefslogtreecommitdiffstats
path: root/clang/lib/StaticAnalyzer/Core/CallEvent.cpp
diff options
context:
space:
mode:
authorArtem Dergachev <artem.dergachev@gmail.com>2019-07-01 23:02:03 +0000
committerArtem Dergachev <artem.dergachev@gmail.com>2019-07-01 23:02:03 +0000
commitec8e95640f066dfe2b97865cc2ce018e7a5f64b9 (patch)
tree1f12cab550902712f65b861e1af1fbca0010dcae /clang/lib/StaticAnalyzer/Core/CallEvent.cpp
parent02f91ddf1b353b28697b288edbe6a8a828705781 (diff)
downloadbcm5719-llvm-ec8e95640f066dfe2b97865cc2ce018e7a5f64b9.tar.gz
bcm5719-llvm-ec8e95640f066dfe2b97865cc2ce018e7a5f64b9.zip
[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
Diffstat (limited to 'clang/lib/StaticAnalyzer/Core/CallEvent.cpp')
-rw-r--r--clang/lib/StaticAnalyzer/Core/CallEvent.cpp3
1 files changed, 1 insertions, 2 deletions
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 {
OpenPOWER on IntegriCloud