As we began collecting more data, we expected the times would grow: We measured the performance of each DFA step separately:īuilding relations step – this is the C++ implementation of the engine that collects all the relations for the DFA calculation. For the test, we took 5 projects: Postgres, Eigen, clangd, OpenCV, and OSRM.
#Clion eap mac
Here are the measurements we got from our MAC machine (Big Sur 11.0, 2.6 GHz 6-Core Intel Core i7, 16 GB RAM). We compared the previous and current DFA implementations, running both in global and local mode. And since we were optimizing many steps in DFA, we were expecting some improvements.
#Clion eap code
When implementing such a big change, we were obviously interested in how it would affect the performance of code analysis. Global DFA is manually turned off via the Registry key (which we do not recommend unless a critical regression is found). There is an error in any of the functions in the TU reported by the clangd engine. Global DFA is enabled by default, but it can fall back to Local DFA if: Unreachable calls of function – detects functions whose call sites are never executed: In addition to those, we are working on a few new inspections only available in Global DFA:Ĭonstant function result – reports functions whose return value appears to always be the same constant.Ĭonstant parameter – reports functions where a parameter appears to always be the same constant: Unused values – detects variable values that are never used after being assigned.Įscape analysis – detects variables containing references to local variables that escape their scope. Infinite recursion – reports functions that either run forever or terminate by an exception. Null dereference – detects dereferencing pointers that may contain nullptr.ĭangling pointers – detects pointers that may point to already deleted memory.Įndless loops – reports any for, while, and do statements or goto loops that can exit only by throwing an exception. Unreachable code – detects code that is never executed. Here’s a list of CLion’s current DFA-based inspections that benefit from Global DFA:Ĭonstant conditions – detects possible conditions that are always true or false. For example, dangling pointer analysis is enriched with Global DFA and can capture cases when memory is deleted in another function: This helps detect potential issues which can’t be captured by Local DFA. This means global DFA works within the TU on all usages of the functions/fields that are guaranteed to be located in the TU. Global DFA is an interprocedural analysis that takes the translation unit (TU) of a program as a single unit for analysis. And in CLion 2021.1, we’re ready to give you Global Data Flow Analysis! In 2020 we partially moved it to the clangd-based engine, increased the accuracy of many checks, and added new checks, like search for dangling pointers. One area we continue to improve on is Data Flow Analysis.
#Clion eap license
And today we’re inviting you to join the 2021.1 Early Access Program!Īs usual, the EAP builds are free to use and no license is required. We’re launching the CLion 2021.1 Early Access Program!Īt the end of 2020 we shared our areas of focus for 2021 and our plans for the 2021.1 release.