From 237d42bfa53c6fb8c3fc3760b91799e8f2f9f5e9 Mon Sep 17 00:00:00 2001 From: "Mikhail R. Gadelha" Date: Tue, 10 Jul 2018 13:46:05 +0000 Subject: [analyzer] Add option to set maximum symbol complexity threshold Summary: This adds an option, max-symbol-complexity, so an user can set the maximum symbol complexity threshold. Note that the current behaviour is equivalent to max complexity = 0, when taint analysis is not enabled and tests show that in a number of tests, having complexity = 25 yields the same results as complexity = 10000. This patch was extracted and modified from Dominic Chen's patch, D35450. Reviewers: george.karpenkov, NoQ, ddcc Reviewed By: george.karpenkov Subscribers: xazax.hun, szepet, a.sidorin Differential Revision: https://reviews.llvm.org/D49093 llvm-svn: 336671 --- clang/lib/StaticAnalyzer/Core/AnalyzerOptions.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'clang/lib/StaticAnalyzer/Core/AnalyzerOptions.cpp') diff --git a/clang/lib/StaticAnalyzer/Core/AnalyzerOptions.cpp b/clang/lib/StaticAnalyzer/Core/AnalyzerOptions.cpp index 6fa5fec5288..75c22a34ea7 100644 --- a/clang/lib/StaticAnalyzer/Core/AnalyzerOptions.cpp +++ b/clang/lib/StaticAnalyzer/Core/AnalyzerOptions.cpp @@ -388,6 +388,12 @@ unsigned AnalyzerOptions::getGraphTrimInterval() { return GraphTrimInterval.getValue(); } +unsigned AnalyzerOptions::getMaxSymbolComplexity() { + if (!MaxSymbolComplexity.hasValue()) + MaxSymbolComplexity = getOptionAsInteger("max-symbol-complexity", 10000); + return MaxSymbolComplexity.getValue(); +} + unsigned AnalyzerOptions::getMaxTimesInlineLarge() { if (!MaxTimesInlineLarge.hasValue()) MaxTimesInlineLarge = getOptionAsInteger("max-times-inline-large", 32); -- cgit v1.2.3