summaryrefslogtreecommitdiffstats
path: root/clang/lib/Analysis/RegionStore.cpp
Commit message (Collapse)AuthorAgeFilesLines
* First step toward fixing <rdar://problem/6613046> refactor clang objc type ↵Steve Naroff2009-06-171-1/+1
| | | | | | | | | | | | representation. Add a type (ObjCObjectPointerType) and remove a type (ObjCQualifiedIdType). This large/tedious patch is just a first step. Next step is to remove ObjCQualifiedInterfaceType. After that, I will remove the magic TypedefType for 'id' (installed by Sema). This work will enable various simplifications throughout clang (when dealing with ObjC types). No functionality change. llvm-svn: 73649
* Start moving in the direction of removing GRStateRef. Now eachTed Kremenek2009-06-171-188/+208
| | | | | | | | 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
* RegionStoreManager:Ted Kremenek2009-06-161-198/+272
| | | | | | | | | | - Add "sections" to RegionStoreManager.cpp to delineate functionality. - Add new function "CreateFieldsOnlyRegionStoreManager" that uses the new RegionStoreFeatures class to use a reduced set of features from RegionStoreManager (in this case, only field-sensitivity). This isn't completely hooked up yet. llvm-svn: 73572
* Use canonical type for building ElementRegion. Otherwise ElementRegions cannotZhongxing Xu2009-06-161-10/+13
| | | | | | be unique. llvm-svn: 73482
* Stop tracking non-compound value for struct. It may be caused by imprecise castZhongxing Xu2009-06-131-2/+4
| | | | | | logic. llvm-svn: 73279
* use getAsPointerType() method.Zhongxing Xu2009-06-121-1/+1
| | | | llvm-svn: 73218
* Bind the mistakenly generated nonloc::SymbolVal to struct correctly. See theZhongxing Xu2009-06-111-0/+3
| | | | | | comments for added test case for details. llvm-svn: 73189
* Use more robust getAsRecordType() method.Zhongxing Xu2009-06-111-1/+1
| | | | llvm-svn: 73186
* Treat AllocaRegion as SymbolicRegion in RegionStore::Retrieve().Zhongxing Xu2009-05-201-2/+5
| | | | llvm-svn: 72166
* * API change: we need to pass GRState to GRExprEngine::EvalBinOp() becauseZhongxing Xu2009-05-201-5/+18
| | | | | | | | RegionStore needs to know the type of alloca region. * RegionStoreManager::EvalBinOp() now converts the alloca region to its first element region, as what is done to symbolic region. llvm-svn: 72164
* Silence a Release-Asserts warning.Daniel Dunbar2009-05-181-0/+1
| | | | llvm-svn: 72013
* Add logic for invalidating array region to CFRefCount.cpp. When invalidatingZhongxing Xu2009-05-121-3/+14
| | | | | | | | | array region, set its default value to conjured symbol. When retrieving its element, create new region value symbol for the element. Also fix some 80 columns violations. llvm-svn: 71548
* When retrieving an ElementRegion, if its super region is a StringRegion,Zhongxing Xu2009-05-111-0/+18
| | | | | | retrieve the string value. llvm-svn: 71430
* Fix a bug that leads to infinite loop. Set the correct element type toZhongxing Xu2009-05-111-4/+2
| | | | | | ElementRegion. llvm-svn: 71428
* When casting VarRegion, if the var type is aggregate type and the cast-toZhongxing Xu2009-05-091-1/+2
| | | | | | | pointee type is scalar type, create element region regardless with the sizes of types. llvm-svn: 71360
* Remove the rest TypedViewRegion processing code. There should be noZhongxing Xu2009-05-091-53/+0
| | | | | | TypedViewRegion usage in region store. llvm-svn: 71359
* When evaluating pointer arithmetic, if the base location is a symbolic region,Zhongxing Xu2009-05-091-18/+15
| | | | | | | convert it to the first element region. Also do not assume the array region is typed. llvm-svn: 71358
* Do not create a TypedViewRegion when the base struct region is a symbolicZhongxing Xu2009-05-091-4/+0
| | | | | | | 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. llvm-svn: 71357
* Do not layer a TypedViewRegion when casting symbolic or alloca regions.Zhongxing Xu2009-05-091-13/+9
| | | | | | | | | 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. llvm-svn: 71355
* Remove the case for casting to compatible type in Zhongxing Xu2009-05-091-10/+2
| | | | | | RegionStoreManager::CastRegion(). This case should be subsumed by others. llvm-svn: 71353
* Rename:Zhongxing Xu2009-05-091-3/+3
| | | | | | | SymbolRegionRValue => SymbolRegionValue SymExpr::RegionRValue => SymExpr::RegionValueKind llvm-svn: 71322
* As discussed with Ted, rename TypedRegion::getObjectType() to Zhongxing Xu2009-05-091-13/+13
| | | | | | TypedRegion::getValueType(). llvm-svn: 71321
* rename: MemRegion:Zhongxing Xu2009-05-091-20/+15
| | | | | | | | | RValueType => ObjectType LValueType => LocationType No functionality change. llvm-svn: 71304
* Fix PR4182.Zhongxing Xu2009-05-081-2/+2
| | | | llvm-svn: 71288
* Region store: when casting VarRegions, if the cast-to pointee type is Zhongxing Xu2009-05-081-0/+8
| | | | | | incomplete, do not compute its size and return the original region. llvm-svn: 71213
* Replace the heuristic isSmallerThan with ASTContext::getTypeSize().Zhongxing Xu2009-05-081-9/+5
| | | | llvm-svn: 71206
* Replace getTypeWidth() with ASTContext::getTypeSize().Zhongxing Xu2009-05-081-44/+5
| | | | llvm-svn: 71205
* Revert r71079.Zhongxing Xu2009-05-081-2/+2
| | | | llvm-svn: 71202
* Improve RegionStoreManager::getSizeInElements()Zhongxing Xu2009-05-061-2/+53
| | | | | | | | - 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. llvm-svn: 71080
* Add a GDM for recording the cast type of regions.Zhongxing Xu2009-05-061-2/+25
| | | | llvm-svn: 71076
* Implement a heuristic type size comparison method for now.Zhongxing Xu2009-05-061-3/+19
| | | | llvm-svn: 71074
* remove commented code.Zhongxing Xu2009-05-061-8/+0
| | | | llvm-svn: 71060
* Make StoreManager::CastRegion() virtual and implement a new CastRegion() forZhongxing Xu2009-05-061-0/+80
| | | | | | | | | RegionStore. This CastRegion() performs casts according to the kind of the region being cast instead of the type that is cast to. llvm-svn: 71058
* Per conversations with Zhongxing, add an 'element type' toTed Kremenek2009-05-041-17/+27
| | | | | | | | | | | | | | | | | | | 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
* region store: make Retrieve() can retrieve embedded array correctly. AlsoZhongxing Xu2009-05-031-19/+30
| | | | | | simplify the retrieve logic. llvm-svn: 70651
* SymbolicRegions may also be live roots.Zhongxing Xu2009-04-291-0/+4
| | | | llvm-svn: 70380
* Refactor 'BasicStoreManager::CastRegion' and 'RegionStoreManager::CastRegion'Ted Kremenek2009-04-211-34/+2
| | | | | | | | 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-6/+0
| | | | llvm-svn: 69577
* Finally nuke loc::SymbolVal.Zhongxing Xu2009-04-101-40/+5
| | | | llvm-svn: 68771
* - Move ownership of MemRegionManager into ValueManager.Ted Kremenek2009-04-091-7/+5
| | | | | | | - Pull SVal::GetConjuredSymbol() and friends into ValueManager. This greatly simplifies the calling interface to clients. llvm-svn: 68731
* Propagate the ASTContext to various AST traversal and lookup functions.Douglas Gregor2009-04-091-2/+4
| | | | | | No functionality change (really). llvm-svn: 68726
* This is the first step to gradually remove the use of loc::SymbolVal. NowZhongxing Xu2009-04-031-11/+32
| | | | | | | | 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
* Re-apply 68028. The code had drifted enough that the tests would fail withoutTed Kremenek2009-03-301-5/+14
| | | | | | it. Will discuss offline whether symbolic regions should by typed or typeless. llvm-svn: 68070
* Revert 68028.Ted Kremenek2009-03-301-14/+5
| | | | llvm-svn: 68068
* Make SymbolicRegion untyped.Zhongxing Xu2009-03-301-5/+14
| | | | | | Layer the type information with a TypedViewRegion on top of the SymbolicRegion. llvm-svn: 68028
* Implement a FIXME.Zhongxing Xu2009-03-301-7/+2
| | | | llvm-svn: 68024
* remove dead code.Zhongxing Xu2009-03-271-4/+0
| | | | llvm-svn: 67825
* analyzer infrastructure: make a bunch of changes to symbolic expressions thatTed Kremenek2009-03-261-9/+5
| | | | | | | | | | | | | | | | 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
* Use a work list to recursively build up the subregion mapping, and mark liveZhongxing Xu2009-03-181-9/+17
| | | | | | var region roots. llvm-svn: 67152
* Updated comment.Ted Kremenek2009-03-131-0/+2
| | | | llvm-svn: 66894
OpenPOWER on IntegriCloud