summaryrefslogtreecommitdiffstats
path: root/clang/lib/Analysis/RegionStore.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* Add getSize() support for StringRegion.Zhongxing Xu2008-11-241-3/+2
| | | | llvm-svn: 59930
* Clean up code by using utility methods.Zhongxing Xu2008-11-231-11/+7
| | | | llvm-svn: 59899
* Remove debug code.Zhongxing Xu2008-11-221-1/+1
| | | | llvm-svn: 59870
* Initial support for checking out of bound memory access. Only support Zhongxing Xu2008-11-221-0/+36
| | | | | | ConcreteInt index for now. llvm-svn: 59869
* Add support for symbolicating global structs and arrays in ↵Zhongxing Xu2008-11-191-1/+78
| | | | | | RegionStoreManager::getInitialStore(). llvm-svn: 59619
* Fix warning about RegionStoreManager::Retrieve() not always returning a value.Ted Kremenek2008-11-191-1/+1
| | | | llvm-svn: 59571
* handle the case that the array element is of structure type when bind the ↵Zhongxing Xu2008-11-181-1/+4
| | | | | | whole array to a single value (for example, UnknownVal, UndefinedVal). llvm-svn: 59521
* Enhance modularization: return a <state,loc> pair to let GRExprEngine modify theZhongxing Xu2008-11-161-10/+8
| | | | | | environment. llvm-svn: 59407
* Enhances SCA to process untyped region to typed region conversion.Zhongxing Xu2008-11-161-1/+67
| | | | | | | | | | | | - RegionView and RegionViewMap is introduced to assist back-mapping from super region to subregions. - GDM is used to carry RegionView information. - AnonTypedRegion is added to represent a typed region introduced by pointer casting. Later AnonTypedRegion can be used in other similar cases, e.g., malloc()'ed region. - The specific conversion is delegated to store manager. llvm-svn: 59382
* Improve zero value generation.Zhongxing Xu2008-11-151-2/+1
| | | | llvm-svn: 59356
* Process array base expression of any type.Zhongxing Xu2008-11-131-0/+8
| | | | llvm-svn: 59240
* Array index might be unsigned. We have to generate a temporary signed value forZhongxing Xu2008-11-131-0/+12
| | | | | | it to be evaluated by APSInt::operators. llvm-svn: 59238
* Incomplete struct pointer can be used as a function argument.Zhongxing Xu2008-11-131-1/+7
| | | | llvm-svn: 59235
* StoreManager::BindDecl now takes an SVal* for the initialization value ↵Ted Kremenek2008-11-121-23/+15
| | | | | | instead of an Expr* (which can be null). Lazy symbolication of conjured symbols is now the sole responsibility of GRExprEngine. llvm-svn: 59151
* Implement RegionStoreManager::RemoveDeadBindings(). This prunes several ↵Zhongxing Xu2008-11-101-4/+20
| | | | | | false warning caused by removal of symbolic constraints. Currently we just mark all symbols live. Further optimization for dead binding removal needed. llvm-svn: 58982
* Finish the implementation of VisitCompoundLiteralExpr. As VisitInitListExpr is Zhongxing Xu2008-11-071-9/+17
| | | | | | | | | available, things get much simplified. One addition is that CompoundLiteralExpr can appear both in rvalue and lvalue context. llvm-svn: 58837
* Make the assertion real.Zhongxing Xu2008-11-071-1/+1
| | | | llvm-svn: 58833
* 1. When a pointer to struct is used as an argument, GRSimpleVals::EvalCall()Zhongxing Xu2008-11-021-18/+23
| | | | | | | | | | | sets the whole struct to Unknown. Then we cannot assume the V passed to BindStruct() is always a CompoundVal. When it is an UnknownVal, we call BindStructToVal(UnknownVal). 2. Change the signature of InitializeStructToUndefined() to BindStructToVal() to reuse the code. llvm-svn: 58564
* Simplify interface. We can get canonical type from the base region directly. ↵Zhongxing Xu2008-10-311-21/+23
| | | | | | No need for an extra type argument. llvm-svn: 58507
* Implement struct initialization for SCA.Zhongxing Xu2008-10-311-1/+47
| | | | llvm-svn: 58506
* Implement array initialization for SCA.Zhongxing Xu2008-10-311-6/+39
| | | | llvm-svn: 58504
* Implement BindStruct and fix a bug in RetriveStruct.Zhongxing Xu2008-10-311-4/+33
| | | | llvm-svn: 58496
* Implement load from struct region. Instead of returning an UnknownVal(), we ↵Zhongxing Xu2008-10-311-0/+33
| | | | | | create a CompoundVal by loading from each field of the struct. llvm-svn: 58494
* Rename: AddDecl => BindDeclZhongxing Xu2008-10-291-5/+4
| | | | | | | | BindDecl better describes what the function does: - Bind the VarDecl to its memory region - Bind the memory region to some initial value. llvm-svn: 58359
* Added preliminary support for CompoundLiterals in the static analyzer:Ted Kremenek2008-10-271-0/+9
| | | | | | | | | | | | | | | | | | | | - GRExprEngine::VisitCompoundLiteral... (1) visits the initializer list (generating ExplodedNodes) (2) creates a CompoundMemRegion for the literal (3) creates a new state with the bound literal values using GRStateManager::BindCompoundLiteral - GRStateManager::BindCompoundLiteral simply calls StoreManager::BindCompoundLiteral to get a new store and returns a persistent GRState with that store. - BasicStore::BindCompoundLiteral simply returns the same store, as it doesn't handle field sensitivity - RegionStore::BindCompoundLiteral currently fires an assert (pending discussion of how to best implement mappings for CompoundLiteralRegion). llvm-svn: 58277
* Use ASTContext::getCanonicalType() to get TypedRegion's type.Zhongxing Xu2008-10-271-1/+1
| | | | llvm-svn: 58247
* We cannot get precise lvalue for symbolic base array region.Zhongxing Xu2008-10-271-0/+3
| | | | llvm-svn: 58243
* Get the canonical type for struct initialization. The original code would ↵Zhongxing Xu2008-10-271-1/+5
| | | | | | crash on TypedefType. llvm-svn: 58236
* Remove loc::StringLiteralVal. Now we allocate regions for string literals in ↵Zhongxing Xu2008-10-261-4/+0
| | | | | | the Store. llvm-svn: 58182
* Simplify ArrayToPointer conversion. Actually the only thing we need to do is ↵Zhongxing Xu2008-10-261-29/+5
| | | | | | to get the first element region. It is not necessary to care about the kind of the base array region. llvm-svn: 58181
* Add code for get the lvalue for string literals. Now we return a StringRegionZhongxing Xu2008-10-251-3/+16
| | | | | | | for StringLiteral lvalue evaluation, instead of directly returning a loc::StringLiteralVal by the Environment. llvm-svn: 58138
* Added method "getSelfRegion" to Store. This method returns the region ↵Ted Kremenek2008-10-241-0/+8
| | | | | | associated with the "this" or "self" object (C++ and Objective-C respectively). llvm-svn: 58107
* The Decl of an array region can be VarDecl or FieldDecl. Handle this in ↵Zhongxing Xu2008-10-241-2/+10
| | | | | | RegionStoreManager::ArrayToPointer(). llvm-svn: 58086
* Implement struct initialization. Make it into a recursive function. Also makeZhongxing Xu2008-10-241-24/+63
| | | | | | the array initialization code into a function. llvm-svn: 58083
* Add printing method to RegionStoreManager.Zhongxing Xu2008-10-241-3/+11
| | | | llvm-svn: 58074
* Fix 80-col violation.Zhongxing Xu2008-10-241-3/+5
| | | | llvm-svn: 58070
* Add a bunch of dummy methods to make RegionStoreManager non-virtual.Zhongxing Xu2008-10-241-3/+29
| | | | llvm-svn: 58061
* Added getLValueElement() to RegionStore. Only handle constant array for now.Zhongxing Xu2008-10-241-0/+54
| | | | llvm-svn: 58058
* Make the analyzer store (memory model) a command line option.Ted Kremenek2008-10-241-0/+5
| | | | llvm-svn: 58056
* Add a bunch of getLValue* methods to RegionStore.Zhongxing Xu2008-10-221-0/+54
| | | | llvm-svn: 57977
* Preliminary support for function overloadingDouglas Gregor2008-10-211-2/+2
| | | | llvm-svn: 57909
* Modify Store interface: GetSVal/SetSVal => Retrieve/Bind.Zhongxing Xu2008-10-211-12/+12
| | | | llvm-svn: 57896
* Process decls in RegionStore. Individual elements of fixed size arrays areZhongxing Xu2008-10-211-2/+115
| | | | | | initialized to UndefinedVal. llvm-svn: 57892
* - constify some uses of MemRegion* (MemRegion should be immutable).Ted Kremenek2008-10-171-1/+1
| | | | | | | | | - 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) llvm-svn: 57717
* This patch did the following renaming. There should be no functional changes.Zhongxing Xu2008-10-171-9/+9
| | | | | | | | | | RVal => SVal LVal => Loc NonLVal => NonLoc lval => loc nonlval => nonloc llvm-svn: 57671
* This is the first step to implement a field-sensitive store model. Other ↵Zhongxing Xu2008-10-081-0/+96
things are simplified: no heap shape assumption, no parameter alias assumption, etc. llvm-svn: 57285
OpenPOWER on IntegriCloud