Ted Kremenek | d59cccc | 2008-02-14 18:28:23 +0000 | [diff] [blame] | 1 | // GRSimpleVals.h - Transfer functions for tracking simple values -*- C++ -*--// |
| 2 | // |
| 3 | // The LLVM Compiler Infrastructure |
| 4 | // |
| 5 | // This file is distributed under the University of Illinois Open Source |
| 6 | // License. See LICENSE.TXT for details. |
| 7 | // |
| 8 | //===----------------------------------------------------------------------===// |
| 9 | // |
| 10 | // This files defines GRSimpleVals, a sub-class of GRTransferFuncs that |
| 11 | // provides transfer functions for performing simple value tracking with |
| 12 | // limited support for symbolics. |
| 13 | // |
| 14 | //===----------------------------------------------------------------------===// |
| 15 | |
| 16 | #ifndef LLVM_CLANG_ANALYSIS_GRSIMPLEVALS |
| 17 | #define LLVM_CLANG_ANALYSIS_GRSIMPLEVALS |
| 18 | |
| 19 | #include "clang/Analysis/PathSensitive/GRTransferFuncs.h" |
Ted Kremenek | e01c987 | 2008-02-14 22:36:46 +0000 | [diff] [blame] | 20 | #include "clang/Analysis/PathSensitive/GRExprEngine.h" |
Ted Kremenek | d59cccc | 2008-02-14 18:28:23 +0000 | [diff] [blame] | 21 | |
| 22 | namespace clang { |
| 23 | |
| 24 | class GRSimpleVals : public GRTransferFuncs { |
| 25 | public: |
| 26 | GRSimpleVals() {} |
| 27 | virtual ~GRSimpleVals() {} |
| 28 | |
Ted Kremenek | c3f261d | 2008-02-14 18:40:24 +0000 | [diff] [blame] | 29 | // Casts. |
| 30 | |
Ted Kremenek | d59cccc | 2008-02-14 18:28:23 +0000 | [diff] [blame] | 31 | virtual RValue EvalCast(ValueManager& ValMgr, NonLValue V, Expr* CastExpr); |
| 32 | virtual RValue EvalCast(ValueManager& ValMgr, LValue V, Expr* CastExpr); |
Ted Kremenek | c3f261d | 2008-02-14 18:40:24 +0000 | [diff] [blame] | 33 | |
| 34 | // Unary Operators. |
| 35 | |
| 36 | virtual NonLValue EvalMinus(ValueManager& ValMgr, UnaryOperator* U, |
| 37 | NonLValue X); |
| 38 | |
| 39 | virtual NonLValue EvalComplement(ValueManager& ValMgr, NonLValue X); |
Ted Kremenek | 6cb0b54 | 2008-02-14 19:37:24 +0000 | [diff] [blame] | 40 | |
| 41 | // Binary Operators. |
| 42 | |
| 43 | virtual NonLValue EvalBinaryOp(ValueManager& ValMgr, |
| 44 | BinaryOperator::Opcode Op, |
| 45 | NonLValue LHS, NonLValue RHS); |
| 46 | |
Ted Kremenek | b640b3b | 2008-02-15 00:52:26 +0000 | [diff] [blame^] | 47 | // Pointer arithmetic. |
| 48 | |
| 49 | virtual LValue EvalBinaryOp(ValueManager& ValMgr, BinaryOperator::Opcode Op, |
| 50 | LValue LHS, NonLValue RHS); |
| 51 | |
Ted Kremenek | 6cb0b54 | 2008-02-14 19:37:24 +0000 | [diff] [blame] | 52 | // Equality operators for LValues. |
| 53 | virtual NonLValue EvalEQ(ValueManager& ValMgr, LValue LHS, LValue RHS); |
| 54 | virtual NonLValue EvalNE(ValueManager& ValMgr, LValue LHS, LValue RHS); |
Ted Kremenek | d59cccc | 2008-02-14 18:28:23 +0000 | [diff] [blame] | 55 | }; |
| 56 | |
| 57 | |
| 58 | } // end clang namespace |
| 59 | |
| 60 | #endif |