Skip to content
GRSimpleVals.h 2.66 KiB
Newer Older
// GRSimpleVals.h - Transfer functions for tracking simple values -*- C++ -*--//
//
//                     The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
//
Gabor Greif's avatar
Gabor Greif committed
//  This file defines GRSimpleVals, a sub-class of GRTransferFuncs that
//  provides transfer functions for performing simple value tracking with
//  limited support for symbolics.
//
//===----------------------------------------------------------------------===//

#ifndef LLVM_CLANG_ANALYSIS_GRSIMPLEVALS
#define LLVM_CLANG_ANALYSIS_GRSIMPLEVALS

#include "clang/Analysis/PathSensitive/GRTransferFuncs.h"
#include "clang/Analysis/PathSensitive/GRExprEngine.h"
class GRSimpleVals : public GRTransferFuncs {
  virtual SVal DetermEvalBinOpNN(GRExprEngine& Eng,
public:
  GRSimpleVals() {}
  virtual ~GRSimpleVals() {}
  
  virtual SVal EvalCast(GRExprEngine& Engine, NonLoc V, QualType CastT);
  virtual SVal EvalCast(GRExprEngine& Engine, Loc V, QualType CastT);
  virtual SVal EvalMinus(GRExprEngine& Engine, UnaryOperator* U, NonLoc X);
  virtual SVal EvalComplement(GRExprEngine& Engine, NonLoc X);
  virtual SVal EvalBinOp(GRExprEngine& Engine, BinaryOperator::Opcode Op,
                         Loc L, Loc R);
  virtual SVal EvalBinOp(GRExprEngine& Engine, BinaryOperator::Opcode Op,
                         Loc L, NonLoc R);  
  virtual void EvalCall(ExplodedNodeSet<GRState>& Dst,
                        GRExprEngine& Engine,
                        GRStmtNodeBuilder<GRState>& Builder,
                        ExplodedNode<GRState>* Pred);
  virtual void EvalObjCMessageExpr(ExplodedNodeSet<GRState>& Dst,
                                   GRStmtNodeBuilder<GRState>& Builder,
                                   ExplodedNode<GRState>* Pred);
  static void GeneratePathDiagnostic(PathDiagnostic& PD, ASTContext& Ctx,
                                     ExplodedNode<GRState>* N);
  SVal EvalEQ(GRExprEngine& Engine, Loc L, Loc R);
  SVal EvalNE(GRExprEngine& Engine, Loc L, Loc R);