summaryrefslogtreecommitdiffstats
path: root/clang/lib/Analysis/BasicConstraintManager.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Remove references to 'Checker' and 'GRTransferFuncs' fromTed Kremenek2010-01-051-5/+6
| | | | | | | | | | | | GRStateManager. Having these references was an abstraction violation, as they really should only be known about GRExprEngine. This change required adding a new 'ProcessAssume' callback in GRSubEngine. GRExprEngine implements this callback by calling 'EvalAssume' on all registered Checker objects as well as the registered GRTransferFunc object. llvm-svn: 92549
* lib/Analysis: Remove VISIBILITY_HIDDEN from definitions in anonymous namespaceKovarththanan Rajaratnam2009-11-281-4/+3
| | | | llvm-svn: 90028
* Remove tabs, and whitespace cleanups.Mike Stump2009-09-091-31/+31
| | | | llvm-svn: 81346
* Remove uses of std::ostream from libAnalysis.Ted Kremenek2009-06-241-8/+4
| | | | llvm-svn: 74136
* Remove GRStateManager& field from SimpleConstraintManager.Ted Kremenek2009-06-181-1/+1
| | | | llvm-svn: 73735
* libAnalysis:Ted Kremenek2009-06-181-88/+72
| | | | | | | | | - Remove the 'isFeasible' flag from all uses of 'Assume'. - Remove the 'Assume' methods from GRStateManager. Now the only way to create a new GRState with an assumption is to use the new 'assume' methods in GRState. llvm-svn: 73731
* Remove more uses of GRStateRef.Ted Kremenek2009-06-171-17/+12
| | | | llvm-svn: 73648
* Patch by Ben Laurie:Ted Kremenek2009-02-141-238/+11
| | | | | | | | | | | | | | | | | | | | ConstraintManager: - constify getSymVal() BasicConstraintManager: - Pull out logic that would be common to ConstraintManagers of a similar nature and put them in a parent class called 'SimpleConstraintManager'. RangeConstraintManager: - Added a new prototype ConstraintManager to track ranges of variables! This ConstraintManager keeps tracks of ranges of concrete integers that a symbolic integer may have. AnalysisConsumer: - Add driver option to use RangeConstraintManager with GRExprEngine-based analyses. llvm-svn: 64558
* Make SymbolicRegion subclass TypedRegion, for symbols usually have types, so Zhongxing Xu2009-02-051-9/+6
| | | | | | | | | | | | | | 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
* update for change in API.Chris Lattner2009-01-301-4/+4
| | | | llvm-svn: 63363
* Remove method 'AddNE' from the public interface of ConstraintManager.Ted Kremenek2009-01-281-1/+1
| | | | llvm-svn: 63249
* Use tag classes instead of typedefs for GDM entries 'ConstNotEq' and ↵Ted Kremenek2009-01-261-29/+33
| | | | | | 'ConstEq'. This avoids collisions in the GDM. llvm-svn: 63002
* Static analyzer: Remove a bunch of outdated SymbolData objects andTed Kremenek2009-01-221-5/+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-15/+9
| | | | | | 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
* CF-retain/release checker:Ted Kremenek2008-12-171-4/+19
| | | | | | | - Fix regression reported in <rdar://problem/6452745>. After a null check, null references to resources should not have a retain count. This regression was caused by removing the call to "GRTransferFuncs::EvalAssume" in BasicConstraintManager. - Added a test case to test this behavior. llvm-svn: 61155
* Rename SymbolID to SymbolRef. This is a precursor to some overhauling of ↵Ted Kremenek2008-12-051-27/+27
| | | | | | the representation of symbolic values. llvm-svn: 60575
* BasicConstraintManager:Ted Kremenek2008-12-031-3/+23
| | | | | | | | | | | - Fix nonsensical logic in AssumeSymGE. When comparing 'sym >= constant' and the constant is the maximum integer value, add the constraint that 'sym == constant' when the path is deemed feasible. All other cases are feasible. - Improve AssumeSymGT. When comparing 'sym > constant' and constant is the maximum integer value we know the path is infeasible. - Add test case for this enhancement to AssumeSymGT. llvm-svn: 60490
* BasicConstraintManager:Ted Kremenek2008-12-031-6/+24
| | | | | | | | | | | | - Fix nonsensical logic in AssumeSymLE. When comparing 'sym <= constant' and the constant is the minimum integer value, add the constraint that 'sym == constant' when the path is deemed feasible. All other cases are feasible. - Improve AssumeSymLT to address <rdar://problem/6407949>. When comparing 'sym < constant' and constant is the minimum integer value we know the path is infeasible. - Add test case for <rdar://problem/6407949>. llvm-svn: 60489
* Factory objects should not be temporary. It caches all objects in the set.Zhongxing Xu2008-11-271-3/+4
| | | | llvm-svn: 60151
* Add comments.Zhongxing Xu2008-11-271-0/+2
| | | | llvm-svn: 60146
* Fix crash of array bounds checking under 64-bit.Sebastian Redl2008-11-241-2/+8
| | | | | | There might be other, similar bugs lurking there. llvm-svn: 59974
* Initial support for checking out of bound memory access. Only support Zhongxing Xu2008-11-221-0/+27
| | | | | | ConcreteInt index for now. llvm-svn: 59869
* Print integer value instead of raw pointer. This is a hack to be fixed by ↵Zhongxing Xu2008-11-101-3/+1
| | | | | | migrating the output in analyzer to llvm::raw_ostream. llvm-svn: 58965
* Remove loc::StringLiteralVal. Now we allocate regions for string literals in ↵Zhongxing Xu2008-10-261-1/+0
| | | | | | the Store. llvm-svn: 58182
* Enhance "Assumption" logic in BasicConstraintManager when reasoning about ↵Ted Kremenek2008-10-171-1/+20
| | | | | | regions and symbolic regions. When assuming whether or not a location is non-null, walk up the region hierarchy until we hit a symbolic region (and test it for null). This may not be the end all solution, as the notion of what a "symbolic region" is really belongs in the specific subclass of StoreManager. llvm-svn: 57730
* This patch did the following renaming. There should be no functional changes.Zhongxing Xu2008-10-171-32/+32
| | | | | | | | | | RVal => SVal LVal => Loc NonLVal => NonLoc lval => loc nonlval => nonloc llvm-svn: 57671
* Remove lval::FieldOffset, lval::ArrayOffset. These will be replaced with ↵Ted Kremenek2008-10-171-8/+0
| | | | | | | | | | | regions. Remove GRExprEngine::getLVal and RValues::MakeVal. Enhance StoreManager "GetLValue" methods to dispatch for specific kinds of lvalue queries, as opposed to interogating the expression tree (GRExprEngine already does this). Added FIXMEs. In particular, we no longer "assume" that a base pointer in a field/array access is null (this logic was removed). Perhaps we should do this when fetching the lvalue for fields and array elements? llvm-svn: 57657
* This is a big patch, but the functionality change is small and the rest of ↵Ted Kremenek2008-10-041-1/+1
| | | | | | | | | | | | | | the patch consists of deltas due to API changes. This patch overhauls the "memory region" abstraction that was prototyped (but never really used) as part of the Store.h. This patch adds MemRegion.h and MemRegion.cpp, which defines the class MemRegion and its subclasses. This classes serve to define an abstract representation of memory, with regions being layered on other regions to to capture the relationships between fields and variables, variables and the address space they are allocated in, and so on. The main motivation of this patch is that key parts of the analyzer assumed that all value bindings were to VarDecls. In the future this won't be the case, and this patch removes lval::DeclVal and replaces it with lval::MemRegionVal. Now all pieces of the analyzer must reason about abstract memory blocks instead of just variables. There should be no functionality change from this patch, but it opens the door for significant improvements to the analyzer such as field-sensitivity and object-sensitivity, both which were on hold until the memory abstraction got generalized. The memory region abstraction also allows type-information to literally be affixed to a memory region. This will allow the some now redundant logic to be removed from the retain/release checker. llvm-svn: 57042
* Fixed logic error in BasicConstraintManager pointed out by Zhongxing Xu.Ted Kremenek2008-09-191-20/+7
| | | | | | | | | | | | | | | For checking if a symbol >= value, we need to check if symbol == value || symbol > value. When checking symbol > value and we know that symbol != value, the path is infeasible only if value == maximum integer. For checking if a symbol <= value, we need to check if symbol == value || symbol < value. When checking symbol < value and we know that symbol != value, the path is infeasible only if value == minimum integer. Updated test case exercising this logic: we only prune paths if the values are unsigned. llvm-svn: 56354
* Add an omitted case for AssumeSymInt.Zhongxing Xu2008-09-191-0/+6
| | | | llvm-svn: 56334
* Minor pass-sensitivity improvement:Ted Kremenek2008-09-161-4/+25
| | | | | | | if we know that 'len != 0' and know that 'i == 0' then we know that 'i < len' must evaluate to true and cannot evaluate to false llvm-svn: 56260
* Add newline at end of file.Daniel Dunbar2008-08-301-1/+1
| | | | llvm-svn: 55559
* Added LLVM comment header.Zhongxing Xu2008-08-291-0/+14
| | | | llvm-svn: 55537
* Migrate the rest symbolic analysis stuff to BasicConstraintManager.Zhongxing Xu2008-08-291-12/+164
| | | | llvm-svn: 55536
* Refactor Assume logic into a separate class ConstraintManager.Zhongxing Xu2008-08-271-0/+298
llvm-svn: 55412
OpenPOWER on IntegriCloud