aboutsummaryrefslogtreecommitdiff
path: root/lib/Analysis
AgeCommit message (Collapse)Author
2008-10-25Add StringRegion to MemRegions.Zhongxing Xu
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58137 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-25Now we can handle arrays.Zhongxing Xu
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58135 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-24Use "followsFundamentalRule" to determine if an instance method allocates ↵Ted Kremenek
memory. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58114 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-24followsFundamentalRule() returns true if "alloc" or "new" appear at the ↵Ted Kremenek
beginning of the string, not anywhere within it. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58112 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-24Implicit conversions from arrays can also be conversions to references (will ↵Ted Kremenek
add a test case shortly). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58110 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-24Issue warnings about owned objects returned from a method that does not ↵Ted Kremenek
match the established Cocoa naming conventions. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58108 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-24Added method "getSelfRegion" to Store. This method returns the region ↵Ted Kremenek
associated with the "this" or "self" object (C++ and Objective-C respectively). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58107 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-24Added region ObjCObjectRegion that represents an instance of an Objective-C ↵Ted Kremenek
object. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58106 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-24The Decl of an array region can be VarDecl or FieldDecl. Handle this in ↵Zhongxing Xu
RegionStoreManager::ArrayToPointer(). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58086 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-24Implement struct initialization. Make it into a recursive function. Also makeZhongxing Xu
the array initialization code into a function. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58083 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-24Add printing method to ElementRegion.Zhongxing Xu
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58077 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-24Add printing method to RegionStoreManager.Zhongxing Xu
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58074 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-24Add printing with llvm::raw_ostream methods to SVals.Zhongxing Xu
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58073 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-24Fix 80-col violation.Zhongxing Xu
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58070 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-24Add a bunch of dummy methods to make RegionStoreManager non-virtual.Zhongxing Xu
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58061 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-24Added getLValueElement() to RegionStore. Only handle constant array for now.Zhongxing Xu
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58058 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-24Make the analyzer store (memory model) a command line option.Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58056 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-23Add an assertion to make our intention more clear.Zhongxing Xu
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58030 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-23Let StoreManager do different cast on arrays. BasicStore will just keep it ↵Zhongxing Xu
intact. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58028 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-23Disable warning about potential leaks of returned values until we test it a ↵Ted Kremenek
little more (lots of noise). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58021 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-22Warn about potentially leaked objects that are returned from methods whose ↵Ted Kremenek
names do not follow the Cocoa Memory Management guidelines. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58012 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-22Enhance reference-count checker to correctly identify CG "release" ↵Ted Kremenek
functions. This fixes <rdar://problem/6303488>. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57997 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-22Add a bunch of getLValue* methods to RegionStore.Zhongxing Xu
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57977 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-22Adjust parameter order to more natural one.Zhongxing Xu
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57964 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-22Exprs of function type is another special case for ImplicitCast.Zhongxing Xu
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57963 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-21When conjuring symbols for compound assignments, use the promoted type to ↵Ted Kremenek
determine if the symbolic value as a "loc::" or "nonloc::" value. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57917 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-21Cosmetic patch from João Paulo Rechi VitaDouglas Gregor
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57910 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-21Preliminary support for function overloadingDouglas Gregor
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57909 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-21Handle [NSAutoreleasePool addObject:] (an alternative way to add objects to ↵Ted Kremenek
the current autorelease pool). Added initial code for tracking stack of autorelease pools. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57908 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-21Localize the special processing of array variable inside Zhongxing Xu
GRExprEngine::VisitCast() so that other parts of the analyzer can be ignorant. When we cast "array of type T" to "pointer to T", we get the loc::MemRegionVal corresponding to the array variable. This is sufficient for BasicStore, but not for RegionStore. RegionStore should get the element region for the first array element in the cast. So next comes to the revamping of transfer functions for different store model. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57897 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-21Modify Store interface: GetSVal/SetSVal => Retrieve/Bind.Zhongxing Xu
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57896 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-21Rename:Zhongxing Xu
RValues.h/cpp => SVals.h/cpp git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57893 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-21Process decls in RegionStore. Individual elements of fixed size arrays areZhongxing Xu
initialized to UndefinedVal. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57892 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-21Add ElementRegion to represent memory chunks for array elements.Zhongxing Xu
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57891 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-20Further improve path-sensitivity with divide-by-zero checking by assuming ↵Ted Kremenek
that a denominator cannot be zero even when the result of an '/' or '%' expression is unknown. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57855 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-20Used conjured symbols to recover path-sensitivity when the result of a ↵Ted Kremenek
compound assignment is UnknownVal(). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57851 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-18Add support in GRExprEngine for UnaryOperator::AlignOf. This fixes one ↵Ted Kremenek
crash report in PR 2796. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57777 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-18Generalize VisitLValue: not only can CallExprs and ObjCMessageExprs return ↵Ted Kremenek
aggregate temporaries, so can many other expressions. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57761 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-18Function calls and ObjC message expressions can be used in a lvalue context ↵Ted Kremenek
if they return a structure. E.g foo().x == 1. We don't really support, however, such temporaries yet in the environment or the store. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57760 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-18retain/release checker: Check if a tracked value escapes if we also try ↵Ted Kremenek
binding it to the store and the store doesn't support that binding (i.e., it cannot track it). This has the nice feature that the checker will automatically get more powerful if we use a more powerful store model. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57755 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-18Use "VisitLValue" when processing the base for "x.f" field accesses, and ↵Ted Kremenek
"Visit" when processing the base for "x->f" field accesses. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57754 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-17Hack: have BasicStore::getLValueElement return the "Base" lvalue. This ↵Ted Kremenek
restores null dereference checking with array accesses. BasicStore::RemoveDeadBindings: handle regions besides VarRegions (we now have FieldRegions). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57741 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-17When conjuring symbols to recover path-sensitivity, don't conjure symbols ↵Ted Kremenek
that represent an entire struct. We need to implement struct temporaries as an actual "region", and then bind symbols to the FieldRegion of those temporaries. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57739 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-17Enhance "Assumption" logic in BasicConstraintManager when reasoning about ↵Ted Kremenek
regions and symbolic regions. When assuming whether or not a location is non-null, walk up the region hierarchy until we hit a symbolic region (and test it for null). This may not be the end all solution, as the notion of what a "symbolic region" is really belongs in the specific subclass of StoreManager. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57730 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-17Add pretty-printing support for FieldRegions.Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57724 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-17Fixed an elusive caching bug in ExplodedGraph construction when a ↵Ted Kremenek
PostStmtKind was used instead of a PostStoreKind. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57719 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-17- constify some uses of MemRegion* (MemRegion should be immutable).Ted Kremenek
- Added new region "SymbolicRegion", which maps symbol values to the region domain. - Enhanced BasicStore::getFieldLValue() to return a FieldRegion (using SymbolicRegion) - Added some utility methods to GRState for fetch svals from the store. - Fixed regression in CheckNSError (we weren't getting the value bound to the parameter) git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57717 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-17"Implement" GRExprEngine::VisitLValue for ObjCPropertyRefExpr. This is only ↵Ted Kremenek
a bandid; we need to properly handle properties by using locv/nonloc objects and specially handling property assignments in the transfer function for BinaryOperator. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57693 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-17This patch did the following renaming. There should be no functional changes.Zhongxing Xu
RVal => SVal LVal => Loc NonLVal => NonLoc lval => loc nonlval => nonloc git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57671 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-17Get array's lvalue through standard interface.Zhongxing Xu
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57666 91177308-0d34-0410-b5e6-96231b3b80d8