aboutsummaryrefslogtreecommitdiff
path: root/Analysis
AgeCommit message (Collapse)Author
2008-03-04Added preliminary transfer function support for references.Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47912 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-04For the transfer function for CallExpr, invalidate all argumentsTed Kremenek
passed-by-reference to builtin functions until we have better builtin support. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47910 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-04For the transfer function of DeclStmt, for now initialize the values ofTed Kremenek
structs (local variables) to Unknown instead of Undefined. (added FIXME to initialize *members* of struct to undefined) git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47901 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-04Implemented "print" method for ValueState.Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47894 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-04Add transfer function support for the default initialization of staticTed Kremenek
variables that are pointers or integers. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47880 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-03Fixed subtle caching bug in ExplodedGraph that would cause some nodes toTed Kremenek
be incorrectly merged together. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47851 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-03Added FIXME.Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47842 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 simple hack to reduce redundant warnings from the checker:Ted Kremenek
Cache the location of the error. Don't emit the same warning for the same error type that occurs at the same program location but along a different path. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47727 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-27Fixed use of an uninitialized variable.Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47691 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-27Small tweaks to the transfer function for DeclStmt: do not mark external globalTed Kremenek
variables as uninitialized, and only "initialize" static function variables. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47683 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-27Added string "[CHECKER]" to the output diagnostics produced by the ↵Ted Kremenek
GRSimpleVals analysis. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47678 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-27Small fix to VisitLVal: this method can be called on Block-Level expressions. Ted Kremenek
In such cases, handle them just like Visit(). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47665 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-27Similar bug fix to r47650; when processing CallExprs if we did not generate anTed Kremenek
ExplodedNode for the Callee subexpression we would not evaluate the CallExpr transfer function. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47651 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-27Fixed bug in the core transfer function logic for CallExprs where we wouldTed Kremenek
sometimes skip evaluating all the arguments when some arguments would not create new ExplodedNodes. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47650 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-26Don't emit divide-by-zero errors when we divide by an unknown (notTed Kremenek
uninitialized) value. At this point we're just too imprecise. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47636 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-26Removed hack with toggling the signedness flag of the APSInt storedTed Kremenek
in an EnumConstantDecl. This was made possible because of a recent fix in the parser: http://llvm.org/viewvc/llvm-project?rev=47581&view=rev git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47624 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-26Small fixes to shore up overhauling of transfer function logic for '&&' and '||.Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47620 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-26optimization: no longer create ExplodedNodes for IntegerLiteral andTed Kremenek
CharacterLiteral expressions. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47617 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-26Fixed inverted condition.Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47590 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-26Added FIXME.Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47578 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-25Minor bug fix in LiveVariables: don't "kill" decls referenced by a DeclStmtTed Kremenek
that aren't VarDecls. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47572 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-25Better handling of calls to functions via function pointers.Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47562 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-25Fixed bug in RemoveDeadBindings when performing the mark-and-sweep over theTed Kremenek
symbolic store: VarDecl's inserted into the sweep may not always bind to anything; handle this special case just like bindings to uninitialized values. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47550 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-25Expanded transfer function support for divide-by-zero checking to includeTed Kremenek
"remainder-by-zero" checking (operator '%'). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47549 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-25Added hack to transfer function logic to handle the case where a DeclRefExprTed Kremenek
wrapping an EnumConstantDecl evaluates to an integer type that has a different signedness than the APSInt stored in the EnumConstantDecl. Will file a Bugzilla report. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47548 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
2008-02-22Fixed horrid bug in LiveVariables analysis where we were only merging atTed Kremenek
confluence points the liveness information for variables (Decls) and NOT block-level expressions. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47506 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-22Punt on unifying symbolic lvalues. This won't be needed for many checkers.Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47489 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-22Added "assumption" logic for lval::FuncVal and lval::GotoLabel, and simplifiedTed Kremenek
assumption logic for lval::DeclVal. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47466 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-22Bug fix: For transfer function for unary "!", compare the subexpression valueTed Kremenek
against '0' of the same bit-width. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47465 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-22Bug fix in liveness: Only compute liveness information for VarDecls.Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47464 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-21Return "Unknown" when using the value of a function pointer whose valueTed Kremenek
is symbolic. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47463 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-21Added transfer function support for dispatching to functions we don't knowTed Kremenek
about. The default logic is to invalidate the values of all values passed-by-reference. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47456 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-21RemoveDeadBindings should now check for UninitalizedVal, as it is a nowTed Kremenek
an error to cast it to LVal. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47450 91177308-0d34-0410-b5e6-96231b3b80d8