aboutsummaryrefslogtreecommitdiff
path: root/Analysis
AgeCommit message (Collapse)Author
2008-02-21Regression fix: Handle pointer arithmetic in unary ++/--.Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47449 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-21Removed bogus assertions regard LValues binding to UnknownVal; they canTed Kremenek
do so implicitly. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47447 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-21Remove incorrect casts from UnknownVal to NonLVal.Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47446 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-21FIX: Promote the correct operand.Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47445 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-21Simplified and generalized transfer function logic for casts, allowingTed Kremenek
the transfer function to be invoked without an Expr* for the Cast operation. Added implicit promotions to the transfer function logic for compound assignments. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47444 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-21Added transfer function support for sizeof(void)Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47443 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-21Major cleanup of path-sensitive analysis engine and the current analysisTed Kremenek
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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47441 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-20Implemented transfer function logic for unary '+'Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47357 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-20Placed transfer function logic for dereferences in its own method, while atTed Kremenek
the same time clearing up some logic of how the unary '*' operator is processed. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47356 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-19Added missing case in constant propagation logic for handling the Xor ofTed Kremenek
two concrete integer values. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47341 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-19Added special handling for UninitializedVals for the transfer function logicTed Kremenek
for pointer dereferences. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47340 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-19Implemented "getType()" for symbolic values representing the "contents" ofTed Kremenek
another symbolic value. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47339 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-19Fixed transfer function for casts to always evaluate the effects of theTed Kremenek
cast's subexpression even if the cast itself has no effect. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47335 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-19Added transfer function support for casting to "void".Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47333 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-19Fixed bug classof() bug with RValues that could cause an UninitializedValTed Kremenek
or UnknownVal to be interpreted as an actual NonLValue/LValue. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47304 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-19Added back explicit state/node creation when visiting IntegerLiterals andTed Kremenek
CharacterLiterals. This may not be a permanent solution; it doesn't cost that much, however, to create a few additional states, and solves a whole bunch of edge cases when handling ?, ||, and &&. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47299 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-19Added boilerplate transfer function support for CallExprs.Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47298 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-19Added FIXME for properly handling local arrays using symbolic LValues.Ted Kremenek
For now we just treat their values as "Unknown." git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47294 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-19--grsimple now reports the number of nodes in the ExplodedGraph forTed Kremenek
an analyzed function. GRExprEngine now records stores to "uninitialized lvalues" (which are sinks in the ExplodedGraph). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47293 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-18Added more assertions and checks in transfer function logic to check forTed Kremenek
UninitializedVals and UnknownVals. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47288 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-18Temporary solution to push analysis through to analyzing PCRE.Ted Kremenek
We will implement symbol "unification" later. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47284 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-16A couple of msvc compile fixes from the ml; I haven't tested with msvc, Eli Friedman
but the fixes are reasonable. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47224 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-16Further cleanup. Moved definitions for SymbolManager and ValueManager intoTed Kremenek
their own [.cpp;.h] files. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47201 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-15Refactored code for transfer functions for binary operators involving two ↵Ted Kremenek
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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47190 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-15Added transfer function support for conditional branches with a NULL ↵Ted Kremenek
condition (e.g., "for(;;)"). Fixed bug in transfer function for compound assignment operators when both operands where variables but had a non-pointer type (we fired an assertion). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47184 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-15Simplified transfer function logic for ++/-- operators.Ted Kremenek
Added more boilerplate transfer function support for pointer arithmetic. Added more pretty-printing support for symbolic constraints. Added transfer function support for handling enum values. Minor pointer types cleanup in ExplodedGraphImpl. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47183 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-15Remove unnecessary references to VariableArrayType from Analysis.Eli Friedman
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47157 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-15Added boilerplate transfer function support for pointer arithmetic operations.Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47147 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-15Added --grsimple-view option to clang driver; this is the same asTed Kremenek
--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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47146 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-14Added "symbol iterators" for RValues, allowing easy iteration over the symbolsTed Kremenek
referenced by an RValue, instead of having to query the type of the RValue. Modified ValueState::RemoveDeadBindings to also prune dead symbols. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47142 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-14When visualizing ExplodedNodes created by GRExprEngine, color nodes withTed Kremenek
null-dereferences or bad control-flow red. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47140 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-14Don't analyze functions when we have parse errors.Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47139 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-14Renamed GRConstants => GRSimpleVals.Ted Kremenek
Moved driver logic for --grsimple to GRSimpleVals.cpp. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47137 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-14#include cleanups in GRExprEngine.cpp/GRExprEngine.h. Moved GRExprEngine toTed Kremenek
clang namespace. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47136 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-14Partitioned definition/implementation of GRExperEngine into .h and .cpp.Ted Kremenek
Still some cleanup to do, but this initial checkin compiles and runs correctly. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47135 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-14Migrated transfer functions for binary operators for simple value trackingTed Kremenek
from RValues to GRTransferFuncs/GRSimpleVals. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47131 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-14Migrated transfer functions for unary "~" and "-" to ↵Ted Kremenek
GRTransferFuncs/GRSimpleVals. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47126 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-14Started partitioning of transfer function logic (and thus the policy behind Ted Kremenek
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" git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47125 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-14Moved Rvalues.h from "Analysis/" to "include/clang/Analysis/PathSensitive".Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47123 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-13Added support to GRCoreEngine/GRExprEngine for processing control-flowTed Kremenek
from switch...case...default statements. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47100 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-13Fixed 80 col violations.Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47076 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-13Unbreak the build.Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47072 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-13Renamed files to match class renaming in r47070:Ted Kremenek
http://llvm.org/viewvc/llvm-project?rev=47070&view=rev git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47071 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-13Renamed class GREngine => GRCoreEngine.Ted Kremenek
Renamed class GRConstants => GRExprEngine. This was done with a Perl script, and will result in 80 col. violations that I will gradually fix up. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47070 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-13Simplify GRIndirectGotoNodeBuilder.Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47068 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-13Added GREngine support for "break" and "continue".Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47064 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-13Added support to GREngine/GRConstants for handling computed gotos.Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47038 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-12Added GREngine support for GotoStmt.Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47034 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-12Added transfer function/value track logic for taking the address of a label.Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47030 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-12Minor (cosmetic) reshuffling of code. Fixed a bug in "Assume" logic whenTed Kremenek
handling Non-Lvalues of the type nonlval::SymbolVal; we were accidentally casting them to lval::SymbolVal. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47029 91177308-0d34-0410-b5e6-96231b3b80d8