aboutsummaryrefslogtreecommitdiff
path: root/lib/Analysis
AgeCommit message (Collapse)Author
2009-11-23UndefBranchChecker: more bug reporter helper information emit.Zhongxing Xu
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89643 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-23Initial refactor of UndefBranchChecker. We still use GRBranchNodeBuilderZhongxing Xu
in the checker directly. But I don't have a better approach for now. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89640 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-22Change CheckDeadStores to use Expr::isNullPointerConstant, which will ↵Ted Kremenek
correctly determine whether an expression is a null pointer constant. Patch by Kovarththanan Rajaratnam! git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89621 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-22Undefined compound assignment result is checked in ↵Zhongxing Xu
UndefinedAssignmentChecker. So this check is redundant. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89592 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-22Remove invalid comments. The result is undefined only when operands are ↵Zhongxing Xu
undefined. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89591 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-22Save and restore the HasGen flag in MallocChecker.Zhongxing Xu
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89590 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-22Don't include a dead header.Benjamin Kramer
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89587 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-22Remove UndefinedAssignmentChecker's header.Zhongxing Xu
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89585 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-21Make FixedAddressChecker and experimental check; it currently produces a ton ↵Ted Kremenek
of false positives when analyzing some projects (e.g., Wine). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89560 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-21Restructure DereferenceChecker slightly to handle caching out when we would ↵Ted Kremenek
report a null dereference more than once. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89526 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-21Pull BadCallChecker int UndefinedArgChecker, and have UndefinedArgChecker ↵Ted Kremenek
also handled undefined receivers in message expressions. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89524 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-21More checker refactoring. Passing undefined values in a message expression ↵Ted Kremenek
is now handled by UndefinedArgChecker. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89519 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-20Fix typo GCC 4.3 warned about.Benjamin Kramer
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89453 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-20Add simple static analyzer checker to check for sending 'release', 'retain', ↵Ted Kremenek
etc. directly to a class. Fixes <rdar://problem/7252064>. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89449 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-20Unused ivar checker: ivars referenced by lexically nested functions should ↵Ted Kremenek
not be flagged as unused. Fixes <rdar://problem/7254495>. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89448 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-20Revert r89437 and add a comment.Zhongxing Xu
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89446 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-20It's unnecessary to check for unknown at this point.Zhongxing Xu
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89437 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-20Fix null dereference in NSAutoreleasePoolChecker when analyzing messages ↵Ted Kremenek
sent to blocks. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89413 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-19Fix crash when using --analyzer-store=region when handling initializers with ↵Ted Kremenek
nested arrays/structs whose values are not explicitly specified. Fixes <rdar://problem/7403269>. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89384 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-19Remove printf statement.Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89383 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-19Only fetch the ASTContext object within the assertion.Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89375 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-19Silence -Asserts warning.Daniel Dunbar
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89373 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-17Add PreVisitReturn to Malloc checker. Now we can recognize returned memoryZhongxing Xu
block. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89071 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-17Add EvalEndPath interface to Checker. Now we can check memory leaked at theZhongxing Xu
end of the path. Need to unify interfaces. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89063 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-17Clear the dest set.Zhongxing Xu
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89060 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-16First part of changes to eliminate problems with cv-qualifiers andDouglas Gregor
sugared types. The basic problem is that our qualifier accessors (getQualifiers, getCVRQualifiers, isConstQualified, etc.) only look at the current QualType and not at any qualifiers that come from sugared types, meaning that we won't see these qualifiers through, e.g., typedefs: typedef const int CInt; typedef CInt Self; Self.isConstQualified() currently returns false! Various bugs (e.g., PR5383) have cropped up all over the front end due to such problems. I'm addressing this problem by splitting each qualifier accessor into two versions: - the "local" version only returns qualifiers on this particular QualType instance - the "normal" version that will eventually combine qualifiers from this QualType instance with the qualifiers on the canonical type to produce the full set of qualifiers. This commit adds the local versions and switches a few callers from the "normal" version (e.g., isConstQualified) over to the "local" version (e.g., isLocalConstQualified) when that is the right thing to do, e.g., because we're printing or serializing the qualifiers. Also, switch a bunch of Context.getCanonicalType(T1).getUnqualifiedType() == Context.getCanonicalType(T2).getQualifiedType() expressions over to Context.hasSameUnqualifiedType(T1, T2) git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@88969 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-16* Do the same thing to the basicstore as in r84163.Zhongxing Xu
* Add a load type to GRExprEngine::EvalLoad(). * When retrieve from 'theValue' of OSAtomic funcitions, use the type of the region instead of the argument expression as the load type. * Then we can convert CastRetrievedSVal to a pure assertion. In the future we can let all Retrieve() methods simply return SVal. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@88888 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-16Remove an unused parameter.Zhongxing Xu
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@88882 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-14Change *BugReport constructors to take StringRefs.Benjamin Kramer
- Eliminates many calls to std::string.c_str() - Fixes an invalid read in ReturnStackAddressChecker due to an unsafe call to StringRef.data() which doesn't guarantee null-termination. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@88779 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-14Move definition of GRExprEngine::ProcessEndPath() out-of-line.Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@88729 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-13Add clang-cc option "--analyzer-experimental-internal-checks". ThisTed Kremenek
option enables new "internal" checks that will eventually be turned on by default but still require broader testing. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@88671 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-13Malloc checker basically works now.Zhongxing Xu
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@87094 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-13Hook up Malloc checker.Zhongxing Xu
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@87093 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-13Check in a new interface of Checker, which will soon be used.Zhongxing Xu
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@87092 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-13GRStateManager::CurrentStmt is not used. Remove it.Zhongxing Xu
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@87091 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-13Pull static variable within function (for slightly faster startup time).Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@87065 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-13retain/release checker: refactor some of the summary lookup logic for ↵Ted Kremenek
instance method summaries. No real functionality change, but it paves the way for new enhancements. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@87062 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-13Add clang-cc option "-analyzer-experimental-checks" to enable experimental ↵Ted Kremenek
path-sensitive checks. The idea is to separate "barely working" or "skunkworks" checks from ones that should always run. Later we need more fine-grain checker control. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@87053 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-12Fix MSVC build.Benjamin Kramer
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86983 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-12update CMakefileZhongxing Xu
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86979 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-12Add boilerplate logic for a malloc/free checker.Zhongxing Xu
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86978 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-12PthreadLockChecker doesn't need PreVisitCallExpr() yet. All the current ↵Ted Kremenek
logic should be done in PostVisitCallExpr() git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86959 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-12Add most of the boilerplate logic for a simple pthread_mutux_lock() -> ↵Ted Kremenek
pthread_mutex_unlock() checker. We need to add a visitor method to Checker for handling dead symbols in order to detect locks that are not unlocked. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86958 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-12Remove obsolete 'struct NullDerefTag'.Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86957 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-12Enhance Checker class (and GRExprEngine) to support PostVisitation for ↵Ted Kremenek
CallExprs. No clients (yet). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86949 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-12Remove GRExprEngine::EvalCall(). It had a single callsite in GRExprEngine, ↵Ted Kremenek
and was easily inlined. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86948 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-12Make StoreManager::getSizeInElements() always return DefinedOrUnknownSVal.Zhongxing Xu
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86932 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-11Remove some stale ErrorNodes variables in GRExprEngine and the old buffer ↵Ted Kremenek
overflow logic in GRExprEngineInternalChecks.cpp. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86877 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-11After drinking caffeine, add the two files missing from the previous submit.Chandler Carruth
Sorry about that. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86869 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-11Move the ManagerRegistry to the Analysis library to resolve the layering ↵Chandler Carruth
violation. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86863 91177308-0d34-0410-b5e6-96231b3b80d8