summaryrefslogtreecommitdiffstats
path: root/clang/lib/Analysis/BasicStore.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Make 'BasicStoreManager' + 'NewCastRegion' testable from the command line ↵Ted Kremenek2009-07-061-2/+6
| | | | | | using '-analyzer-store=basic-new-cast'. llvm-svn: 74865
* BasicStoreManager: Use SymbolManager::canSymbolicate() to determine if a ↵Ted Kremenek2009-07-031-1/+1
| | | | | | variable can be symbolicated. llvm-svn: 74750
* StoreManagers: Use 'hasGlobalsStorage()' and 'hasParametersStorage()' instead ofTed Kremenek2009-07-021-4/+3
| | | | | | | directly consulting if a VarDecl is an implicit or actual parameter, a global, etc. llvm-svn: 74716
* Combine two conditional branches into one. No functionality change.Ted Kremenek2009-06-301-8/+4
| | | | llvm-svn: 74552
* We do not require the super region of element region be typed. So do notZhongxing Xu2009-06-301-3/+2
| | | | | | create TypedViewRegion for it. llvm-svn: 74516
* Remove the ASTContext parameter from the getBody() methods of Decl and ↵Argyrios Kyrtzidis2009-06-301-1/+1
| | | | | | | | subclasses. Timings showed no significant difference before and after the commit. llvm-svn: 74504
* Do not crash on binding concrete integer location.Zhongxing Xu2009-06-281-0/+3
| | | | llvm-svn: 74407
* Simplify some code. As in region store, we always expect the location is aZhongxing Xu2009-06-281-41/+34
| | | | | | memregion. llvm-svn: 74406
* Remove uses of std::ostream from libAnalysis.Ted Kremenek2009-06-241-5/+7
| | | | llvm-svn: 74136
* Remove GRStateManager::getRegion/getSelfRegion().Ted Kremenek2009-06-231-1/+1
| | | | llvm-svn: 74006
* Move all factory methods from SVal to ValueManager. API cleanup!Zhongxing Xu2009-06-231-13/+13
| | | | llvm-svn: 73954
* MemRegions:Ted Kremenek2009-06-231-1/+1
| | | | | | | | - Embed a reference to MemRegionManager objects in MemSpaceRegion objects - Use this embedded reference for MemRegion objects to access ASTContext objects without external help - Use this access to ASTContext to simplify 'isBoundable' (no ASTContext& argument required) llvm-svn: 73935
* Start moving in the direction of removing GRStateRef. Now eachTed Kremenek2009-06-171-32/+27
| | | | | | | | GRState object has a direct reference to its GRStateManager, making the functionality of GRStateRef redunandant. This will lead to some nice API cleanup and code shrinking across libAnalysis. llvm-svn: 73644
* Use canonical type for building ElementRegion. Otherwise ElementRegions cannotZhongxing Xu2009-06-161-1/+1
| | | | | | be unique. llvm-svn: 73482
* Rename:Zhongxing Xu2009-05-091-2/+2
| | | | | | | SymbolRegionRValue => SymbolRegionValue SymExpr::RegionRValue => SymExpr::RegionValueKind llvm-svn: 71322
* As discussed with Ted, rename TypedRegion::getObjectType() to Zhongxing Xu2009-05-091-1/+1
| | | | | | TypedRegion::getValueType(). llvm-svn: 71321
* rename: MemRegion:Zhongxing Xu2009-05-091-3/+3
| | | | | | | | | RValueType => ObjectType LValueType => LocationType No functionality change. llvm-svn: 71304
* Fix unused variable warningTed Kremenek2009-05-051-1/+1
| | | | llvm-svn: 70946
* Remove possibly incorrect assertion that doesn't matter.Ted Kremenek2009-05-051-3/+0
| | | | llvm-svn: 70943
* Add array index assertion: BasicStore should not expect any fancyTed Kremenek2009-05-041-1/+4
| | | | | | ElementRegions that have non-zero array indices. llvm-svn: 70867
* array indexes are unsigned integers of the same width as pointer.Zhongxing Xu2009-05-041-5/+4
| | | | | | | no-outofbounds.c still fails. Previously it passed because the array index is mistakenly a loc::ConcreteInt. llvm-svn: 70844
* BasicStore: 'ElementRegion' is the new 'TypedViewRegion'.Ted Kremenek2009-05-041-9/+10
| | | | | | | StoreManager: Handle casts from one element region to another. Update test cases. llvm-svn: 70836
* Per conversations with Zhongxing, add an 'element type' toTed Kremenek2009-05-041-4/+7
| | | | | | | | | | | | | | | | | | | ElementRegion. I also removed 'ElementRegion::getArrayRegion', although we may need to add this back. This breaks a few test cases with RegionStore: - 'array-struct.c' triggers an infinite recursion in RegionStoreManager. Need to investigate. - misc-ps.m triggers a failure with RegionStoreManager as we now get the diagnostic: 'Line 159: Uninitialized or undefined return value returned to caller.' There were a bunch of places that needed to be edit RegionStoreManager, and we may not be passing all the correct 'element types' down from GRExprEngine. Zhongxing: When you get a chance, could you review this? I could have easily screwed up something basic in RegionStoreManager. llvm-svn: 70830
* Basic Store: Always convert a non::LocAsInteger to a Loc when storing to a ↵Ted Kremenek2009-05-011-17/+16
| | | | | | pointer. llvm-svn: 70564
* Add corner case logic to BasicStoreManager and GRSimpleVals::EvalBinOp to enableTed Kremenek2009-04-291-5/+36
| | | | | | | | | | | | | | reasoning about OSCompareAndSwap32Barrier/OSCompareAndSwap64Barrier. Essentially the address of reference to a region (pointer-to-pointer) can be casted to (int32_t*), and we need to handle the logic to convert the involved locations back and forth from nonloc::LocAsInteger, nonloc::ConcreteInt, to Loc and loc::ConcreteInt respectively. This adds some potentially suspect logic to BasicStoreManager that allows the analyzer to reason about abuses of the C type system. This should probably be refined, be ported over to RegionStoreManager, and extended with "path-sensitive type checking" to flag bugs in clearly incoherent code. llvm-svn: 70382
* Refactor 'BasicStoreManager::CastRegion' and 'RegionStoreManager::CastRegion'Ted Kremenek2009-04-211-29/+1
| | | | | | | | into StoreManager::CastRegion. Both methods were practically identical, and this is core logic that is common to all StoreManagers since it defines the basic invariants of the abstract memory model. llvm-svn: 69730
* Remove loc::FuncVal.Zhongxing Xu2009-04-201-5/+0
| | | | llvm-svn: 69577
* FunctionDecl::getBody() is getting an ASTContext argument for use inDouglas Gregor2009-04-181-1/+1
| | | | | | | | lazy PCH deserialization. Propagate that argument wherever it needs to be. No functionality change, except that I've tightened up a few PCH tests in preparation. llvm-svn: 69406
* Implement analyzer support for OSCompareAndSwap. This required pushing "tagged"Ted Kremenek2009-04-111-0/+31
| | | | | | | | | ProgramPoints all the way through to GRCoreEngine. NSString.m now fails with RegionStoreManager because of the void** cast. Disabling use of region store for that test for now. llvm-svn: 68845
* Finally nuke loc::SymbolVal.Zhongxing Xu2009-04-101-23/+0
| | | | llvm-svn: 68771
* - Move ownership of MemRegionManager into ValueManager.Ted Kremenek2009-04-091-7/+4
| | | | | | | - Pull SVal::GetConjuredSymbol() and friends into ValueManager. This greatly simplifies the calling interface to clients. llvm-svn: 68731
* This is the first step to gradually remove the use of loc::SymbolVal. NowZhongxing Xu2009-04-031-5/+9
| | | | | | | | when creating symbolic values, we distinguish between location and non-location values. For location values, we create a symbolic region instead of a loc::SymbolVal. llvm-svn: 68373
* Simplify more code by using SVal::getAsSymbol().Ted Kremenek2009-03-301-1/+1
| | | | llvm-svn: 68052
* Implement a FIXME.Zhongxing Xu2009-03-301-1/+1
| | | | llvm-svn: 68024
* analyzer infrastructure: make a bunch of changes to symbolic expressions thatTed Kremenek2009-03-261-4/+3
| | | | | | | | | | | | | | | | Zhongxing and I discussed by email. Main changes: - Removed SymIntConstraintVal and SymIntConstraint - Added SymExpr as a parent class to SymbolData, SymSymExpr, SymIntExpr - Added nonloc::SymExprVal to wrap SymExpr - SymbolRef is now just a typedef of 'const SymbolData*' - Bunch of minor code cleanups in how some methods were invoked (no functionality change) This changes are part of a long-term plan to have full symbolic expression trees. This will be useful for lazily evaluating complicated expressions. llvm-svn: 67731
* analyzer: Fix embarrassing regression in BasicStore when invalidating structTed Kremenek2009-03-231-0/+4
| | | | | | values passed-by-reference to unknown functions. llvm-svn: 67519
* Fix crash reported in <rdar://problem/6695527>. We now haveTed Kremenek2009-03-181-13/+9
| | | | | | | | | SVal::GetRValueSymbolVal do the checking if we can symbolicate a type instead of having BasicStoreManager do it (which wasn't always doing the check consistently). Having this check in SVal::GetRValueSymbolVal keeps the check in one centralized place. llvm-svn: 67245
* Retrofit some basic tracking of ivars (for the current object) into BasicStore.Ted Kremenek2009-03-051-30/+85
| | | | llvm-svn: 66166
* Minor code compaction. No functionality change.Ted Kremenek2009-03-051-11/+5
| | | | llvm-svn: 66165
* Rename VarBindings -> Bindings.Ted Kremenek2009-03-051-15/+15
| | | | llvm-svn: 66164
* BasicStore:Ted Kremenek2009-03-051-14/+16
| | | | | | | | | | | | | - Store bindings using a MemRegion -> SVal binding instead of VarDecl -> SVal binding. This mirrors some of the idea of RegionStore, but is far simpler and not nearly as functional. This leads to some code simplification and some potential for some minor precision hacks. Along the way... - constify the use of MemRegion* in a few places - add operator<<(llvm::raw_ostream, const MemRegion*) llvm-svn: 66163
* Don't use std::auto_ptr with getSubRegionMap().Ted Kremenek2009-03-031-2/+2
| | | | llvm-svn: 65957
* Implement FIXME: GRStateManager::scanReachableSymbols now supports scanning ↵Ted Kremenek2009-03-031-1/+2
| | | | | | MemRegions. llvm-svn: 65919
* Add StoreManager::getSubRegionMap(). This method returns an opaque mapping ↵Ted Kremenek2009-03-031-0/+13
| | | | | | for clients of StoreManagers from MemRegions to their subregions. llvm-svn: 65914
* Rename AnonTypedRegion to TypedViewRegion.Ted Kremenek2009-03-011-2/+2
| | | | llvm-svn: 65764
* Make SymbolicRegion subclass TypedRegion, for symbols usually have types, so Zhongxing Xu2009-02-051-2/+4
| | | | | | | | | | | | | | do the symblic regions associated with them and we need them to be typed. Current SymbolicRegion::getRValueType() method is very restricting. It may be modified when we are more clear about what could be the types of symblic regions. BasicConstraintManager::Assume() is changed due to that now SymblicRegion is a subclass of SubRegion. llvm-svn: 63844
* Fix bug in BasicStore::getLValueElement where if the base of an array ↵Ted Kremenek2009-01-271-2/+12
| | | | | | | | subscript expression was an ElementRegion we stacked another ElementRegion on top of that. This fixes PR 3422. llvm-svn: 63110
* Static analyzer: Remove a bunch of outdated SymbolData objects andTed Kremenek2009-01-221-3/+4
| | | | | | | | | | | | | | | | | | | | their associated APIs. We no longer need separate SymbolData objects for fields, variables, etc. Instead, we now associated symbols with the "rvalue" of a MemRegion (i.e., the value stored at that region). Now we only have two kinds of SymbolData objects: SymbolRegionRValue and SymbolConjured. This cleanup also makes the distinction between a SymbolicRegion and a symbolic value that is a location much clearer. A SymbolicRegion represents a chunk of symbolic memory, while a symbolic location is just a "pointer" with different possible values. Without any specific knowledge, a symbolic location resolves (i.e., via a dereference) to a SymbolicRegion. In the future, when we do better alias reasoning, a symbolic location can become an alias for another location, thus merging the constraints on the referred SymbolicRegion with the other region. llvm-svn: 62769
* Static Analyzer: Replace LiveSymbols/DeadSymbols sets with a new object ↵Ted Kremenek2009-01-211-13/+13
| | | | | | called "SymbolReaper". Right now it just consolidates the two and cleans up some client code, but shortly it will be used to enable "lazy computation" of live symbols for use with RegionStore. llvm-svn: 62722
* Update some doxygen comments to be more rich. Remove ↵Ted Kremenek2009-01-071-16/+16
| | | | | | StoreManager::GetRegionSVal. llvm-svn: 61894
OpenPOWER on IntegriCloud