summaryrefslogtreecommitdiffstats
path: root/clang/lib/Checker
Commit message (Collapse)AuthorAgeFilesLines
...
* Rewrite code fragment to avoide ICE in MSVC. Fixes PR 7875. Patch by ↵Ted Kremenek2010-08-171-2/+4
| | | | | | Dimitry Andric! llvm-svn: 111327
* StringRef'ication of lots stuff, patch by Peter Davies!Daniel Dunbar2010-08-171-1/+1
| | | | llvm-svn: 111314
* Remove dead code.Ted Kremenek2010-08-171-110/+0
| | | | llvm-svn: 111304
* Convert all uses of StringLiteral::getStrData() to StringLiteral::getString()Benjamin Kramer2010-08-171-1/+1
| | | | | | and remove getStrData(). Patch by Peter Davies (with some tweaks). llvm-svn: 111229
* Generate a node instead of a sink. A leak is not a fatal error.Zhongxing Xu2010-08-171-1/+1
| | | | llvm-svn: 111217
* Allow the "size" of a buffer access check to be either signed or unsigned. ↵Jordy Rose2010-08-161-1/+1
| | | | | | Fixes PR7925. llvm-svn: 111205
* Added basic psuedoconstant checking in IdempotentOperationChecker and fixed ↵Tom Care2010-08-161-2/+16
| | | | | | some test cases. llvm-svn: 111190
* Instead of using operator bool() for testing if a BindingKey is valid, use ↵Jordy Rose2010-08-161-4/+4
| | | | | | an explicit isValid() method. llvm-svn: 111181
* Move GRState::AssumeInBound out of its header file -- it's not really ↵Jordy Rose2010-08-161-0/+44
| | | | | | inline-friendly anymore. llvm-svn: 111179
* Model the effects of strcpy() and stpcpy() in CStringChecker. Other changes:Jordy Rose2010-08-161-16/+201
| | | | | | | | - Fix memcpy() and friends to actually invalidate the destination buffer. - Emit a different message for out-of-bounds buffer accesses if the buffer is being written to. - When conjuring symbols, let ValueManager figure out the type. llvm-svn: 111120
* - Allow making ElementRegions with complex offsets (expressions or symbols) ↵Jordy Rose2010-08-165-40/+33
| | | | | | | | | | for the purpose of bounds-checking. - Rewrite GRState::AssumeInBound to actually do that checking, and to use the normal constraint path. - Remove ConstraintManager::AssumeInBound. - Teach RegionStore and FlatStore to ignore those regions for now. llvm-svn: 111116
* Move GRState's bind* methods out of its header file -- they're too big for ↵Jordy Rose2010-08-151-0/+73
| | | | | | inlining now. llvm-svn: 111113
* StoreManager::RemoveDeadBindings() can take a Store instead of an entire ↵Zhongxing Xu2010-08-154-22/+16
| | | | | | GRState now. llvm-svn: 111103
* Remove redundant method.Zhongxing Xu2010-08-152-24/+13
| | | | llvm-svn: 111099
* Implement MallocChecker::EvalDeadSymbols() with the new API. This time weZhongxing Xu2010-08-151-15/+16
| | | | | | iterate over symbols being tracked, instead of symbols being dead. llvm-svn: 111097
* Remove dead code, caught by unused function warnings.Argyrios Kyrtzidis2010-08-152-4/+0
| | | | llvm-svn: 111091
* Update CStringChecker to take advantage of the new metadata symbols and ↵Jordy Rose2010-08-141-87/+245
| | | | | | region change callback. Now does basic tracking of string length for general regions. Currently this is still only used for modeling strlen(). llvm-svn: 111081
* Add a callback for when region changes occur. Still somewhat of a ↵Jordy Rose2010-08-144-17/+105
| | | | | | work-in-progress, but working! Effect on clients: all changes to a store now go through GRState. llvm-svn: 111078
* Another metadata symbol change (missed a file)Jordy Rose2010-08-141-0/+13
| | | | llvm-svn: 111077
* Add a new metadata symbol type for checkers to use. Metadata symbols must be ↵Jordy Rose2010-08-142-16/+92
| | | | | | associated with a region and will be collected if the region dies or its checker fails to mark it as in use. llvm-svn: 111076
* Zap unused UnaryOperator::OffsetOf.Eli Friedman2010-08-133-23/+1
| | | | llvm-svn: 110996
* Small changes to UnreachableCodeCheckerTom Care2010-08-121-3/+20
| | | | | | | - Added detection of Empty CFGBlocks (artificial blocks) - Relaxed an assertion based on an incorrect assumption until further investigation llvm-svn: 110974
* Improved IdempotentOperationChecker false positives and false negatives.Tom Care2010-08-121-98/+203
| | | | | | | | | - Unfinished analysis may still report valid warnings if the path was completely analyzed - New 'CanVary' heuristic to recursively determine if a subexpression has a varying element - Updated test cases, including one known bug - Exposed GRCoreEngine through GRExprEngine llvm-svn: 110970
* Remove OwnershipAttr::Kind, since it's essentially redundant with attr::Kind ↵Jordy Rose2010-08-121-19/+17
| | | | | | the way it's being used. Also fix isa<OwnershipAttr> support, break more-than-80-char lines, and other miscellaneous ownership attr cleanup. llvm-svn: 110908
* Actually use reduced set of checkers in EvalAssume.Jordy Rose2010-08-121-2/+1
| | | | llvm-svn: 110904
* MemRegion can refer to ASTContext without external help.Zhongxing Xu2010-08-1117-60/+48
| | | | llvm-svn: 110784
* Have GRCoreEngine record the blocks where analysis was aborted because we ↵Ted Kremenek2010-08-111-3/+4
| | | | | | visited a block too many times along a given path. This is to support the unreachable code analysis. llvm-svn: 110755
* Allow EvalBinOpNN to handle expressions of the form $a+$b if $b can be ↵Jordy Rose2010-08-091-4/+19
| | | | | | reduced to a constant. llvm-svn: 110592
* Allow reference binding of a reference of Objective-C object type toDouglas Gregor2010-08-071-1/+2
| | | | | | | | an lvalue of another, compatible Objective-C object type (e.g., a subclass). Introduce a new initialization sequence step kind to describe this binding, along with a new cast kind. Fixes PR7741. llvm-svn: 110513
* Removed IdempotentOperationChecker from default analysis and returned back ↵Tom Care2010-08-065-3/+9
| | | | | | | | | to a flag (-analyzer-check-idempotent-operations) - Added IdempotentOperationChecker to experimental analyses for testing purposes - Updated test cases to explictly call the checker llvm-svn: 110482
* Fix 80 col. violations.Ted Kremenek2010-08-061-6/+14
| | | | llvm-svn: 110473
* Nest variable declaration into into 'if' condition, thus restricting the ↵Ted Kremenek2010-08-061-7/+3
| | | | | | scope of the variable and condensing the code. llvm-svn: 110472
* Use 'GenerateNode()' instead of 'GenerateSink()' when reporting a leak. A ↵Ted Kremenek2010-08-061-3/+3
| | | | | | leak is not a hard enough bug to stop analyzing a path. llvm-svn: 110471
* If all nodes are sunk, bail out early. This make the later check for ↵Zhongxing Xu2010-08-061-1/+4
| | | | | | checkersEvaluated really meaningful. llvm-svn: 110430
* Don't assert on a file stream if its state is not tracked. Fix pr7831.Zhongxing Xu2010-08-051-1/+4
| | | | llvm-svn: 110392
* When checking if a buffer access is valid, first make sure the buffer has a ↵Jordy Rose2010-08-051-11/+15
| | | | | | valid Loc. Fixes PR7830. llvm-svn: 110390
* Fixed logic error in UnreachableCodeChecker's marking algorithm that would ↵Tom Care2010-08-051-3/+6
| | | | | | sometimes allow for multiple sequential statements to be flagged. llvm-svn: 110353
* Revert r110317, and add a comment why the assertion is not an invariant.Ted Kremenek2010-08-051-4/+4
| | | | llvm-svn: 110330
* Make checker recognize OffsetOfExpr as a form of __builtin_offsetof.Eli Friedman2010-08-051-1/+4
| | | | llvm-svn: 110320
* Turn the predicate into an assertion. When could the unequal case happen?Zhongxing Xu2010-08-051-1/+3
| | | | llvm-svn: 110317
* Tweak GRState::unbindLoc to use makeWithStore, and make sure it's only ↵Jordy Rose2010-08-051-3/+3
| | | | | | called for non-region locations. llvm-svn: 110310
* Remove InvalidateRegion from stores, since it's no longer called from outside.Jordy Rose2010-08-052-18/+2
| | | | llvm-svn: 110309
* Correctly handle 'Class<...>' when examining Cocoa conventions in the static ↵Ted Kremenek2010-08-051-2/+3
| | | | | | analyzer. Fixes a crash reported in <rdar://problem/8272168>. Patch by Henry Mason! llvm-svn: 110289
* Change the checker callback cache in GRExprEngine to be more compact (and ↵Jordy Rose2010-08-042-27/+68
| | | | | | | | IMHO a little easier to understand), and add the same sort of caching for EvalAssume (tied for least-used callback), mostly as proof-of-concept. Before we go further with these, we should figure out a way to reuse the visit-and-cache code in CheckerVisit. llvm-svn: 110191
* Improved false positive detection and numerous small issues in ↵Tom Care2010-08-031-77/+60
| | | | | | | | | | | | | 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
* Makes GRState::makeWithStore private, to encourage clients to make store ↵Jordy Rose2010-08-035-20/+17
| | | | | | | | changes through GRState instead of directly accessing the StoreManager. Also adds cover methods for InvalidateRegion(s) and EnterStackFrame to GRState. This is in preparation for proposed region change notifications. No functionality change. llvm-svn: 110137
* Allow offsets to be negative. Out-of-bound cases are checked elsewhere. We Zhongxing Xu2010-08-032-6/+5
| | | | | | shouldn't put restrictions in store manager. llvm-svn: 110106
* Pull the region offset computation logic into a single method.Zhongxing Xu2010-08-032-43/+60
| | | | llvm-svn: 110102
* Changed GRExprEngine to pass down a reference to itself when checkers are ↵Tom Care2010-08-033-9/+9
| | | | | | | | | 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
* Add -cc1 option '-unoptimized-cfg' to toggle using a CFG (for static ↵Ted Kremenek2010-08-032-2/+4
| | | | | | analysis) that doesn't prune CFG edges. llvm-svn: 110087
OpenPOWER on IntegriCloud