summaryrefslogtreecommitdiffstats
path: root/clang/lib/Analysis/SymbolManager.cpp
Commit message (Collapse)AuthorAgeFilesLines
* analyzer infrastructure: make a bunch of changes to symbolic expressions thatTed Kremenek2009-03-261-78/+117
| | | | | | | | | | | | | | | | 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
* This patch adds two more SymbolData subclasses: SymIntExpr and SymSymExpr, forZhongxing Xu2009-03-251-0/+41
| | | | | | | | representing symbolic expressions like 'x'+3 and 'x'+'y'. The design is subjected to change later when we fix the class hierarchy of symbolic expressions. llvm-svn: 67678
* analyzer: Fix embarrassing regression in BasicStore when invalidating structTed Kremenek2009-03-231-0/+4
| | | | | | values passed-by-reference to unknown functions. llvm-svn: 67519
* GRExprEngine:Ted Kremenek2009-03-201-1/+2
| | | | | | | | - Conjure symbols at '--' and '++' unary operations - Add utility method SVal::GetConjuredSymbolVal() and constify some arguments along the way. llvm-svn: 67395
* Add an optional "tag" to conjured symbols that allows us to distinguish betweenTed Kremenek2009-03-041-3/+4
| | | | | | | | multiple symbols conjured at the same location. All that is required of the tag is that it is a fixed void* value that points to an memory address that remains valid throughout the remainder of the lifetime of the SymbolManager. llvm-svn: 66092
* Rework use of loc::SymbolVal in the retain/release checker to use the new methodTed Kremenek2009-03-031-3/+17
| | | | | | | | | | | SVal::getAsLocSymbol(). This simplifies the code and allows the retain/release checker to (I believe) also correctly reason about location symbols wrapped in SymbolicRegions. Along the way I cleaned up SymbolRef a little, disallowing implicit casts to 'unsigned'. llvm-svn: 65972
* Added GRStateManager::scanReachableSymbols(), a method which scans the reachableTed Kremenek2009-02-141-1/+2
| | | | | | | | | | | | | symbols from an SVal. - Fixed a bug in EnvironmentManager::RemoveDeadBindings() where it did not mark live all the symbols reachable from a live block-level expression. - Fixed a bug in the retain/release checker where it did not stop tracking symbols that 'escaped' via compound literals being assigned to something the BasicStoreManager didn't reason about. llvm-svn: 64534
* SymbolReaper::isLive(SymbolRef) now always returns true for ↵Ted Kremenek2009-01-221-1/+6
| | | | | | SymbolRegionRvalues because these represent the symbolic values for parameters/globals upon entry to the function. These values are always ;live' because they represent constraints on the context of how the function was called. This will be useful for both summary generation but is also necessary to get RegionStore's lazy-binding of locations to symbols to work in practice with RemoveDeadBindings. llvm-svn: 62771
* Static analyzer: Remove a bunch of outdated SymbolData objects andTed Kremenek2009-01-221-99/+18
| | | | | | | | | | | | | | | | | | | | 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-0/+18
| | | | | | 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
* Fix some unused variable, control reaches end of non-void function,Daniel Dunbar2009-01-151-2/+2
| | | | | | and uninitialized use options. llvm-svn: 62270
* Lazy bingding for region-store manager.Zhongxing Xu2008-12-201-2/+24
| | | | | | | | | | | | | * Now Bind() methods take and return GRState* because binding could also alter GDM. * No variables are initialized except those declared with initial values. * failed C test cases are due to bugs in RemoveDeadBindings(), which removes constraints that is still alive. This will be fixed in later patch. * default value of array and struct regions will be implemented in later patch. llvm-svn: 61274
* Add SymbolRef::print() and have SymbolicRegion::print() use this method ↵Ted Kremenek2008-12-051-0/+5
| | | | | | instead of calling SymbolRef::getNumber(). llvm-svn: 60578
* Rename SymbolID to SymbolRef. This is a precursor to some overhauling of ↵Ted Kremenek2008-12-051-5/+5
| | | | | | the representation of symbolic values. llvm-svn: 60575
* Remove SymbolDataContentsOf (unused).Ted Kremenek2008-12-051-28/+1
| | | | llvm-svn: 60572
* Add SymbolData for array elements and struct fields.Zhongxing Xu2008-11-191-0/+35
| | | | llvm-svn: 59618
* Conjured symbols now bind to Stmt* instead of Expr*.Ted Kremenek2008-11-121-1/+1
| | | | llvm-svn: 59154
* Add a QualType to ConjuredSymbol to represent the type and size of the symbol.Ted Kremenek2008-10-011-4/+4
| | | | | | Use this updated interface when invalidating arguments passed by reference; the type of symbol is of the object passed by reference, not the reference itself. llvm-svn: 56894
* Initialize tracked local variables to undefined.Ted Kremenek2008-08-131-1/+2
| | | | llvm-svn: 54716
* Make a major restructuring of the clang tree: introduce a top-levelChris Lattner2008-03-151-0/+124
lib dir and move all the libraries into it. This follows the main llvm tree, and allows the libraries to be built in parallel. The top level now enforces that all the libs are built before Driver, but we don't care what order the libs are built in. This speeds up parallel builds, particularly incremental ones. llvm-svn: 48402
OpenPOWER on IntegriCloud