summaryrefslogtreecommitdiffstats
path: root/clang/lib/Analysis/GRTransferFuncs.cpp
Commit message (Collapse)AuthorAgeFilesLines
* analyzer infrastructure: make a bunch of changes to symbolic expressions thatTed Kremenek2009-03-261-2/+3
| | | | | | | | | | | | | | | | 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
* Static analyzer:Ted Kremenek2009-02-141-19/+0
| | | | | | | | | | | | | | | | | | | | - Added a new 'node builder' class called GRStmtNodeBuilderRef (name may change). This is essentially a smart reference to a GRStmtNodeBuilder object that keeps track of the current context (predecessor node, GRExprEngine object, etc.) The idea is to gradually simplify the interface between GRExprEngine and GRTransferFuncs using this new builder (i.e., passing 1 argument instead of 5). It also handles some of the "auto-transition" for node creation, simplifying some of the logic in GRExprEngine itself. - Used GRStmtBuilderRef to replace GRTransferFuncs::EvalStore with GRTransferFuncs::EvalBind. The new EvalBind method will be used at any arbitrary places where a binding between a location and value takes place. Moreover, GRTransferFuncs no longer has the responsibility to request StoreManager to do the binding; this is now in GRExprEngine::EvalBind. All GRTransferFuncs::EvalBind does is checker-specific logic (which can be a no-op). llvm-svn: 64525
* Overhaul BugReporter interface and implementation. The new interface cleans upTed Kremenek2009-02-041-2/+0
| | | | | | | | | | | | | | | | | | | | | the ownership of BugTypes and BugReports. Now BugReports are owned by BugTypes, and BugTypes are owned by the BugReporter object. The major functionality change in this patch is that reports are not immediately emitted by a call to BugReporter::EmitWarning (now called EmitReport), but instead of queued up in report "equivalence classes". When BugReporter::FlushReports() is called, it emits one diagnostic per report equivalence class. This provides a nice cleanup with the caching of reports as well as enables the BugReporter engine to select the "best" path for reporting a path-sensitive bug based on all the locations in the ExplodedGraph that the same bug could occur. Along with this patch, Leaks are now coalesced into a common equivalence class by their allocation site, and the "summary" diagnostic for leaks now reports the allocation site as the location of the bug (this may later be augmented to also provide an example location where the leak occurs). llvm-svn: 63796
* Implement FIXME in GRExprEngine::VisitUnaryOperator() to handle implicit ↵Ted Kremenek2008-11-151-2/+2
| | | | | | conversions caused by the '!' operator. This required adding some logic to GRSimpleVals to reason about nonloc::LocAsInteger SVals. This code appears to work fine, but it should eventually be cleaned up. llvm-svn: 59335
* Rename:Zhongxing Xu2008-10-301-2/+2
| | | | | | | - SetSVal(GRState*, Loc, SVal) => BindLoc - SetSVal(GRState*, Expr*, SVal) => BindExpr llvm-svn: 58421
* Fix 80-col.Zhongxing Xu2008-10-301-1/+1
| | | | llvm-svn: 58417
* This patch did the following renaming. There should be no functional changes.Zhongxing Xu2008-10-171-4/+4
| | | | | | | | | | RVal => SVal LVal => Loc NonLVal => NonLoc lval => loc nonlval => nonloc llvm-svn: 57671
* Rename ValueState -> GRState.Ted Kremenek2008-08-131-7/+7
| | | | | | Rename ValueStateManager -> GRStateManager. llvm-svn: 54721
* Renamed deterministic EvalBinOp to DetermEvalBinOpNN. This name mangling is ↵Ted Kremenek2008-07-181-1/+1
| | | | | | unfortunately needed because virtual methods with the same name can be hidden by subclasses. llvm-svn: 53751
* Created ValueStateSet class to manage the creation of multiple states by a ↵Ted Kremenek2008-07-181-11/+5
| | | | | | | | method. Modified the new EvalBinOpNN to generate states instead of nodes. This is a much simpler interface and is what clients will want to do. llvm-svn: 53750
* Begin major changes to EvalXXX methods in GRTransferFuncs. Currently some ↵Ted Kremenek2008-07-171-0/+15
| | | | | | of the methods only return an RVal; we want them to be able to create an arbitrary number of states. llvm-svn: 53739
* Refactored most of the "Store" piece of ValueState into a Store type. TheTed Kremenek2008-07-101-1/+1
| | | | | | | | | current store implementation is now encapsulated by BasicStore. These changes prompted some long due constification of ValueState. Much of the diffs in this patch include adding "const" qualifiers. llvm-svn: 53423
* Small tweaks to EvalStore: pass an "RVal" instead of "LVal" for the TargetLV toTed Kremenek2008-04-161-0/+20
| | | | | | represent possible stores to "Unknown." llvm-svn: 49811
* Add missing file.Ted Kremenek2008-04-161-0/+19
llvm-svn: 49805
OpenPOWER on IntegriCloud