blob: 3716ed9691096891bedfbcfff4cbba4a9cf41731 [file] [log] [blame]
Ted Kremenekd59cccc2008-02-14 18:28:23 +00001//== GRTransferFuncs.cpp - Path-Sens. Transfer Functions Interface -*- 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 GRTransferFuncs, which provides a base-class that
11// defines an interface for transfer functions used by GRExprEngine.
12//
13//===----------------------------------------------------------------------===//
14
15#include "clang/Analysis/PathSensitive/GRTransferFuncs.h"
16
17using namespace clang;
18
19//===----------------------------------------------------------------------===//
20// Transfer function for Casts.
21//===----------------------------------------------------------------------===//
22
23RValue GRTransferFuncs::EvalCast(ValueManager& ValMgr, RValue X,
24 Expr* CastExpr) {
25
26 switch (X.getBaseKind()) {
27 default:
28 assert(false && "Invalid RValue."); break;
29
30 case RValue::LValueKind:
31 return EvalCast(ValMgr, cast<LValue>(X), CastExpr);
32
33 case RValue::NonLValueKind:
34 return EvalCast(ValMgr, cast<NonLValue>(X), CastExpr);
35
36 case RValue::UninitializedKind:
37 case RValue::UnknownKind: break;
38 }
39
40 return X;
41}