summaryrefslogtreecommitdiff
path: root/lib/Analysis/RegionStore.cpp
Commit message (Collapse)AuthorAge
...
* When evaluating pointer arithmetic, if the base location is a symbolic region,Zhongxing Xu2009-05-09
| | | | | | | | convert it to the first element region. Also do not assume the array region is typed. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71358 91177308-0d34-0410-b5e6-96231b3b80d8
* Do not create a TypedViewRegion when the base struct region is a symbolicZhongxing Xu2009-05-09
| | | | | | | | region. In the future we may set the cast-to type as the same time. But for now, we simply leave it as it is. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71357 91177308-0d34-0410-b5e6-96231b3b80d8
* Do not layer a TypedViewRegion when casting symbolic or alloca regions.Zhongxing Xu2009-05-09
| | | | | | | | | | Modify getLValueElement accordingly. Now we don't require base region to be a typed region. Do not create TypedViewRegion when base region is symbolic or alloca region. We can do so because each element region has its type information. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71355 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove the case for casting to compatible type in Zhongxing Xu2009-05-09
| | | | | | | RegionStoreManager::CastRegion(). This case should be subsumed by others. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71353 91177308-0d34-0410-b5e6-96231b3b80d8
* Rename:Zhongxing Xu2009-05-09
| | | | | | | | SymbolRegionRValue => SymbolRegionValue SymExpr::RegionRValue => SymExpr::RegionValueKind git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71322 91177308-0d34-0410-b5e6-96231b3b80d8
* As discussed with Ted, rename TypedRegion::getObjectType() to Zhongxing Xu2009-05-09
| | | | | | | TypedRegion::getValueType(). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71321 91177308-0d34-0410-b5e6-96231b3b80d8
* rename: MemRegion:Zhongxing Xu2009-05-09
| | | | | | | | | | RValueType => ObjectType LValueType => LocationType No functionality change. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71304 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix PR4182.Zhongxing Xu2009-05-08
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71288 91177308-0d34-0410-b5e6-96231b3b80d8
* Region store: when casting VarRegions, if the cast-to pointee type is Zhongxing Xu2009-05-08
| | | | | | | incomplete, do not compute its size and return the original region. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71213 91177308-0d34-0410-b5e6-96231b3b80d8
* Replace the heuristic isSmallerThan with ASTContext::getTypeSize().Zhongxing Xu2009-05-08
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71206 91177308-0d34-0410-b5e6-96231b3b80d8
* Replace getTypeWidth() with ASTContext::getTypeSize().Zhongxing Xu2009-05-08
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71205 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert r71079.Zhongxing Xu2009-05-08
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71202 91177308-0d34-0410-b5e6-96231b3b80d8
* Improve RegionStoreManager::getSizeInElements()Zhongxing Xu2009-05-06
| | | | | | | | | - add a static function getTypeWidth(), which computes the width of a type with the help of TargetInfo. - no-outofbounds.c now passes for region store. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71080 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a GDM for recording the cast type of regions.Zhongxing Xu2009-05-06
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71076 91177308-0d34-0410-b5e6-96231b3b80d8
* Implement a heuristic type size comparison method for now.Zhongxing Xu2009-05-06
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71074 91177308-0d34-0410-b5e6-96231b3b80d8
* remove commented code.Zhongxing Xu2009-05-06
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71060 91177308-0d34-0410-b5e6-96231b3b80d8
* Make StoreManager::CastRegion() virtual and implement a new CastRegion() forZhongxing Xu2009-05-06
| | | | | | | | | | RegionStore. This CastRegion() performs casts according to the kind of the region being cast instead of the type that is cast to. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71058 91177308-0d34-0410-b5e6-96231b3b80d8
* Per conversations with Zhongxing, add an 'element type' toTed Kremenek2009-05-04
| | | | | | | | | | | | | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70830 91177308-0d34-0410-b5e6-96231b3b80d8
* region store: make Retrieve() can retrieve embedded array correctly. AlsoZhongxing Xu2009-05-03
| | | | | | | simplify the retrieve logic. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70651 91177308-0d34-0410-b5e6-96231b3b80d8
* SymbolicRegions may also be live roots.Zhongxing Xu2009-04-29
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70380 91177308-0d34-0410-b5e6-96231b3b80d8
* Refactor 'BasicStoreManager::CastRegion' and 'RegionStoreManager::CastRegion'Ted Kremenek2009-04-21
| | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69730 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove loc::FuncVal.Zhongxing Xu2009-04-20
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69577 91177308-0d34-0410-b5e6-96231b3b80d8
* Finally nuke loc::SymbolVal.Zhongxing Xu2009-04-10
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68771 91177308-0d34-0410-b5e6-96231b3b80d8
* - Move ownership of MemRegionManager into ValueManager.Ted Kremenek2009-04-09
| | | | | | | | - Pull SVal::GetConjuredSymbol() and friends into ValueManager. This greatly simplifies the calling interface to clients. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68731 91177308-0d34-0410-b5e6-96231b3b80d8
* Propagate the ASTContext to various AST traversal and lookup functions.Douglas Gregor2009-04-09
| | | | | | | No functionality change (really). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68726 91177308-0d34-0410-b5e6-96231b3b80d8
* This is the first step to gradually remove the use of loc::SymbolVal. NowZhongxing Xu2009-04-03
| | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68373 91177308-0d34-0410-b5e6-96231b3b80d8
* Re-apply 68028. The code had drifted enough that the tests would fail withoutTed Kremenek2009-03-30
| | | | | | | it. Will discuss offline whether symbolic regions should by typed or typeless. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68070 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert 68028.Ted Kremenek2009-03-30
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68068 91177308-0d34-0410-b5e6-96231b3b80d8
* Make SymbolicRegion untyped.Zhongxing Xu2009-03-30
| | | | | | | Layer the type information with a TypedViewRegion on top of the SymbolicRegion. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68028 91177308-0d34-0410-b5e6-96231b3b80d8
* Implement a FIXME.Zhongxing Xu2009-03-30
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68024 91177308-0d34-0410-b5e6-96231b3b80d8
* remove dead code.Zhongxing Xu2009-03-27
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67825 91177308-0d34-0410-b5e6-96231b3b80d8
* analyzer infrastructure: make a bunch of changes to symbolic expressions thatTed Kremenek2009-03-26
| | | | | | | | | | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67731 91177308-0d34-0410-b5e6-96231b3b80d8
* Use a work list to recursively build up the subregion mapping, and mark liveZhongxing Xu2009-03-18
| | | | | | | var region roots. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67152 91177308-0d34-0410-b5e6-96231b3b80d8
* Updated comment.Ted Kremenek2009-03-13
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66894 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix failure reported by Sebastian of test/Analysis/ptr-arith.c when the targetTed Kremenek2009-03-13
| | | | | | | | | | | is 64-bit. I used his suggestion of doing a direct bitwidth/signedness conversion of the 'offset' instead of just changing the sign. For more information, see: http://lists.cs.uiuc.edu/pipermail/cfe-dev/2009-March/004587.html git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66892 91177308-0d34-0410-b5e6-96231b3b80d8
* Use getAsRecordType() to get around sugar types.Zhongxing Xu2009-03-12
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66768 91177308-0d34-0410-b5e6-96231b3b80d8
* Do not stipulate the record type is a definition in BindStruct().Zhongxing Xu2009-03-11
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66654 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix crash when LHS of pointer arithmetic is not ElementRegion.Zhongxing Xu2009-03-11
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66649 91177308-0d34-0410-b5e6-96231b3b80d8
* RegionStore::getLValueElement: Handle the case where the signedness of theTed Kremenek2009-03-11
| | | | | | | | | offset may be different that the base. Ultimately we need a better solution for these issues, but this point-by-point fixes are gradually outlining the scope of the problem. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66638 91177308-0d34-0410-b5e6-96231b3b80d8
* RegionStore::getElementLValue(): Handle the case where the base is a null ↵Ted Kremenek2009-03-09
| | | | | | pointer. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66486 91177308-0d34-0410-b5e6-96231b3b80d8
* Only track integer and pointer values.Zhongxing Xu2009-03-09
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66419 91177308-0d34-0410-b5e6-96231b3b80d8
* Now we do not retrieve untyped regions.Zhongxing Xu2009-03-09
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66418 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix a serious bug in RegionStore: we got the new state with new store fromZhongxing Xu2009-03-09
| | | | | | | Bind() and BindStruct(), but we returned a state with the old store. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66409 91177308-0d34-0410-b5e6-96231b3b80d8
* Add initial support for tracking ivars, with special handling for ivars of ↵Ted Kremenek2009-03-05
| | | | | | 'self'. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66133 91177308-0d34-0410-b5e6-96231b3b80d8
* RegionStore: Handle implicit parameters.Ted Kremenek2009-03-04
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65987 91177308-0d34-0410-b5e6-96231b3b80d8
* RegionStore::RemoveDeadBindings needs to check all the symbols of the super ↵Ted Kremenek2009-03-04
| | | | | | region of a scanned region as well. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65981 91177308-0d34-0410-b5e6-96231b3b80d8
* Don't use std::auto_ptr with getSubRegionMap().Ted Kremenek2009-03-03
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65957 91177308-0d34-0410-b5e6-96231b3b80d8
* Implement FIXME: GRStateManager::scanReachableSymbols now supports scanning ↵Ted Kremenek2009-03-03
| | | | | | MemRegions. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65919 91177308-0d34-0410-b5e6-96231b3b80d8
* Add StoreManager::getSubRegionMap(). This method returns an opaque mapping ↵Ted Kremenek2009-03-03
| | | | | | for clients of StoreManagers from MemRegions to their subregions. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65914 91177308-0d34-0410-b5e6-96231b3b80d8
* remove an implemented fixme.Zhongxing Xu2009-03-02
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65817 91177308-0d34-0410-b5e6-96231b3b80d8