Commit Graph

7 Commits

Author SHA1 Message Date
Tom Care af9bbad718 Small changes to UnreachableCodeChecker
- Added detection of Empty CFGBlocks (artificial blocks)
- Relaxed an assertion based on an incorrect assumption until further investigation

llvm-svn: 110974
2010-08-12 23:01:06 +00:00
Tom Care 16ba7c652e Fixed logic error in UnreachableCodeChecker's marking algorithm that would sometimes allow for multiple sequential statements to be flagged.
llvm-svn: 110353
2010-08-05 17:53:44 +00:00
Tom Care be633d91d0 Improved false positive detection and numerous small issues in UnreachableCodeChecker
- Reporting now uses getUnreachableStmt which returns the Stmt* we should report
- Indexing of reachable and visited blocks now use CFGBlock ID's instead of pointers
- The CFG used in the unreachable search is now the unoptimized CFG
- Added 'Dead code' category to warnings
- Removed obsolete function getCondition
- Simplified false positive detection based on properties of FindUnreachableEntryPoints

llvm-svn: 110148
2010-08-03 21:24:13 +00:00
Tom Care 44081fbc6c Changed GRExprEngine to pass down a reference to itself when checkers are doing postanalysis. This allows the checker to gather information about the state of the engine when it has finished.
- Exposed the worklist and BlockAborted flag in GRCoreEngine
- Changed postanalysis checkers to use the new infrastructure

llvm-svn: 110095
2010-08-03 01:55:07 +00:00
Tom Care 29a6250bf0 Added some false positive checking to UnreachableCodeChecker
- Allowed reporting of dead macros
- Added path walking function to search for false positives in conditional statements
- Updated some affected tests
- Added some false positive test cases

llvm-svn: 109561
2010-07-27 23:30:21 +00:00
Jordy Rose 55442abee6 Don't warn about unreachable code if the block starts with __builtin_unreachable().
The next step is to warn if a block labeled unreachable is, in fact, reachable. Somewhat related to PR810.

llvm-svn: 109487
2010-07-27 03:39:53 +00:00
Tom Care cba9f517ac Added an path-sensitive unreachable code checker to the experimental analyzer checks.
- Created a new class to do post-analysis
- Updated several test cases with unreachable code to expect a warning
- Added some general tests

llvm-svn: 109286
2010-07-23 23:04:53 +00:00