blob: 870166e8f4b75849475a257d54880e4e17852c88 [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 Kremenek9ef1ec92008-02-21 18:43:30 +000031 virtual RVal EvalCast(ValueManager& ValMgr, NonLVal V, QualType CastT);
32 virtual RVal EvalCast(ValueManager& ValMgr, LVal V, QualType CastT);
Ted Kremenekc3f261d2008-02-14 18:40:24 +000033
34 // Unary Operators.
35
Ted Kremenekaa1c4e52008-02-21 18:02:17 +000036 virtual RVal EvalMinus(ValueManager& ValMgr, UnaryOperator* U, NonLVal X);
37
38 virtual RVal EvalComplement(ValueManager& ValMgr, NonLVal X);
Ted Kremenek6cb0b542008-02-14 19:37:24 +000039
40 // Binary Operators.
41
Ted Kremenekaa1c4e52008-02-21 18:02:17 +000042 virtual RVal EvalBinOp(ValueManager& ValMgr, BinaryOperator::Opcode Op,
43 NonLVal L, NonLVal R);
Ted Kremenek6cb0b542008-02-14 19:37:24 +000044
Ted Kremenekaa1c4e52008-02-21 18:02:17 +000045 virtual RVal EvalBinOp(ValueManager& ValMgr, BinaryOperator::Opcode Op,
46 LVal L, LVal R);
Ted Kremenekc6fbdcd2008-02-15 23:15:23 +000047
Ted Kremenekb640b3b2008-02-15 00:52:26 +000048 // Pointer arithmetic.
49
Ted Kremenekaa1c4e52008-02-21 18:02:17 +000050 virtual RVal EvalBinOp(ValueManager& ValMgr, BinaryOperator::Opcode Op,
51 LVal L, NonLVal R);
Ted Kremenekb640b3b2008-02-15 00:52:26 +000052
Ted Kremenekc6fbdcd2008-02-15 23:15:23 +000053protected:
Ted Kremenekd59cccc2008-02-14 18:28:23 +000054
Ted Kremenekaa1c4e52008-02-21 18:02:17 +000055 // Equality operators for LVals.
56
57 RVal EvalEQ(ValueManager& ValMgr, LVal L, LVal R);
58 RVal EvalNE(ValueManager& ValMgr, LVal L, LVal R);
59};
Ted Kremenekd59cccc2008-02-14 18:28:23 +000060
61} // end clang namespace
62
63#endif