blob: b00dd3ca39d69a1100c41188e6ea8f67616e59ce [file] [log] [blame]
Ted Kremenekd59cccc2008-02-14 18:28:23 +00001// 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 Kremeneke01c9872008-02-14 22:36:46 +000020#include "clang/Analysis/PathSensitive/GRExprEngine.h"
Ted Kremenekd59cccc2008-02-14 18:28:23 +000021
22namespace clang {
23
24class GRSimpleVals : public GRTransferFuncs {
25public:
26 GRSimpleVals() {}
27 virtual ~GRSimpleVals() {}
28
Ted Kremenekc3f261d2008-02-14 18:40:24 +000029 // Casts.
30
Ted Kremenekd59cccc2008-02-14 18:28:23 +000031 virtual RValue EvalCast(ValueManager& ValMgr, NonLValue V, Expr* CastExpr);
32 virtual RValue EvalCast(ValueManager& ValMgr, LValue V, Expr* CastExpr);
Ted Kremenekc3f261d2008-02-14 18:40:24 +000033
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 Kremenek6cb0b542008-02-14 19:37:24 +000040
41 // Binary Operators.
42
43 virtual NonLValue EvalBinaryOp(ValueManager& ValMgr,
44 BinaryOperator::Opcode Op,
45 NonLValue LHS, NonLValue RHS);
46
Ted Kremenekb640b3b2008-02-15 00:52:26 +000047 // Pointer arithmetic.
48
49 virtual LValue EvalBinaryOp(ValueManager& ValMgr, BinaryOperator::Opcode Op,
50 LValue LHS, NonLValue RHS);
51
Ted Kremenek6cb0b542008-02-14 19:37:24 +000052 // 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 Kremenekd59cccc2008-02-14 18:28:23 +000055};
56
57
58} // end clang namespace
59
60#endif