summaryrefslogtreecommitdiffstats
path: root/clang/lib/Checker
Commit message (Collapse)AuthorAgeFilesLines
...
* Add check for UnknownVals for mutexes in ObjCAtSyncChecker. Fixes crash ↵Ted Kremenek2010-10-251-0/+3
| | | | | | reported in PR 8458. llvm-svn: 117300
* Fix '-analyzer-display-progress' for Objective-C methods. Also remove ↵Ted Kremenek2010-10-221-13/+5
| | | | | | obsolete code. llvm-svn: 117161
* Move classes into anonymous namespaces.Benjamin Kramer2010-10-221-9/+10
| | | | llvm-svn: 117104
* Tweak the ObjCAtSyncChecker to assume that a mutex is non-nil after checking ↵Ted Kremenek2010-10-211-3/+5
| | | | | | | | | that it is nil. Otherwise we can get false paths where a second @synchronized using the mutex can have a bogus warning. Fixes <rdar://problem/8578650>. llvm-svn: 117016
* Remove unused variable.Ted Kremenek2010-10-211-1/+0
| | | | llvm-svn: 116995
* Remove obsolete GRAuditor and GRSimpleAPICheck, which have been completely ↵Ted Kremenek2010-10-202-91/+2
| | | | | | subsumed by the Checker interface. llvm-svn: 116973
* Convert GRSimpleAPIChecks in BasicObjCFoundationChecks to be Checkers.Ted Kremenek2010-10-203-263/+185
| | | | llvm-svn: 116971
* Tweak retain/release checker diagnostics to specify a leak occurs because an ↵Ted Kremenek2010-10-151-2/+2
| | | | | | | | object is not referenced later in the path, not that it isn't referenced later in the code. Fixes <rdar://problem/8527839>. llvm-svn: 116636
* Eliminate usage of ObjCSuperExpr used forFariborz Jahanian2010-10-141-1/+0
| | | | | | | 'super' as receiver of property or a setter/getter methods. //rdar: //8525788 llvm-svn: 116483
* Call PreVisitDeclStmt for C++ aggregate initializers. Patch by Jim Goodnow II.Zhongxing Xu2010-10-141-1/+8
| | | | llvm-svn: 116473
* comment out unused functionChris Lattner2010-10-111-1/+1
| | | | llvm-svn: 116189
* Unbreak the CMake build.Francois Pichet2010-10-101-0/+1
| | | | llvm-svn: 116164
* Add experimental chroot check which checks improper use of chroot(). Patch by Zhongxing Xu2010-10-103-0/+163
| | | | | | Lei Zhang. llvm-svn: 116163
* UnreachableCodeChecker cleanup and improvementsTom Care2010-10-061-17/+9
| | | | | | | | | | - Fixed some iterator style issues - Don't process blocks that have been visited already - Fixed a case where a unreachable block cycle was not reported - Minor test case changes - Added one test case from flow-sensitive version of the check. More coming. llvm-svn: 115861
* UnreachableCodeChecker does not need to inherit from CheckerVisitor, only ↵Tom Care2010-10-011-1/+1
| | | | | | Checker. It does not use any AST Stmt hooks, only VisitEndAnalysis. llvm-svn: 115345
* Added two new command line arguments:Marcin Swiderski2010-09-302-2/+5
| | | | | | | -cfg-add-implicit-dtors - sets CFG::BuildOptions::AddImplicitDtors for AnalysisCosumer to true, -cfg-add-initializers - sets CFG::BuildOptions::AddInitializers for AnalysisCosumer to true. llvm-svn: 115142
* Include changes to VisitCXXMemberCallExpr (call visitor functions).Ted Kremenek2010-09-301-6/+19
| | | | llvm-svn: 115120
* Tweak nil receiver checker to not warning about 64-bit return values.Ted Kremenek2010-09-301-2/+5
| | | | | Fixes: <rdar://problem/7513117> llvm-svn: 115113
* AnalyzerStatsChecker improvements:Tom Care2010-09-291-2/+15
| | | | | | | - Use BlockEntrance rather than BlockEdge to bring in line with UnreachableCodeChecker. Fixes an issue where unreached blocks would still be counted as reachable. - Added warnings for all BlockAborted locations. This allows us to see where the analyzer stopped analyzing. llvm-svn: 115110
* Change -analyzer-max-nodes to allow 0 as a parameter. This allows the ↵Tom Care2010-09-291-2/+10
| | | | | | analyzer to completely analyze a worklist regardless of time taken. llvm-svn: 115108
* Refactor GRExprEngine::VisitCall() to use EvalArguments(), just like ↵Ted Kremenek2010-09-232-37/+20
| | | | | | VisitCXXMemberCallExpr(). Ideally we should unify these code paths as much as possible, since they only differ by a few details. llvm-svn: 114628
* Fix an inverse boolean and unnecessary new line in warning output from ↵Tom Care2010-09-221-2/+2
| | | | | | AnalyzerStatsChecker. llvm-svn: 114581
* Revert r114244 since it breaks a test in Analysis.Tom Care2010-09-181-3/+0
| | | | llvm-svn: 114246
* IdempotentOperationChecker no longer reports errors that are post-dominated ↵Tom Care2010-09-181-0/+3
| | | | | | by a sink. This fixes some false positives that were flagged because a path was incomplete (usually in a loop). llvm-svn: 114244
* Refactored BugReporter to refer to EndNode as ErrorNode. We currently make ↵Tom Care2010-09-163-10/+10
| | | | | | the assumption that EndNode == ErrorNode, but upcoming changes will break this. llvm-svn: 114065
* Introduce new CFGElement hierarchy to support C++ CFG, based on Marcin's patchZhongxing Xu2010-09-163-17/+21
| | | | | | and discussions with Ted and Jordy. llvm-svn: 114056
* Disallow the use of UnknownVal as the index for ElementRegions. UnknownVals ↵Ted Kremenek2010-09-154-13/+17
| | | | | | | | | | | | | | | | | can be used as the index when the value evaluation isn't powerful enough. By creating ElementRegions with UnknownVals as the index, this gives the false impression that they are the same element, when they really aren't. This becomes really problematic when deriving symbols from these regions (e.g., those representing the initial value of the index), since two different indices will get the same symbol for their binding. This fixes an issue with the idempotent operations checker that would cause two indices that are clearly not the same to make it appear as if they always had the same value. Fixes <rdar://problem/8431728>. llvm-svn: 113920
* Adjust assertion in RegionStoreManager::RetrieveArray() to also take into ↵Ted Kremenek2010-09-141-1/+1
| | | | | | account typedefs. llvm-svn: 113893
* Don't divide-by-zero in RegionStoreManager::getSizeInElements() when getting ↵Ted Kremenek2010-09-141-0/+8
| | | | | | | | the size of a VLA. We don't track VLA extents yet, but we should at least not crash. Fixes <rdar://problem/8424269>. llvm-svn: 113888
* Rename 'MaxLoop' to 'MaxVisit' in AnalysisManager to more correctly reflect ↵Tom Care2010-09-142-2/+2
| | | | | | that we aborted analysis may not necessarily be due to a loop. llvm-svn: 113862
* Revert "CMake: Update to use standard CMake dependency tracking facilities ↵Michael J. Spencer2010-09-131-14/+4
| | | | | | | | | | | | | instead" This reverts commit r113631 Conflicts: CMakeLists.txt lib/CodeGen/CMakeLists.txt llvm-svn: 113817
* CMake: Update to use standard CMake dependency tracking facilities insteadMichael J. Spencer2010-09-101-4/+14
| | | | | | of whatever we were using before... llvm-svn: 113631
* Serialization support for CXXNoexceptExpr.Sebastian Redl2010-09-101-0/+1
| | | | llvm-svn: 113627
* Polish diagnostics for null dereferences via ObjC ivar accesses. Finishes ↵Ted Kremenek2010-09-101-0/+13
| | | | | | up <rdar://problem/6352035>. llvm-svn: 113612
* Add checker implementation for my previous commit!Ted Kremenek2010-09-101-0/+87
| | | | llvm-svn: 113574
* Implement: <rdar://problem/6351970> rule request: warn if @synchronized ↵Ted Kremenek2010-09-103-1/+4
| | | | | | mutex can be nil llvm-svn: 113573
* Add ObjCAtSynchronizedStmt to the CFG and add GRExprEngine support (PreVisit ↵Ted Kremenek2010-09-101-1/+21
| | | | | | for checkers). llvm-svn: 113572
* Added AnalyzerStatsChecker, a path sensitive check that reports visitation ↵Tom Care2010-09-104-0/+110
| | | | | | statistics about analysis. Running clang with the -analyzer-stats flag will emit warnings containing the information. We can then run a postanalysis script to take this data and give useful information about how much the analyzer missed in a project. llvm-svn: 113568
* Clean up obtuse wording of checker diagnostic of using an uninitialized ↵Ted Kremenek2010-09-091-6/+6
| | | | | | | value in a function call. Fixes: <rdar://problem/8409480> “warning: Pass-by-value argument in function call is undefined” message can be improved llvm-svn: 113554
* Use FindReportInEquivalenceClass to identify all the nodes used for the ↵Ted Kremenek2010-09-091-34/+54
| | | | | | | | | | trimmed graph (in BugReporter). This fixes a problem where a leak that happened to occur on both an exit() path and a non-exit() path was getting reported with the exit() path (which users don't care about). This fixes: <rdar://problem/8331641> leak reports should not show paths that end with exit() (but ones that don't end with exit()) llvm-svn: 113524
* Clean up CMake dependenciesDouglas Gregor2010-09-091-0/+2
| | | | llvm-svn: 113489
* Remove unused variable.Benjamin Kramer2010-09-091-1/+0
| | | | llvm-svn: 113482
* do not bind temporaries to non-const referencesGabor Greif2010-09-093-3/+3
| | | | | | | | | | | this fixes all analyser test failures in my gcc34-based environment how the cast result could bind to the non-const ref is somewhat mysterious and remains to be investigated; to avoid similar miscompilations (by gcc34 only?) llvm-svn: 113480
* Rename GRState::getSVal() -> getRawSVal() and getSimplifiedSVal() -> getSVal().Ted Kremenek2010-09-093-16/+14
| | | | | | | | | | | | | | | | | The end result is now we eagarly constant-fold symbols in the analyzer that are perfectly constrained to be a constant value. This allows us to recover some path-sensitivity in some cases by lowering the required level of reasoning power needed to evaluate some expressions. The net win from this change is that the false positive in PR 8015 is fixed, and we also find more idempotent operations bugs. We do, however, regress with the BugReporterVisitors, which need to be modified to understand this constant folding (and look past it). This causes some diagnostic regressions in plist-output.m which will get addressed in a future patch. plist-output.m is now marked XFAIL, while plist-output-alternate.m now tests that the plist output is working, but with the suboptimal diagnostics. This second test file will eventually be removed. llvm-svn: 113477
* 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
OpenPOWER on IntegriCloud