summaryrefslogtreecommitdiffstats
path: root/clang/lib/StaticAnalyzer/Checkers
Commit message (Collapse)AuthorAgeFilesLines
* Allow 'Environment::getSVal()' to allow an optional way for checkers to do a ↵Ted Kremenek2011-04-271-1/+6
| | | | | | | | direct lookup to values bound to expressions, without resulting to lazy logic. This is critical for the OSAtomicChecker that does a simulated load on any arbitrary expression. llvm-svn: 130292
* Implements the strncmp() checker just like the strcmp() checker, but with ↵Lenny Maiorani2011-04-251-2/+32
| | | | | | bounds. Requires LLVM svn r129582. llvm-svn: 130161
* Remove unused STL header includes.Jay Foad2011-04-231-1/+0
| | | | llvm-svn: 130068
* Make the VariadicMethodTypeChecker accept block pointers as Objective-C ↵Anders Carlsson2011-04-191-0/+4
| | | | | | pointers. Fixes PR9746. llvm-svn: 129741
* Support for C++11 (non-template) alias declarations.Richard Smith2011-04-152-2/+2
| | | | llvm-svn: 129567
* fix a bunch of comment typos found by codespell. Patch byChris Lattner2011-04-152-2/+2
| | | | | | Luis Felipe Strano Moraes! llvm-svn: 129559
* Teach VariadicMethodTypeChecker to not crash when processing methods ↵Ted Kremenek2011-04-121-1/+2
| | | | | | declared in protocols. llvm-svn: 129395
* Fix another IdempotentOperationsChecker corner case when determining if an ↵Ted Kremenek2011-04-121-1/+1
| | | | | | | | active block on the worklist impacts the results of the check. llvm-svn: 129394
* ArrayBoundCheckerV2: don't arbitrarily warn about indexing before the ↵Ted Kremenek2011-04-121-19/+42
| | | | | | 0-index of a symbolic region. In many cases that isn't really the base offset. llvm-svn: 129366
* This patch adds modeling of strcmp() to the CString checker. Validates ↵Lenny Maiorani2011-04-121-0/+83
| | | | | | inputs are not NULL and are real C strings, then does the comparison and binds the proper return value. Unit tests included. llvm-svn: 129364
* strcat() and strncat() model additions to CStringChecker.Lenny Maiorani2011-04-091-9/+64
| | | | | | Validates inputs are not NULL, checks for overlapping strings, concatenates the strings checking for buffer overflow, sets the length of the destination string to the sum of the s1 length and the s2 length, binds the return value to the s1 value. llvm-svn: 129215
* Add security syntax checker for strcat() which causes the Static Analyzer to ↵Lenny Maiorani2011-04-051-57/+91
| | | | | | | | generate a warning any time the strcat() function is used with a note suggesting to use a function which provides bounded buffers. CWE-119. Also, brings the security syntax checker more inline with coding standards. llvm-svn: 128916
* Refactoring the security checker a little bit so that each CallExpr check ↵Lenny Maiorani2011-04-031-60/+44
| | | | | | doesn't get called for each CallExpr. Instead it does a switch and only runs the check for the proper identifier. Slight speed improvement (probably significant on very large ASTs), and should make it easier and more clear to add more checks for other CallExpr's later. llvm-svn: 128785
* Remove a redundant method. We have a const version.Zhongxing Xu2011-04-021-0/+1
| | | | llvm-svn: 128762
* Teach IdempotentOperationsChecker about paths aborted because ExprEngine ↵Ted Kremenek2011-04-022-8/+17
| | | | | | didn't know how to handle a specific Expr type. llvm-svn: 128761
* static analyzer: Rename 'BlocksAborted' to 'BlocksExhausted' to reflect that ↵Ted Kremenek2011-04-022-2/+2
| | | | | | a given CFGBlock was analyzed too many times. llvm-svn: 128760
* Add security syntax checker for strcpy() which causes the Static Analyzer to ↵Lenny Maiorani2011-03-311-0/+54
| | | | | | generate a warning any time the strcpy() function is used with a note suggesting to use a function which provides bounded buffers. llvm-svn: 128679
* Adding Static Analyzer checker for mempcpy().Lenny Maiorani2011-03-311-9/+73
| | | | | | Models mempcpy() so that if length is NULL the destination pointer is returned. Otherwise, the source and destination are confirmed not to be NULL and not overlapping. Finally the copy is validated to not cause a buffer overrun and the return value is bound to the address of the byte after the last byte copied. llvm-svn: 128677
* Fix spelling in a comment. (test commit)Lenny Maiorani2011-03-311-1/+1
| | | | llvm-svn: 128670
* [analyzer] Allow all checkers of a group to be enabled.Argyrios Kyrtzidis2011-03-291-2/+3
| | | | llvm-svn: 128512
* [analyzer] For -analyzer-checker-help show all the info about groups, ↵Argyrios Kyrtzidis2011-03-292-5/+110
| | | | | | packages, and which packages/checkers are hidden. llvm-svn: 128511
* [analyzer] Checker Packages can now belong to a group. This requires llvm ↵Argyrios Kyrtzidis2011-03-291-30/+18
| | | | | | commit r128474. llvm-svn: 128475
* Tweak grammar in checker description.Ted Kremenek2011-03-261-1/+1
| | | | llvm-svn: 128310
* Rework checker "packages" and groups to be more hierarchical.Ted Kremenek2011-03-241-191/+263
| | | | llvm-svn: 128187
* Rename class 'CFGReachabilityAnalysis' to 'CFGReverseBlockReachabilityAnalysis'.Ted Kremenek2011-03-191-3/+3
| | | | | | | | | This rename serves two purposes: - It reflects the actual functionality of this analysis. - We will have more than one reachability analysis. llvm-svn: 127930
* Teach VariadicMethodTypeChecker about pointers attributed as 'NSObject'.Ted Kremenek2011-03-171-0/+4
| | | | llvm-svn: 127798
* Teach VariadicMethodTypeChecker that CF references are valid arguments to ↵Ted Kremenek2011-03-171-0/+5
| | | | | | variadic Objective-C methods. llvm-svn: 127797
* VariadicMethodTypeChecker: don't warn for null pointer constants passed to ↵Ted Kremenek2011-03-161-0/+5
| | | | | | variadic Objective-C methods. llvm-svn: 127719
* Remove bogus assertion in IdempotentOperationsChecker.Ted Kremenek2011-03-151-3/+2
| | | | llvm-svn: 127687
* Tweak VariadicMethodTypeChecker to only create one ExplodedNode when issuing ↵Ted Kremenek2011-03-141-7/+11
| | | | | | | | multiple warnings for the same message expression. Also add a test case showing that we correctly report multiple warnings for the same message expression. llvm-svn: 127605
* Add an Objective-C checker that checks that arguments passed to some ↵Anders Carlsson2011-03-132-0/+146
| | | | | | | | variadic Objective-C methods are of Objective-C pointer types. Ted or Argiris, I'd appreciate a review! llvm-svn: 127572
* Re-enable the IdempotentOperations checker for --analyze, and put it and the ↵Ted Kremenek2011-03-121-5/+9
| | | | | | DeadStores checker into the "deadcode" group. llvm-svn: 127531
* Don't have side-effects (or rather non-trivial computation) in StringSwitch ↵Ted Kremenek2011-03-121-6/+9
| | | | | | "cases." llvm-svn: 127528
* Add initial version of "IteratorsChecker", a checker to find misues uses of ↵Ted Kremenek2011-03-123-0/+585
| | | | | | | | | C++ iterators. This checker was created by Jim Goodnow II, and I migrated it to the new Checker interface (recent changes by Argiris). llvm-svn: 127525
* Add support for the OpenCL vec_step operator, by generalising andPeter Collingbourne2011-03-113-7/+8
| | | | | | | extending the existing support for sizeof and alignof. Original patch by Guy Benyei. llvm-svn: 127475
* Make the Objective-C checker look for subclasses of NSString instead of just ↵Anders Carlsson2011-03-081-13/+14
| | | | | | NSString and NSMutableString. llvm-svn: 127268
* Move some of the logic about classifying Objective-C methods intoJohn McCall2011-03-021-7/+2
| | | | | | | | conventional categories into Basic and AST. Update the self-init checker to use this logic; CFRefCountChecker is complicated enough that I didn't want to touch it. llvm-svn: 126817
* In preparation for fixing PR 6884, rework CFGElement to have getAs<> return ↵Ted Kremenek2011-03-011-4/+4
| | | | | | | | | pointers instead of fresh CFGElements. - Also, consoldiate getDtorKind() and getKind() into one "kind". - Add empty getDestructorDecl() method to CFGImplicitDtor. llvm-svn: 126738
* [analyzer] Also make sure that the parameter is coming from the current ↵Argyrios Kyrtzidis2011-03-011-4/+8
| | | | | | stack frame. llvm-svn: 126735
* [analyzer] Remove SVal::getAsVarDecl() and reason about MemRegions, not ↵Argyrios Kyrtzidis2011-03-011-17/+28
| | | | | | Decls. Suggestion by Ted! llvm-svn: 126734
* [analyzer] Move lib/StaticAnalyzer/Checkers/ExprEngine.cpp -> ↵Argyrios Kyrtzidis2011-03-012-3233/+0
| | | | | | | | lib/StaticAnalyzer/Core and hope the wrath of the buildbots will not descend upon me. llvm-svn: 126728
* [analyzer] Rename CheckerV2 -> Checker.Argyrios Kyrtzidis2011-03-0147-101/+101
| | | | llvm-svn: 126726
* [analyzer] Remove Checker V1.Argyrios Kyrtzidis2011-03-011-1/+0
| | | | llvm-svn: 126725
* [analyzer] Remove checker V1 registration and running from ExprEngine.Argyrios Kyrtzidis2011-03-011-510/+70
| | | | llvm-svn: 126724
* [analyzer] Remove unused checker stuff from AnalysisConsumer and some unused ↵Argyrios Kyrtzidis2011-02-286-74/+0
| | | | | | headers. llvm-svn: 126690
* [analyzer] Migrate NSErrorChecker and DereferenceChecker to CheckerV2.Argyrios Kyrtzidis2011-02-284-206/+263
| | | | | | | | They cooperate in that NSErrorChecker listens for ImplicitNullDerefEvent events that DereferenceChecker can dispatch. ImplicitNullDerefEvent is when we dereferenced a location that may be null. llvm-svn: 126659
* Fix CMake build.Anders Carlsson2011-02-281-1/+0
| | | | llvm-svn: 126629
* [analzyer] Migrate CallAndMessageChecker to CheckerV2.Argyrios Kyrtzidis2011-02-284-62/+65
| | | | llvm-svn: 126626
* [analyzer] ExprEngine should not depend on checkers for not crashing.Argyrios Kyrtzidis2011-02-281-26/+27
| | | | llvm-svn: 126625
* [analyzer] Migrate AdjustedReturnValueChecker to CheckerV2.Argyrios Kyrtzidis2011-02-284-19/+16
| | | | llvm-svn: 126624
OpenPOWER on IntegriCloud