summaryrefslogtreecommitdiff
path: root/lib/Analysis/RegionStore.cpp
Commit message (Collapse)AuthorAge
...
* Restructure RegionStoreManager::getSizeInElements() to use a switch statementTed Kremenek2009-07-10
| | | | | | | | over the types of MemRegions. This allows the compiler to warn us which regions are not handled, and also is a little faster. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@75304 91177308-0d34-0410-b5e6-96231b3b80d8
* Move the new 'CastRegion' implementation from RegionStoreManager to StoreManagerTed Kremenek2009-07-06
| | | | | | | | (its superclass). This will allow us to experiment with using the new CastRegion with BasicStoreManager, and gradually phase out the old implementation. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74851 91177308-0d34-0410-b5e6-96231b3b80d8
* remove utility methods that are not very useful.Zhongxing Xu2009-07-03
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74762 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove unused method.Ted Kremenek2009-07-03
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74751 91177308-0d34-0410-b5e6-96231b3b80d8
* Replace guarded calls in RegionStoreManager toTed Kremenek2009-07-02
| | | | | | | | | | ValueManager::getRegionValueSymbolVal() with unguarded calls to ValueManager::getRegionValueSymbolValOrUnknown(). This changes centralizes the decision of what values to symbolicate in SymbolManager rather than having it scatter in RegionStoreManager. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74730 91177308-0d34-0410-b5e6-96231b3b80d8
* Enhance RegionStore to lazily symbolicate fields and array elements forTed Kremenek2009-07-02
| | | | | | | structures passed-by-value as function arguments. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74729 91177308-0d34-0410-b5e6-96231b3b80d8
* StoreManagers: Use 'hasGlobalsStorage()' and 'hasParametersStorage()' instead ofTed Kremenek2009-07-02
| | | | | | | | directly consulting if a VarDecl is an implicit or actual parameter, a global, etc. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74716 91177308-0d34-0410-b5e6-96231b3b80d8
* Minor code cleanup: pull variables into scope of 'if' statement, limiting theirTed Kremenek2009-07-01
| | | | | | | actual lifetime to their logical lifetime. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74665 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a FIXME to RegionStore, do some minor code cleanup, and get RegionStore toTed Kremenek2009-07-01
| | | | | | | | | pass misc-ps.m. Currently RegionStore/BasicStore don't do any special reasoning about clang-style vectors, so we should return UnknownVal (in all cases) when accessing their values via an array. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74660 91177308-0d34-0410-b5e6-96231b3b80d8
* add fixme.Zhongxing Xu2009-07-01
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74581 91177308-0d34-0410-b5e6-96231b3b80d8
* When retrieving element region, if its super region has binding, returnZhongxing Xu2009-06-30
| | | | | | | | | | | | unknown for it. Mark the super region of a live region as live, if the live region is pointed to by a live pointer variable. These fixes xfail_regionstore_wine_crash.c. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74524 91177308-0d34-0410-b5e6-96231b3b80d8
* De-ASTContext-ify DeclContext.Argyrios Kyrtzidis2009-06-30
| | | | | | | Remove ASTContext parameter from DeclContext's methods. This change cascaded down to other Decl's methods and changes to call sites started "escalating". Timings using pre-tokenized "cocoa.h" showed only a ~1% increase in time run between and after this commit. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74506 91177308-0d34-0410-b5e6-96231b3b80d8
* Adjust retrieve handler priority. If a field is of array type, it should be Zhongxing Xu2009-06-28
| | | | | | | handled by RetrieveArray(). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74409 91177308-0d34-0410-b5e6-96231b3b80d8
* Do not crash on binding concrete integer location.Zhongxing Xu2009-06-28
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74407 91177308-0d34-0410-b5e6-96231b3b80d8
* Update method signature.Ted Kremenek2009-06-26
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74244 91177308-0d34-0410-b5e6-96231b3b80d8
* Introduce a new concept to the static analyzer: SValuator.Ted Kremenek2009-06-26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | GRTransferFuncs had the conflated role of both constructing SVals (symbolic expressions) as well as handling checker-specific logic. Now SValuator has the role of constructing SVals from expressions and GRTransferFuncs just handles checker-specific logic. The motivation is by separating these two concepts we will be able to much more easily create richer constraint-generating logic without coupling it to the main checker transfer function logic. We now have one implementation of SValuator: SimpleSValuator. SimpleSValuator is essentially the SVal-related logic that was in GRSimpleVals (which is removed in this patch). This includes the logic for EvalBinOp, EvalCast, etc. Because SValuator has a narrower role than the old GRTransferFuncs, the interfaces are much simpler, and so is the implementation of SimpleSValuator compared to GRSimpleVals. I also did a line-by-line review of SVal-related logic in GRSimpleVals and cleaned it up while moving it over to SimpleSValuator. As a consequence of removing GRSimpleVals, there is no longer a '-checker-simple' option. The '-checker-cfref' did everything that option did but also ran the retain/release checker. Of course a user may not always wish to run the retain/release checker, nor do we wish core analysis logic buried in the checker-specific logic. The next step is to refactor the logic in CFRefCount.cpp to separate out these pieces into the core analysis engine. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74229 91177308-0d34-0410-b5e6-96231b3b80d8
* remove RegionKills GDM. Now UnknownVal is bound to regions explicitly.Zhongxing Xu2009-06-25
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74168 91177308-0d34-0410-b5e6-96231b3b80d8
* Move element region retrieving logic into a separate function.Zhongxing Xu2009-06-25
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74166 91177308-0d34-0410-b5e6-96231b3b80d8
* Move all logic for retrieving ElementRegion binding into a separate method.Zhongxing Xu2009-06-25
| | | | | | | Revert to setting default value approach for handling struct initialization. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74160 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove uses of std::ostream from libAnalysis.Ted Kremenek2009-06-24
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74136 91177308-0d34-0410-b5e6-96231b3b80d8
* use a concrete type instead of a trait type to make code more readable.Zhongxing Xu2009-06-24
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74047 91177308-0d34-0410-b5e6-96231b3b80d8
* RegionStore: revert to the default value approach for array initialization.Zhongxing Xu2009-06-24
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74043 91177308-0d34-0410-b5e6-96231b3b80d8
* - Add MemRegion::getMemorySpace()Ted Kremenek2009-06-23
| | | | | | | | | | | - Change implementation of MemRegion::hasStackStorage()/hasHeapStorage() to use 'getMemorySpace()'. This avoids a double traversal up the region hierarchy and is simpler. - Add MemRegion::hasHeapOrStackStorage() as a slightly more efficient alternative to 'hasStackStorage() || hasHeapStorage()'. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@73977 91177308-0d34-0410-b5e6-96231b3b80d8
* Move 'hasStackStorage()' and 'hasHeapStorage()' from MemRegionManager to ↵Ted Kremenek2009-06-23
| | | | | | MemRegion. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@73973 91177308-0d34-0410-b5e6-96231b3b80d8
* Move all factory methods from SVal to ValueManager. API cleanup!Zhongxing Xu2009-06-23
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@73954 91177308-0d34-0410-b5e6-96231b3b80d8
* ValueManager::makeNonLoc -> ValueManager::makeIntValZhongxing Xu2009-06-23
| | | | | | | Clean up code with ValueManager. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@73951 91177308-0d34-0410-b5e6-96231b3b80d8
* If the init list is fewer than the struct fields, bind the rest fields to 0Zhongxing Xu2009-06-23
| | | | | | | explicitly. Make 0 value with the field type. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@73949 91177308-0d34-0410-b5e6-96231b3b80d8
* Instead of setting the default value of the array region, bind the rest of theZhongxing Xu2009-06-23
| | | | | | | array elements to 0 explicitly. Create 0 values with the element type. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@73946 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove duplicated methods.Zhongxing Xu2009-06-23
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@73940 91177308-0d34-0410-b5e6-96231b3b80d8
* add a fixme.Zhongxing Xu2009-06-23
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@73939 91177308-0d34-0410-b5e6-96231b3b80d8
* Allow CodeTextRegion to be cast to 'void *'.Zhongxing Xu2009-06-22
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@73880 91177308-0d34-0410-b5e6-96231b3b80d8
* Return UnknownVal for pointer arithmetic on struct fields.Zhongxing Xu2009-06-21
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@73851 91177308-0d34-0410-b5e6-96231b3b80d8
* If the SymbolicRegion was cast to another type, use that type to create the Zhongxing Xu2009-06-19
| | | | | | | ElementRegion. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@73754 91177308-0d34-0410-b5e6-96231b3b80d8
* When casting region, if we do not create an element region, record the cast-to Zhongxing Xu2009-06-18
| | | | | | | | | | type. When retrieving the region value, if we are going to create a symbol value, use the cast-to type if possible. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@73690 91177308-0d34-0410-b5e6-96231b3b80d8
* First step toward fixing <rdar://problem/6613046> refactor clang objc type ↵Steve Naroff2009-06-17
| | | | | | | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@73649 91177308-0d34-0410-b5e6-96231b3b80d8
* Start moving in the direction of removing GRStateRef. Now eachTed Kremenek2009-06-17
| | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@73644 91177308-0d34-0410-b5e6-96231b3b80d8
* RegionStoreManager:Ted Kremenek2009-06-16
| | | | | | | | | | | - 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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@73572 91177308-0d34-0410-b5e6-96231b3b80d8
* Use canonical type for building ElementRegion. Otherwise ElementRegions cannotZhongxing Xu2009-06-16
| | | | | | | be unique. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@73482 91177308-0d34-0410-b5e6-96231b3b80d8
* Stop tracking non-compound value for struct. It may be caused by imprecise castZhongxing Xu2009-06-13
| | | | | | | logic. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@73279 91177308-0d34-0410-b5e6-96231b3b80d8
* use getAsPointerType() method.Zhongxing Xu2009-06-12
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@73218 91177308-0d34-0410-b5e6-96231b3b80d8
* Bind the mistakenly generated nonloc::SymbolVal to struct correctly. See theZhongxing Xu2009-06-11
| | | | | | | comments for added test case for details. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@73189 91177308-0d34-0410-b5e6-96231b3b80d8
* Use more robust getAsRecordType() method.Zhongxing Xu2009-06-11
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@73186 91177308-0d34-0410-b5e6-96231b3b80d8
* Treat AllocaRegion as SymbolicRegion in RegionStore::Retrieve().Zhongxing Xu2009-05-20
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72166 91177308-0d34-0410-b5e6-96231b3b80d8
* * API change: we need to pass GRState to GRExprEngine::EvalBinOp() becauseZhongxing Xu2009-05-20
| | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72164 91177308-0d34-0410-b5e6-96231b3b80d8
* Silence a Release-Asserts warning.Daniel Dunbar2009-05-18
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72013 91177308-0d34-0410-b5e6-96231b3b80d8
* Add logic for invalidating array region to CFRefCount.cpp. When invalidatingZhongxing Xu2009-05-12
| | | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71548 91177308-0d34-0410-b5e6-96231b3b80d8
* When retrieving an ElementRegion, if its super region is a StringRegion,Zhongxing Xu2009-05-11
| | | | | | | retrieve the string value. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71430 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix a bug that leads to infinite loop. Set the correct element type toZhongxing Xu2009-05-11
| | | | | | | ElementRegion. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71428 91177308-0d34-0410-b5e6-96231b3b80d8
* When casting VarRegion, if the var type is aggregate type and the cast-toZhongxing Xu2009-05-09
| | | | | | | | pointee type is scalar type, create element region regardless with the sizes of types. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71360 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove the rest TypedViewRegion processing code. There should be noZhongxing Xu2009-05-09
| | | | | | | TypedViewRegion usage in region store. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71359 91177308-0d34-0410-b5e6-96231b3b80d8