summaryrefslogtreecommitdiffstats
path: root/clang/Analysis/GRSimpleVals.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Make a major restructuring of the clang tree: introduce a top-levelChris Lattner2008-03-151-462/+0
| | | | | | | | | | 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
* Added initialization to ErrorDiag to silence gcc's warning of the variableTed Kremenek2008-03-151-1/+1
| | | | | | potentially being used uninitialized (which it cannot be). llvm-svn: 48393
* Emit warnings for undefined control-flow.Ted Kremenek2008-03-141-11/+28
| | | | llvm-svn: 48368
* Path-sensitive analyses no longer take a FunctionDecl, but any Decl representingTed Kremenek2008-03-141-2/+2
| | | | | | | | | a block of "code". Patched various ASTConsumers (such as ASTDumper) to have more support for processing ObjCMethodDecl. CFGVisitor now builds CFGs for ObjCMethodDecls. llvm-svn: 48363
* Changed CallRetValSymbol to SymbolConjured to allow "conjured" symbols to be ↵Ted Kremenek2008-03-121-1/+1
| | | | | | | | | created for any expression, not just CallExprs. Added experimental support for conjuring symbols during assingments where the RHS is "unknown". This allows more value tracking for path-sensitivity. Fixed bug in "assumption" logic when processing symbolic constraints; we would improperly mark constraints we didn't support as infeasible. llvm-svn: 48306
* In GRSimpleVals, added the generation of symbolic values for the return valuesTed Kremenek2008-03-121-3/+17
| | | | | | of function calls. This is useful in pruning paths. llvm-svn: 48299
* Improved ExplodedGraph::Trim to only show nodes reachable from a reverse BFSTed Kremenek2008-03-121-1/+1
| | | | | | | from the sources, and to try and generate only a single path from sources to roots. llvm-svn: 48286
* Prototype (pre-alpha) implementation of CFRef checker.Ted Kremenek2008-03-121-29/+39
| | | | llvm-svn: 48272
* Fix "error: explicit template specialization cannot have a storage class" Chris Lattner2008-03-101-3/+3
| | | | | | with gcc 4.4, patch by Shantonu Sen! llvm-svn: 48155
* Increased worklist limit for GRSimpleVals.Ted Kremenek2008-03-071-1/+1
| | | | llvm-svn: 48037
* Added --trim-path-graph to the driver to trim paths from the ExplodedGraphTed Kremenek2008-03-071-2/+2
| | | | | | | | | | | | | | | | 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. llvm-svn: 48036
* Renamed ValueManager to BasicValueFactory.Ted Kremenek2008-03-071-31/+31
| | | | llvm-svn: 48025
* Refined divide-by-zero checking to distinguish between must and mayTed Kremenek2008-03-071-2/+2
| | | | | | divide-by-zero errors. llvm-svn: 48013
* fix typosGabor Greif2008-03-061-1/+1
| | | | llvm-svn: 47995
* remove the source location arguments to various target query methods.Chris Lattner2008-03-051-2/+2
| | | | llvm-svn: 47954
* Plug-in transfer function "EvalCall" now takes as an argument the currentTed Kremenek2008-03-051-5/+10
| | | | | | GRStmtNodeBuilder and is now responsible for adding its own nodes to the graph. llvm-svn: 47923
* Added preliminary transfer function support for references.Ted Kremenek2008-03-041-1/+1
| | | | llvm-svn: 47912
* Enhanced pretty-printing of undefined-argument errors.Ted Kremenek2008-03-041-8/+36
| | | | llvm-svn: 47873
* Added extra check for calls to functions where we pass undefined valuesTed Kremenek2008-02-291-0/+5
| | | | | | as arguments. llvm-svn: 47778
* Add checks for function calls via a function pointer that is NULL, Undefined,Ted Kremenek2008-02-291-0/+5
| | | | | | or otherwise a constant integer value that doesn't evaluate to an address. llvm-svn: 47774
* Added simple hack to reduce redundant warnings from the checker:Ted Kremenek2008-02-281-0/+14
| | | | | | | | | 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. llvm-svn: 47727
* Added checking for undefined results of '<<' and '>>' (shifting by too many ↵Ted Kremenek2008-02-281-0/+5
| | | | | | | | bits, etc.) This current implementation only works when both operands are concrete values; later we will add support for symbolic values. llvm-svn: 47726
* Merged ValueState and ValueStateImpl into just ValueState, with ↵Ted Kremenek2008-02-281-5/+3
| | | | | | GRExprEngine::StateTy just becoming ValueState*. llvm-svn: 47714
* Renamed "Uninitialized" -> "Undefined" in path-sensitive value tracking engine.Ted Kremenek2008-02-281-7/+7
| | | | llvm-svn: 47713
* Fixed use of an uninitialized variable.Ted Kremenek2008-02-271-1/+1
| | | | llvm-svn: 47691
* Added string "[CHECKER]" to the output diagnostics produced by the ↵Ted Kremenek2008-02-271-0/+5
| | | | | | GRSimpleVals analysis. llvm-svn: 47678
* Header file cleanups: reduce number of includes; move ValueState.h into ↵Ted Kremenek2008-02-271-1/+1
| | | | | | include directory tree. llvm-svn: 47661
* Added boilerplate for plug-in transfer function support for CallExprs.Ted Kremenek2008-02-261-0/+25
| | | | | | GRSimpleVals performs the following action: invalidate all values passed-by-reference. llvm-svn: 47638
* Removed static analysis-specific diagnostics from DiagnosticKinds.def.Ted Kremenek2008-02-261-11/+43
| | | | | | | Use custom diagnostics for static analysis checkers. Added warnings for dereferencing uninitialized values and divide-by-zeroes. llvm-svn: 47626
* Punt on unifying symbolic lvalues. This won't be needed for many checkers.Ted Kremenek2008-02-221-6/+12
| | | | llvm-svn: 47489
* Added "assumption" logic for lval::FuncVal and lval::GotoLabel, and simplifiedTed Kremenek2008-02-221-13/+6
| | | | | | assumption logic for lval::DeclVal. llvm-svn: 47466
* Remove incorrect casts from UnknownVal to NonLVal.Ted Kremenek2008-02-211-2/+2
| | | | llvm-svn: 47446
* Simplified and generalized transfer function logic for casts, allowingTed Kremenek2008-02-211-9/+7
| | | | | | | | | the transfer function to be invoked without an Expr* for the Cast operation. Added implicit promotions to the transfer function logic for compound assignments. llvm-svn: 47444
* Major cleanup of path-sensitive analysis engine and the current analysisTed Kremenek2008-02-211-163/+129
| | | | | | | | | | | | | | | | based on constant. prop. and limited symbolics. - Renamed class: RValue -> RVal, LValue -> LVal, etc. - Minor method renamings and interface cleanups. - Tightened the RVal "type system" so that UninitializedVal and UnknownVal cannot be cast to LVal or NonLVal. This forces these corner cases values to be explicitly handled early before being dispatched to plug-in transfer function logic. - Major cleanup in the transfer function logic for binary and unary operators. Still fixing some regressions, but we now explicitly handle Uninitialized and Unknown values in a more rigorous way. llvm-svn: 47441
* Implemented transfer function logic for unary '+'Ted Kremenek2008-02-201-0/+14
| | | | llvm-svn: 47357
* Fixed bug classof() bug with RValues that could cause an UninitializedValTed Kremenek2008-02-191-1/+1
| | | | | | or UnknownVal to be interpreted as an actual NonLValue/LValue. llvm-svn: 47304
* --grsimple now reports the number of nodes in the ExplodedGraph forTed Kremenek2008-02-191-5/+7
| | | | | | | | | an analyzed function. GRExprEngine now records stores to "uninitialized lvalues" (which are sinks in the ExplodedGraph). llvm-svn: 47293
* Added more assertions and checks in transfer function logic to check forTed Kremenek2008-02-181-6/+25
| | | | | | UninitializedVals and UnknownVals. llvm-svn: 47288
* Temporary solution to push analysis through to analyzing PCRE.Ted Kremenek2008-02-181-2/+4
| | | | | | We will implement symbol "unification" later. llvm-svn: 47284
* A couple of msvc compile fixes from the ml; I haven't tested with msvc, Eli Friedman2008-02-161-2/+2
| | | | | | but the fixes are reasonable. llvm-svn: 47224
* Refactored code for transfer functions for binary operators involving two ↵Ted Kremenek2008-02-151-0/+18
| | | | | | | | | | | | LValues. Fixed bug in transfer functions for sizeof(*); we were incorrectly evaluating to a value of the wrong type. Fixed bug in transfer functions for compound assignments where we did not properly handle assignments involving dereferences of symbolic values. llvm-svn: 47190
* Added boilerplate transfer function support for pointer arithmetic operations.Ted Kremenek2008-02-151-0/+9
| | | | llvm-svn: 47147
* Added --grsimple-view option to clang driver; this is the same asTed Kremenek2008-02-151-2/+2
| | | | | | | | --grsimple except that it visualizes the ExplodedGraph using dot and outputs the current function being analyzed. --grsimple is now silent except when it emits diagnostics. llvm-svn: 47146
* Don't analyze functions when we have parse errors.Ted Kremenek2008-02-141-0/+3
| | | | llvm-svn: 47139
* Renamed GRConstants => GRSimpleVals.Ted Kremenek2008-02-141-0/+30
| | | | | | Moved driver logic for --grsimple to GRSimpleVals.cpp. llvm-svn: 47137
* Migrated transfer functions for binary operators for simple value trackingTed Kremenek2008-02-141-0/+158
| | | | | | from RValues to GRTransferFuncs/GRSimpleVals. llvm-svn: 47131
* Migrated transfer functions for unary "~" and "-" to ↵Ted Kremenek2008-02-141-1/+23
| | | | | | GRTransferFuncs/GRSimpleVals. llvm-svn: 47126
* Started partitioning of transfer function logic (and thus the policy behind Ted Kremenek2008-02-141-0/+59
these operations) into GRTransferFuncs and its subclasses. Originally all of this logic was handled by the class RValue, but in reality different analyses will want more flexibility on how they evaluate different values. Transfer functions migrated so far: "Cast" llvm-svn: 47125
OpenPOWER on IntegriCloud