aboutsummaryrefslogtreecommitdiff
path: root/lib/Checker
AgeCommit message (Collapse)Author
2010-10-25Add check for UnknownVals for mutexes in ObjCAtSyncChecker. Fixes crash ↵Ted Kremenek
reported in PR 8458. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117300 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-22Fix '-analyzer-display-progress' for Objective-C methods. Also remove ↵Ted Kremenek
obsolete code. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117161 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-22Move classes into anonymous namespaces.Benjamin Kramer
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117104 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-21Tweak the ObjCAtSyncChecker to assume that a mutex is non-nil after checking ↵Ted Kremenek
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>. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117016 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-21Remove unused variable.Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116995 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-20Remove obsolete GRAuditor and GRSimpleAPICheck, which have been completely ↵Ted Kremenek
subsumed by the Checker interface. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116973 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-20Convert GRSimpleAPIChecks in BasicObjCFoundationChecks to be Checkers.Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116971 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-15Tweak retain/release checker diagnostics to specify a leak occurs because an ↵Ted Kremenek
object is not referenced later in the path, not that it isn't referenced later in the code. Fixes <rdar://problem/8527839>. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116636 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-14Eliminate usage of ObjCSuperExpr used forFariborz Jahanian
'super' as receiver of property or a setter/getter methods. //rdar: //8525788 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116483 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-14Call PreVisitDeclStmt for C++ aggregate initializers. Patch by Jim Goodnow II.Zhongxing Xu
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116473 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-11comment out unused functionChris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116189 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-10Unbreak the CMake build.Francois Pichet
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116164 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-10Add experimental chroot check which checks improper use of chroot(). Patch by Zhongxing Xu
Lei Zhang. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116163 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-06UnreachableCodeChecker cleanup and improvementsTom Care
- 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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@115861 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-01UnreachableCodeChecker does not need to inherit from CheckerVisitor, only ↵Tom Care
Checker. It does not use any AST Stmt hooks, only VisitEndAnalysis. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@115345 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-30Added two new command line arguments:Marcin Swiderski
-cfg-add-implicit-dtors - sets CFG::BuildOptions::AddImplicitDtors for AnalysisCosumer to true, -cfg-add-initializers - sets CFG::BuildOptions::AddInitializers for AnalysisCosumer to true. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@115142 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-30Include changes to VisitCXXMemberCallExpr (call visitor functions).Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@115120 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-30Tweak nil receiver checker to not warning about 64-bit return values.Ted Kremenek
Fixes: <rdar://problem/7513117> git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@115113 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-29AnalyzerStatsChecker improvements:Tom Care
- 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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@115110 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-29Change -analyzer-max-nodes to allow 0 as a parameter. This allows the ↵Tom Care
analyzer to completely analyze a worklist regardless of time taken. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@115108 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-23Refactor GRExprEngine::VisitCall() to use EvalArguments(), just like ↵Ted Kremenek
VisitCXXMemberCallExpr(). Ideally we should unify these code paths as much as possible, since they only differ by a few details. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114628 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-22Fix an inverse boolean and unnecessary new line in warning output from ↵Tom Care
AnalyzerStatsChecker. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114581 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-18Revert r114244 since it breaks a test in Analysis.Tom Care
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114246 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-18IdempotentOperationChecker no longer reports errors that are post-dominated ↵Tom Care
by a sink. This fixes some false positives that were flagged because a path was incomplete (usually in a loop). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114244 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-16Refactored BugReporter to refer to EndNode as ErrorNode. We currently make ↵Tom Care
the assumption that EndNode == ErrorNode, but upcoming changes will break this. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114065 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-16Introduce new CFGElement hierarchy to support C++ CFG, based on Marcin's patchZhongxing Xu
and discussions with Ted and Jordy. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114056 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-15Disallow the use of UnknownVal as the index for ElementRegions. UnknownVals ↵Ted Kremenek
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>. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113920 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-14Adjust assertion in RegionStoreManager::RetrieveArray() to also take into ↵Ted Kremenek
account typedefs. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113893 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-14Don't divide-by-zero in RegionStoreManager::getSizeInElements() when getting ↵Ted Kremenek
the size of a VLA. We don't track VLA extents yet, but we should at least not crash. Fixes <rdar://problem/8424269>. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113888 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-14Rename 'MaxLoop' to 'MaxVisit' in AnalysisManager to more correctly reflect ↵Tom Care
that we aborted analysis may not necessarily be due to a loop. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113862 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-13Revert "CMake: Update to use standard CMake dependency tracking facilities ↵Michael J. Spencer
instead" This reverts commit r113631 Conflicts: CMakeLists.txt lib/CodeGen/CMakeLists.txt git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113817 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-10CMake: Update to use standard CMake dependency tracking facilities insteadMichael J. Spencer
of whatever we were using before... git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113631 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-10Serialization support for CXXNoexceptExpr.Sebastian Redl
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113627 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-10Polish diagnostics for null dereferences via ObjC ivar accesses. Finishes ↵Ted Kremenek
up <rdar://problem/6352035>. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113612 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-10Add checker implementation for my previous commit!Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113574 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-10Implement: <rdar://problem/6351970> rule request: warn if @synchronized ↵Ted Kremenek
mutex can be nil git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113573 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-10Add ObjCAtSynchronizedStmt to the CFG and add GRExprEngine support (PreVisit ↵Ted Kremenek
for checkers). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113572 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-10Added AnalyzerStatsChecker, a path sensitive check that reports visitation ↵Tom Care
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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113568 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-09Clean up obtuse wording of checker diagnostic of using an uninitialized ↵Ted Kremenek
value in a function call. Fixes: <rdar://problem/8409480> “warning: Pass-by-value argument in function call is undefined” message can be improved git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113554 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-09Use FindReportInEquivalenceClass to identify all the nodes used for the ↵Ted Kremenek
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()) git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113524 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-09Clean up CMake dependenciesDouglas Gregor
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113489 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-09Remove unused variable.Benjamin Kramer
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113482 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-09do not bind temporaries to non-const referencesGabor Greif
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?) git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113480 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-09Rename GRState::getSVal() -> getRawSVal() and getSimplifiedSVal() -> getSVal().Ted Kremenek
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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113477 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-09Simplified reachability checking in IdempotentOperationChecker and added a ↵Tom Care
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 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113465 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-09Static analyzer fix: <rdar://problem/5880430> Switch on enum should not ↵Ted Kremenek
consider default case live if all enum values are covered git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113457 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-08Fix warnings caused by new CXXUuidofExprClass enumerator.Francois Pichet
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113444 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-07Fix null pointer dereference in StreamChecker::Fseek (reported in PR 8081) ↵Ted Kremenek
and simplify surrounding checking logic. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113282 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-07Re-enabled truncation/extension checking in IdempotentOperationChecker and ↵Tom Care
added a test case. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113269 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-03"I see dead code". IdempotentOperationChecker::isTruncationExtensionAssignmentChris Lattner
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 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112949 91177308-0d34-0410-b5e6-96231b3b80d8