]> granicus.if.org Git - clang/commit
[analyzer][IDF] Add a control dependency calculator + a new debug checker
authorKristof Umann <dkszelethus@gmail.com>
Fri, 5 Jul 2019 12:17:44 +0000 (12:17 +0000)
committerKristof Umann <dkszelethus@gmail.com>
Fri, 5 Jul 2019 12:17:44 +0000 (12:17 +0000)
commitf204f0a947c80a1a99dd90b14570301041baf46e
tree0238a88c02dcdcb5b25e154b4a3644a536795678
parent85b66e10c86dff93111217e6d61dc2d2f14df6d6
[analyzer][IDF] Add a control dependency calculator + a new debug checker

I intend to improve the analyzer's bug reports by tracking condition
expressions.

01 bool b = messyComputation();
02 int i = 0;
03 if (b) // control dependency of the bug site, let's explain why we assume val
04        // to be true
05   10 / i; // warn: division by zero

I'll detail this heuristic in the followup patch, strictly related to this one
however:

* Create the new ControlDependencyCalculator class that uses llvm::IDFCalculator
  to (lazily) calculate control dependencies for Clang's CFG.
* A new debug checker debug.DumpControlDependencies is added for lit tests
* Add unittests

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@365197 91177308-0d34-0410-b5e6-96231b3b80d8
include/clang/Analysis/Analyses/Dominators.h
include/clang/Analysis/CFG.h
include/clang/StaticAnalyzer/Checkers/Checkers.td
lib/StaticAnalyzer/Checkers/DebugCheckers.cpp
test/Analysis/domtest.c
test/Analysis/domtest.cpp
unittests/Analysis/CFGDominatorTree.cpp