summaryrefslogtreecommitdiff
path: root/lib/StaticAnalyzer/Checkers/BuiltinFunctionChecker.cpp
diff options
context:
space:
mode:
authorArtem Dergachev <artem.dergachev@gmail.com>2018-02-10 00:51:47 +0000
committerArtem Dergachev <artem.dergachev@gmail.com>2018-02-10 00:51:47 +0000
commit6e050d9bef4498d98610a01e548dce3e8814bb0d (patch)
tree66fae4a0f75d412e381bab8c0100c70a8c0dc0ab /lib/StaticAnalyzer/Checkers/BuiltinFunctionChecker.cpp
parent1774e274acf780c3ca203e40f8968f5fee1682c2 (diff)
downloadclang-6e050d9bef4498d98610a01e548dce3e8814bb0d.tar.gz
[analyzer] Add support for __builtin_constant_p.
This builtin is evaluated in compile time. But in the analyzer we don't yet automagically evaluate all calls that can be evaluated in compile time. Patch by Felix Kostenzer! Differential Revision: https://reviews.llvm.org/D42745 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@324789 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/StaticAnalyzer/Checkers/BuiltinFunctionChecker.cpp')
-rw-r--r--lib/StaticAnalyzer/Checkers/BuiltinFunctionChecker.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/StaticAnalyzer/Checkers/BuiltinFunctionChecker.cpp b/lib/StaticAnalyzer/Checkers/BuiltinFunctionChecker.cpp
index 93c9bfa043..0e781d08e2 100644
--- a/lib/StaticAnalyzer/Checkers/BuiltinFunctionChecker.cpp
+++ b/lib/StaticAnalyzer/Checkers/BuiltinFunctionChecker.cpp
@@ -96,7 +96,8 @@ bool BuiltinFunctionChecker::evalCall(const CallExpr *CE,
return true;
}
- case Builtin::BI__builtin_object_size: {
+ case Builtin::BI__builtin_object_size:
+ case Builtin::BI__builtin_constant_p: {
// This must be resolvable at compile time, so we defer to the constant
// evaluator for a value.
SVal V = UnknownVal();