summaryrefslogtreecommitdiffstats
path: root/clang/lib/Checker
Commit message (Collapse)AuthorAgeFilesLines
...
* Simplified reachability checking in IdempotentOperationChecker and added a ↵Tom Care2010-09-091-72/+155
| | | | | | | | | | helper function for path display. - Created private class CFGReachabilityAnalysis, which provides cached reachability lookups in the CFG - Simplified PathWasCompletelyAnalyzed to use the new reachability class - Added getLastRelevantNodes function for future use with path displaying in BugReporter llvm-svn: 113465
* Static analyzer fix: <rdar://problem/5880430> Switch on enum should not ↵Ted Kremenek2010-09-091-3/+18
| | | | | | consider default case live if all enum values are covered llvm-svn: 113457
* Fix warnings caused by new CXXUuidofExprClass enumerator.Francois Pichet2010-09-081-0/+1
| | | | llvm-svn: 113444
* Fix null pointer dereference in StreamChecker::Fseek (reported in PR 8081) ↵Ted Kremenek2010-09-071-17/+12
| | | | | | and simplify surrounding checking logic. llvm-svn: 113282
* Re-enabled truncation/extension checking in IdempotentOperationChecker and ↵Tom Care2010-09-071-6/+5
| | | | | | added a test case. llvm-svn: 113269
* "I see dead code". IdempotentOperationChecker::isTruncationExtensionAssignmentChris Lattner2010-09-034-9/+9
| | | | | | | | | should probably be removed if it has no purpose, but I just #if'd it out in case it's usefulIdempotentOperationChecker::isTruncationExtensionAssignment should probably be removed if it has no purpose, but I just #if'd it out in case it's useful llvm-svn: 112949
* Support pointer arithmetic in SimpleSValuator involving direct constants.Ted Kremenek2010-09-031-1/+36
| | | | llvm-svn: 112932
* Remove bogus assertions.Ted Kremenek2010-09-031-10/+12
| | | | llvm-svn: 112931
* Add optional record of "location" SVals in the environment. When we ↵Ted Kremenek2010-09-032-5/+82
| | | | | | analyzing loads/stores, we lose the location SVal, which makes it difficult to recover in some cases (e.g., for post diagnostics). This is prep for pending changes to GRExprEngine. llvm-svn: 112930
* Add GRState::getSimplifiedSVal(), which provides an API hook for doing ↵Ted Kremenek2010-09-031-0/+36
| | | | | | | | symbol -> constant folding. This isn't used yet, but is prep for some pending optimizations in GRExprEngine. llvm-svn: 112929
* Reapply 112850 and 112839 with a constructor for the BinaryOperatorData ↵Tom Care2010-09-022-17/+97
| | | | | | struct. Clang would zero out the enum and pointer in the struct in some conditions, but GCC would never zero out the values. llvm-svn: 112909
* Eliminate CXXBindReferenceExpr, which was used in a ton ofDouglas Gregor2010-09-021-1/+0
| | | | | | well-intentioned but completely unused code. llvm-svn: 112868
* Reverting 112850 and 112839 due to test failures on some systemsTom Care2010-09-022-95/+17
| | | | llvm-svn: 112857
* Fixed broken build with GCCTom Care2010-09-021-12/+12
| | | | llvm-svn: 112850
* Improved error reporting in IdempotentOperationCheckerTom Care2010-09-022-17/+95
| | | | | | | | | - SourceRange highlighting is only given for the relevant side of the operator (assignments give both) - Added PostVisitBinaryOperator hook to retrieve the ExplodedNode for an operator - Added a BugReporterVisitor to display the last store to every VarDecl in a Stmt - Changed bug reporting to use the new BugReporterVisitor llvm-svn: 112839
* update comments.Zhongxing Xu2010-09-021-1/+3
| | | | llvm-svn: 112796
* For GRExprEngine::EvalBind() (and called visitors), unifiy StoreE and ↵Ted Kremenek2010-09-023-27/+28
| | | | | | AssignE. Now StoreE (const Stmt*) represents the expression where the store took place, which is the assignment expression if it takes place in an assignment. This removes some conceptual dissidence as well as removes an extra parameter from the Checker::PreVisitBind() visitor. It also improves ranges and source location information in analyzer diagnostics. llvm-svn: 112789
* Fixed unused variable warning.Ted Kremenek2010-09-021-1/+1
| | | | llvm-svn: 112784
* Partial fix for PR 8015 (fix is actually by Jordy Rose, and I added a test ↵Ted Kremenek2010-09-011-1/+6
| | | | | | case for follow-on work). This patch adds a bandaid for RegionStore's limited reasoning about symbolic array values. llvm-svn: 112766
* Don't assert in the analyzer when analyze code does a byte load from a ↵Ted Kremenek2010-09-012-9/+6
| | | | | | function's address. Fixes PR 8052. llvm-svn: 112761
* Don't assert in CastSizeChecker when the casted-to pointee is an incomplete ↵Ted Kremenek2010-09-011-0/+4
| | | | | | type. Fixes PR 8050. llvm-svn: 112738
* Add range of return value expression in ReturnUndefChecker. Patch by Jim ↵Ted Kremenek2010-08-311-0/+1
| | | | | | Goodnow II! llvm-svn: 112569
* Adjusted the semantics of assign checking in IdempotentOperationCheckerTom Care2010-08-301-26/+41
| | | | | | | | | | - Fixed a regression where assigning '0' would be reported - Changed the way self assignments are filtered to allow constant testing - Added a test case for assign ops - Fixed one test case where a function pointer was not considered constant - Fixed test cases relating to 0 assignment llvm-svn: 112501
* Revert my user-defined literal commits - r1124{58,60,67} pendingAlexis Hunt2010-08-301-1/+0
| | | | | | some issues being sorted out. llvm-svn: 112493
* Implement C++0x user-defined string literals.Alexis Hunt2010-08-291-0/+1
| | | | | | | | | | The extra data stored on user-defined literal Tokens is stored in extra allocated memory, which is managed by the PreprocessorLexer because there isn't a better place to put it that makes sure it gets deallocated, but only after it's used up. My testing has shown no significant slowdown as a result, but independent testing would be appreciated. llvm-svn: 112458
* Add comments.Zhongxing Xu2010-08-291-0/+7
| | | | llvm-svn: 112414
* Added checking of (x == x) and (x != x) to IdempotentOperationChecker and ↵Tom Care2010-08-271-0/+2
| | | | | | updated test cases flagged by it. llvm-svn: 112313
* Enabled relaxed LiveVariables analysis in the path-sensitive engine to ↵Tom Care2010-08-271-2/+4
| | | | | | | | | | | increase the coverage of bugs. Primarily affects IdempotentOperationChecker. - Migrated a temporarily separated test back to its original file (bug has been fixed, null-deref-ps-temp.c -> null-deref-ps.c) - Changed SymbolManager to use relaxed LiveVariables - Updated several test cases that the IdempotentOperationChecker class now flags - Added test case to test relaxed LiveVariables use by the IdempotentOperationChecker llvm-svn: 112312
* Remove an assertion in UnreachableCodeChecker that can be triggered by bugs ↵Tom Care2010-08-271-2/+5
| | | | | | in other checkers. llvm-svn: 112310
* Fix bug in IdempotentOperationChecker where an assumption would not get ↵Tom Care2010-08-271-0/+4
| | | | | | updated properly. llvm-svn: 112309
* Fix horrible GRExprEngine bug where switch statements with no 'case:' ↵Ted Kremenek2010-08-261-2/+4
| | | | | | statements would cause the path to get prematurely aborted. Fixes <rdar://problem/8360854>. llvm-svn: 112233
* Remove redundant cast<...>.Ted Kremenek2010-08-261-1/+1
| | | | llvm-svn: 112229
* De-memberify the VarDecl and FunctionDecl StorageClass enums.John McCall2010-08-261-2/+2
| | | | | | This lets us remove Sema.h's dependency on Expr.h and Decl.h. llvm-svn: 112156
* zap dead ctorChris Lattner2010-08-261-1/+0
| | | | llvm-svn: 112132
* GCC didn't care for my attempt at API compatibility, so brute-force everythingJohn McCall2010-08-2523-339/+338
| | | | | | to the new constants. llvm-svn: 112047
* Improvements to IdempotentOperationChecker and its use of PseudoConstantAnalysisTom Care2010-08-241-11/+29
| | | | | | | | | | | | - Added wasReferenced function to PseudoConstantAnalysis to determine if a variable was ever referenced in a function (outside of a self-assignment) - BlockDeclRefExpr referenced variables are now explicitly added to the non-constant list - Remove unnecessary ignore of implicit casts - Generalized parameter self-assign detection to detect deliberate self-assigns of variables to avoid unused variable warnings - Updated test cases with deliberate self-assignments - Fixed bug with C++ references and pseudoconstants - Added test case for C++ references and pseudoconstants llvm-svn: 111965
* Improve comments.Zhongxing Xu2010-08-241-1/+2
| | | | llvm-svn: 111897
* Several small changes to PseudoConstantAnalysis and the way ↵Tom Care2010-08-231-19/+45
| | | | | | | | | | | | IdempotentOperationChecker uses it. - Psuedo -> Pseudo (doh...) - C++ reference support - Added pseudoconstant test case for __block vars - Separated out static local checking from pseudoconstant analysis and generalized to non-local checking - Added missing test cases for storage false positives llvm-svn: 111832
* Adjust code placement.Zhongxing Xu2010-08-231-8/+8
| | | | llvm-svn: 111790
* Detabify.Eli Friedman2010-08-224-25/+25
| | | | llvm-svn: 111768
* Place method near its class.Zhongxing Xu2010-08-211-12/+13
| | | | llvm-svn: 111737
* Remove dead code.Zhongxing Xu2010-08-211-12/+0
| | | | llvm-svn: 111736
* Improve comments.Zhongxing Xu2010-08-211-6/+1
| | | | llvm-svn: 111735
* Remove a special case for OSAtomic functions. We can already bind and retrieveZhongxing Xu2010-08-212-7/+4
| | | | | | | | with the same binding key. The only trick here is that sometimes the Symbolic region is stored in with an LocAsInteger wrapper. We unwrap that in SVal::getAsLocSymbol(). llvm-svn: 111734
* Remove dead code. We no longer need it because now we treat the first elementZhongxing Xu2010-08-211-34/+0
| | | | | | region and its base region as the same binding key. llvm-svn: 111732
* remove unused variable.Zhongxing Xu2010-08-211-1/+1
| | | | llvm-svn: 111731
* When invalidating a struct region, whether its type definition exists is notZhongxing Xu2010-08-211-9/+2
| | | | | | | relavant any more, because we set its default value to a symbol, and the type of default symbolic value is irrelavant. llvm-svn: 111730
* Remove dead code.Ted Kremenek2010-08-201-23/+2
| | | | llvm-svn: 111616
* Handle nested compound values in BindArray for multidimensional arrays. ↵Jordy Rose2010-08-201-0/+2
| | | | | | Fixes PR7945. llvm-svn: 111602
* Remove dead code. Patch by Jon Mulder!Jordy Rose2010-08-191-5/+0
| | | | llvm-svn: 111541
OpenPOWER on IntegriCloud