llvm-project/clang/lib/Analysis
Raphael Isemann 785e8161ad [analyzer] MinComplexityConstraint now early exits and only does one macro stack lookup
Summary:
This patch contains performance improvements for the `MinComplexityConstraint`. It reduces the constraint time when running on the SQLite codebase by around 43% (from 0.085s down to 0.049s).

The patch is essentially doing two things:

* It introduces a possibility for the complexity value to early exit when reaching the limit we were checking for. This means that once we noticed that the current clone is larger than the limit the user has set, we instantly exit and no longer traverse the tree or do further expensive lookups in the macro stack.

* It also removes half of the macro stack lookups we do so far. Previously we always checked the start and the end location of a Stmt for macros, which was only a middle way between checking all locations of the Stmt and just checking one location. In practice I rarely found cases where it really matters if we check start/end or just the start of a statement as code with lots of macros that somehow just produce half a statement are very rare.

Reviewers: NoQ

Subscribers: cfe-commits, xazax.hun, v.g.vassilev

Differential Revision: https://reviews.llvm.org/D34361

llvm-svn: 312440
2017-09-03 13:45:33 +00:00
..
AnalysisDeclContext.cpp [CFG] Add LoopExit information to CFG 2017-08-19 11:19:16 +00:00
BodyFarm.cpp Encapsulate FPOptions and use it consistently 2017-03-27 19:17:25 +00:00
BodyFarm.h Make headers self-contained. 2016-02-02 11:06:57 +00:00
CFG.cpp Implement CFG construction for __try / __except / __leave. 2017-08-23 15:33:16 +00:00
CFGReachabilityAnalysis.cpp
CFGStmtMap.cpp
CMakeLists.txt Add support for __builtin_os_log_format[_buffer_size] 2016-10-24 20:39:34 +00:00
CallGraph.cpp [analyzer] Consider function call arguments while building CallGraph. 2017-01-27 12:14:56 +00:00
CloneDetection.cpp [analyzer] MinComplexityConstraint now early exits and only does one macro stack lookup 2017-09-03 13:45:33 +00:00
CocoaConventions.cpp Allow the cf_returns_[not_]retained attributes to appear on out-parameters. 2015-06-19 23:17:46 +00:00
CodeInjector.cpp Roll-back r250822. 2015-10-20 13:23:58 +00:00
Consumed.cpp [NFC] Header cleanup 2016-07-18 19:02:11 +00:00
Dominators.cpp
FormatString.cpp Add support for __builtin_os_log_format[_buffer_size] 2016-10-24 20:39:34 +00:00
FormatStringParsing.h [NFC] Header cleanup 2016-07-18 19:02:11 +00:00
LiveVariables.cpp [analyzer] Remove superquadratic behaviour from DataflowWorklist 2016-10-13 21:31:46 +00:00
OSLog.cpp Make helpers static. NFC. 2017-02-11 12:21:17 +00:00
ObjCNoReturn.cpp
PostOrderCFGView.cpp
PrintfFormatString.cpp [clang] Fix handling of "%zd" format specifier 2017-07-14 22:57:00 +00:00
ProgramPoint.cpp Roll-back r250822. 2015-10-20 13:23:58 +00:00
PseudoConstantAnalysis.cpp Added LLVM_FALLTHROUGH to address warning: this statement may fall through. NFC. 2017-06-03 06:23:51 +00:00
ReachableCode.cpp Fix PR13910: Don't warn that __builtin_unreachable() is unreachable 2017-04-11 15:36:06 +00:00
ScanfFormatString.cpp [clang] Fix handling of "%zd" in scanf 2017-07-20 20:11:47 +00:00
ThreadSafety.cpp Reland "Thread Safety Analysis: fix assert_capability." 2017-08-08 19:44:34 +00:00
ThreadSafetyCommon.cpp DR616, and part of P0135R1: member access (or pointer-to-member access) on a 2016-12-03 01:14:32 +00:00
ThreadSafetyLogical.cpp Revert r240270 ("Fixed/added namespace ending comments using clang-tidy"). 2015-06-22 23:07:51 +00:00
ThreadSafetyTIL.cpp Spelling mistakes in comments. NFCI. (PR27635) 2017-03-30 14:13:19 +00:00
UninitializedValues.cpp NFC small format 2016-10-29 15:28:25 +00:00