mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 03:27:44 -04:00
Add Cyclomatic complexity GCC plugin
Add a very simple plugin to demonstrate the GCC plugin infrastructure. This GCC plugin computes the cyclomatic complexity of each function. The complexity M of a function's control flow graph is defined as: M = E - N + 2P where E = the number of edges N = the number of nodes P = the number of connected components (exit nodes). Signed-off-by: Emese Revfy <[email protected]> Acked-by: Kees Cook <[email protected]> Signed-off-by: Michal Marek <[email protected]>
This commit is contained in:
parent
6b90bd4ba4
commit
0dae776c6b
4 changed files with 87 additions and 0 deletions
12
arch/Kconfig
12
arch/Kconfig
|
|
@ -372,6 +372,18 @@ menuconfig GCC_PLUGINS
|
|||
|
||||
See Documentation/gcc-plugins.txt for details.
|
||||
|
||||
config GCC_PLUGIN_CYC_COMPLEXITY
|
||||
bool "Compute the cyclomatic complexity of a function"
|
||||
depends on GCC_PLUGINS
|
||||
help
|
||||
The complexity M of a function's control flow graph is defined as:
|
||||
M = E - N + 2P
|
||||
where
|
||||
|
||||
E = the number of edges
|
||||
N = the number of nodes
|
||||
P = the number of connected components (exit nodes).
|
||||
|
||||
config HAVE_CC_STACKPROTECTOR
|
||||
bool
|
||||
help
|
||||
|
|
|
|||
Loading…
Reference in a new issue