Go to file
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
clang [analyzer] MinComplexityConstraint now early exits and only does one macro stack lookup 2017-09-03 13:45:33 +00:00
clang-tools-extra [cppcoreguidelines] Don't rely on SmallPtrSet iteration order. 2017-08-30 20:18:40 +00:00
compiler-rt (NFC) Fix the use of do{}while(0) in a macro. 2017-09-02 00:09:57 +00:00
debuginfo-tests Fix debuginfo-tests with GDB on Linux 2017-08-31 18:16:55 +00:00
libclc relational: Implement shuffle2 builtin 2017-09-02 02:23:28 +00:00
libcxx [libcxx] [www] Change an absolute link to cxx1z_status.html to be relative. 2017-08-31 17:59:51 +00:00
libcxxabi Revert "[libcxxabi] When built with ASan, __cxa_throw calls __asan_handle_no_return" 2017-08-16 22:05:54 +00:00
libunwind Revert r312240 2017-08-31 15:51:23 +00:00
lld COFF: simplify thunk handling (NFC) 2017-09-01 23:35:43 +00:00
lldb Add test case for attach-by-pid from different cwd 2017-09-03 01:44:35 +00:00
llgo irgen: Create functions instead of global variables for builtin hash and equal algorithms. 2017-06-04 22:11:28 +00:00
llvm [X86] Add RUN line for LIT test committed in "rL312438: [X86] Fix crash on assert of non-simple type after type-legalization.". 2017-09-03 10:44:18 +00:00
openmp Use va_copy instead of __va_copy to fix building libomp against musl libc 2017-08-19 23:53:36 +00:00
parallel-libs [Axccel] Remove -Wno-missing-braces in build 2016-12-19 21:34:07 +00:00
polly [ScopDetect/Info] Look through PHIs that follow an error block 2017-09-02 08:25:55 +00:00