[analyzer] Add new debug helper clang_analyzer_warnIfReached.
This will emit a warning if a call to clang_analyzer_warnIfReached is executed, printing REACHABLE. This is a more explicit way to declare expected reachability than using clang_analyzer_eval or triggering a bug (divide-by-zero or null dereference), and unlike the former will work the same in inlined functions and top-level functions. Like the other debug helpers, it is part of the debug.ExprInspection checker. Patch by Jared Grubb! git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@191909 91177308-0d34-0410-b5e6-96231b3b80d8
Showing
- docs/analyzer/DebugChecks.rst 13 additions, 0 deletionsdocs/analyzer/DebugChecks.rst
- lib/StaticAnalyzer/Checkers/ExprInspectionChecker.cpp 13 additions, 0 deletionslib/StaticAnalyzer/Checkers/ExprInspectionChecker.cpp
- test/Analysis/func.c 3 additions, 2 deletionstest/Analysis/func.c
- test/Analysis/misc-ps-region-store.cpp 25 additions, 40 deletionstest/Analysis/misc-ps-region-store.cpp
Loading
Please register or sign in to comment