aboutsummaryrefslogtreecommitdiff
path: root/include/clang/Analysis/PathSensitive/GRExprEngine.h
AgeCommit message (Collapse)Author
2008-04-14Hooked up the dead-store checker to the BugReporter interface. Now dead-storeTed Kremenek
warnings are emitted as part of the warnings registered by GRSimpleVals. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49658 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-11Added "EvalEndPath" to GRTransferFuncs: the default implementation does notTed Kremenek
change the state (and thus the GREndPathNodeBuilder automatically contructs a node). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49563 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-11Added "GREndPathNodeBuilder", a new node builder that will be used forTed Kremenek
evaluating transfer functions at the end-of-path. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49561 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-09Major refactoring/cleanup of GRExprEngine, ExplodedGraph, and BugReporter.Ted Kremenek
Bugs are now reported using a combination of "BugType" (previously BugDescription) and Bug "BugReport" objects, which are fed to BugReporter (which generates PathDiagnostics). This provides a far more modular way of registering bug types and plugging in diagnostics. GRExprEngine now owns its copy of GRCoreEngine, and is not owned by the ExplodedGraph. ExplodedGraph is no longer templated on the "checker", but instead on the state contained in the nodes. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49453 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-03Make typedefs public.Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49185 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-03Added missing #ifndef...#define...#endif directives to protect againstTed Kremenek
double includes. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49126 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-31Added path-sensitive check for return statements that return the addressTed Kremenek
of a stack variable. This is the path-sensitive version of a check that is already done during semantic analysis. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48980 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-27Added "GRAuditor" and "GRSimpleAPICheck" interface to allow simple stateless ↵Ted Kremenek
checkers to be injected into the analyzer. Added "AnnotatedPath" class to record an annotated path that will be useful for inspecting paths. Added some boilerplate code for simple checks of Apple's Foundation API. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48867 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-25GRSimple analysis now outputs additional diagnostic warnings aboutTed Kremenek
passing an uninitialized value to a message expresion. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48776 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-25Tweak to transfer function for ObjCMessageExpr: handle both instance methodsTed Kremenek
and message expressions with a specified receiver. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48773 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-25Added logic to check for uninitialized values as the receivers for message ↵Ted Kremenek
expressions and uninitialized values passed-by-value as arguments to message expressions. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48760 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-25Added initial transfer function support for ObjCMessageExpr.Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48757 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-21Rename "Nodify" to "MakeNode"Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48659 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-17Added initial transfer function support for inline asm.Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48466 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-14Emit warnings for undefined control-flow.Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48368 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-13The LiveVariables analysis no longer requires a FunctionDecl&; this allows itTed Kremenek
to be run on other declarations of blocks of code (e.g., Objective-C methods.) git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48339 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-12Prototype (pre-alpha) implementation of CFRef checker.Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48272 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-11Expanded graph visualization interface to include specifying a range ofTed Kremenek
nodes to use a trim sources. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48236 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-10Add transfer function support for pointer arithmetic where theTed Kremenek
increment/decrement operand is on the left side. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48144 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-10More cleanups with using the liveness analysis to removed dead symbols andTed Kremenek
variables from the symbolic state. Now we keep a mapping from the predecessor node of a statement and its cleaned state, and interpose an accessor "GetState()" to return the cleaned state when the node is the predecessor node, and the real state otherwise. This obviates problem of ever accidentally cleaning the state more than once (thus blowing away new bindings by mistake). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48124 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-09When processing the transfer function for a statement, evaluateTed Kremenek
RemoveDeadBindings early because (1) it will always be called and (2) we can dispatch to a plug-in transfer function that can evaluate the effect of dead symbols (not yet added). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48114 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-09Refactored guards for "GRExprEngine::RemoveDeadBindings" directly into theTed Kremenek
method. This paves the way for other alterations to RemoveDeadBindings that are transparent to its callers. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48113 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-09Bug fix: Don't call RemoveDeadBindings more than once (can kill newly ↵Ted Kremenek
generated values to Block-Level Expressions). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48079 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-07Added --trim-path-graph to the driver to trim paths from the ExplodedGraphTed Kremenek
that are not related to error nodes. Fixed bug where we did not detect some NULL dereferences. Added "ExplodedGraph::Trim" to trim all nodes that cannot transitively reach a set of provided nodes. Fixed subtle bug in ExplodedNodeImpl where we could create predecessor iterators that included the mangled "sink" bit. The better fix is to integrate this bit into the void* for the wrapped State, not the NodeGroups representing a node's predecessors and successors. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48036 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-07Renamed ValueManager to BasicValueFactory.Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48025 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-07Refined divide-by-zero checking to distinguish between must and mayTed Kremenek
divide-by-zero errors. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48013 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-05remove the source location arguments to various target query methods.Chris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47954 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-05Plug-in transfer function "EvalCall" now takes as an argument the currentTed Kremenek
GRStmtNodeBuilder and is now responsible for adding its own nodes to the graph. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47923 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-05Cleaned up typedefs involving StateTy so that we always use "StateTy*" ↵Ted Kremenek
instead of StateTy. This is conceptually much cleaner, as it shows that the state is always a pointer. It also makes it easier to marshall these values around across the internal APIs of the path-sensitive engine. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47921 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-04Make GRStmtNodeBuilder only depend on StateTy, and not the type definitionTed Kremenek
of the entire checker. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47920 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-04Moved implementation of GRExprEngine::Nodify into GRStmtNodeBuilder. This willTed Kremenek
allow us to pass the builder to plug-in transfer functions and allow those functions to create intermediate nodes. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47919 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-04Moved GRExprEngine::NodeSet out of GRExprEngine and made it a standalone ↵Ted Kremenek
class: ExplodedNodeSet. Made GRExprEngine::NodeSet a typedef of ExplodedNodeSet. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47914 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-04Fixed insidious state propagation bug that would sometimes cause the stateTed Kremenek
to bifurcate at the wrong places and not propagate at others. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47876 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-04Enhanced pretty-printing of undefined-argument errors.Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47873 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-01newline at end of file, by David ChisnallChris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47788 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-29Added extra check for calls to functions where we pass undefined valuesTed Kremenek
as arguments. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47778 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-29Add checks for function calls via a function pointer that is NULL, Undefined,Ted Kremenek
or otherwise a constant integer value that doesn't evaluate to an address. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47774 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-29"Refinement" of hack to bound loop-traversals: visit any block at a maximum ↵Ted Kremenek
of 3 times along a given path. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47766 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-28Added checking for undefined results of '<<' and '>>' (shifting by too many ↵Ted Kremenek
bits, etc.) This current implementation only works when both operands are concrete values; later we will add support for symbolic values. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47726 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-28Merged ValueState and ValueStateImpl into just ValueState, with ↵Ted Kremenek
GRExprEngine::StateTy just becoming ValueState*. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47714 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-28Renamed "Uninitialized" -> "Undefined" in path-sensitive value tracking engine.Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47713 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-27End paths when calling a function marked "noreturn."Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47690 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-27When analyzing a function, eagerly create symbolic values for allTed Kremenek
globals/parameters at the beginning of the analysis. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47664 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-27Header file cleanups: reduce number of includes; move ValueState.h into ↵Ted Kremenek
include directory tree. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47661 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-26Fix bug when processing '?' operator: invalidate the old "Uninitialized" ↵Ted Kremenek
value of the block-level expression for ?. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47645 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-26Added boilerplate for plug-in transfer function support for CallExprs.Ted Kremenek
GRSimpleVals performs the following action: invalidate all values passed-by-reference. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47638 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-26Removed static analysis-specific diagnostics from DiagnosticKinds.def.Ted Kremenek
Use custom diagnostics for static analysis checkers. Added warnings for dereferencing uninitialized values and divide-by-zeroes. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47626 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-26Major cleanup of the transfer function logic for '&&', '||', and '?'. WeTed Kremenek
now store in the state essentially which branch we took. This removes a bunch of bogus assumptions (and likely bugs), reduces the complexity of the implementation, and facilitates more optimizations. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47613 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-26Added lazy "symbolication" of parameter variables and global variables.Ted Kremenek
Added recording of divide-by-zero and divide-by-uninitialized nodes. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47586 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-25Added transfer function support for checking for divide-by-zero errors.Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47547 91177308-0d34-0410-b5e6-96231b3b80d8