From c35afac49b59fab490b8a369420c76cfff3d72fa Mon Sep 17 00:00:00 2001 From: Daniel Dunbar Date: Thu, 4 Jun 2009 05:18:31 +0000 Subject: Use cast<> instead of static_ref_cast. git-svn-id: https://llvm.org/svn/llvm-project/klee/trunk@72845 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Solver/FastCexSolver.cpp | 20 +++++++++--------- lib/Solver/STPBuilder.cpp | 50 ++++++++++++++++++++++---------------------- 2 files changed, 35 insertions(+), 35 deletions(-) (limited to 'lib/Solver') diff --git a/lib/Solver/FastCexSolver.cpp b/lib/Solver/FastCexSolver.cpp index ee46be4f..cc0068ca 100644 --- a/lib/Solver/FastCexSolver.cpp +++ b/lib/Solver/FastCexSolver.cpp @@ -410,7 +410,7 @@ public: case Expr::NotOptimized: break; case Expr::Read: { - ReadExpr *re = static_ref_cast(e); + ReadExpr *re = cast(e); const Array *array = re->updates.root; CexObjectData &cod = objectValues.find(array->id)->second; @@ -435,7 +435,7 @@ public: } case Expr::Select: { - SelectExpr *se = static_ref_cast(e); + SelectExpr *se = cast(e); ValueRange cond = evalRangeForExpr(se->cond); if (cond.isFixed()) { if (cond.min()) { @@ -482,7 +482,7 @@ public: // the extraction a byte at a time, then checking the evaluated // value, isolating for that range, and continuing. case Expr::Concat: { - ConcatExpr *ce = static_ref_cast(e); + ConcatExpr *ce = cast(e); if (ce->is2ByteConcat()) { forceExprToRange(ce->getKid(0), range.extract( 8, 16)); forceExprToRange(ce->getKid(1), range.extract( 0, 8)); @@ -521,7 +521,7 @@ public: // For ZExt this simplifies to just intersection with the // possible input range. case Expr::ZExt: { - CastExpr *ce = static_ref_cast(e); + CastExpr *ce = cast(e); unsigned inBits = ce->src->getWidth(); ValueRange input = range.set_intersection(ValueRange(0, bits64::maxValueOfNBits(inBits))); forceExprToRange(ce->src, input); @@ -530,7 +530,7 @@ public: // For SExt instead of doing the intersection we just take the output range // minus the impossible values. This is nicer since it is a single interval. case Expr::SExt: { - CastExpr *ce = static_ref_cast(e); + CastExpr *ce = cast(e); unsigned inBits = ce->src->getWidth(); unsigned outBits = ce->width; ValueRange output = range.set_difference(ValueRange(1<<(inBits-1), @@ -544,7 +544,7 @@ public: // Binary case Expr::And: { - BinaryExpr *be = static_ref_cast(e); + BinaryExpr *be = cast(e); if (be->getWidth()==Expr::Bool) { if (range.isFixed()) { ValueRange left = evalRangeForExpr(be->left); @@ -575,7 +575,7 @@ public: } case Expr::Or: { - BinaryExpr *be = static_ref_cast(e); + BinaryExpr *be = cast(e); if (be->getWidth()==Expr::Bool) { if (range.isFixed()) { ValueRange left = evalRangeForExpr(be->left); @@ -611,7 +611,7 @@ public: // Comparison case Expr::Eq: { - BinaryExpr *be = static_ref_cast(e); + BinaryExpr *be = cast(e); if (range.isFixed()) { if (be->left->isConstant()) { uint64_t value = be->left->getConstantValue(); @@ -637,7 +637,7 @@ public: } case Expr::Ult: { - BinaryExpr *be = static_ref_cast(e); + BinaryExpr *be = cast(e); // XXX heuristic / lossy, what order if conflict @@ -668,7 +668,7 @@ public: break; } case Expr::Ule: { - BinaryExpr *be = static_ref_cast(e); + BinaryExpr *be = cast(e); // XXX heuristic / lossy, what order if conflict diff --git a/lib/Solver/STPBuilder.cpp b/lib/Solver/STPBuilder.cpp index d1f7360c..ee5b777b 100644 --- a/lib/Solver/STPBuilder.cpp +++ b/lib/Solver/STPBuilder.cpp @@ -464,12 +464,12 @@ ExprHandle STPBuilder::constructActual(ref e, int *width_out) { // Special case Expr::NotOptimized: { - NotOptimizedExpr *noe = static_ref_cast(e); + NotOptimizedExpr *noe = cast(e); return construct(noe->src, width_out); } case Expr::Read: { - ReadExpr *re = static_ref_cast(e); + ReadExpr *re = cast(e); *width_out = 8; return vc_readExpr(vc, getArrayForUpdate(re->updates.root, re->updates.head), @@ -477,7 +477,7 @@ ExprHandle STPBuilder::constructActual(ref e, int *width_out) { } case Expr::Select: { - SelectExpr *se = static_ref_cast(e); + SelectExpr *se = cast(e); ExprHandle cond = construct(se->cond, 0); ExprHandle tExpr = construct(se->trueExpr, width_out); ExprHandle fExpr = construct(se->falseExpr, width_out); @@ -485,7 +485,7 @@ ExprHandle STPBuilder::constructActual(ref e, int *width_out) { } case Expr::Concat: { - ConcatExpr *ce = static_ref_cast(e); + ConcatExpr *ce = cast(e); unsigned numKids = ce->getNumKids(); ExprHandle res = construct(ce->getKid(numKids-1), 0); for (int i=numKids-2; i>=0; i--) { @@ -496,7 +496,7 @@ ExprHandle STPBuilder::constructActual(ref e, int *width_out) { } case Expr::Extract: { - ExtractExpr *ee = static_ref_cast(e); + ExtractExpr *ee = cast(e); ExprHandle src = construct(ee->expr, width_out); *width_out = ee->getWidth(); if (*width_out==1) { @@ -510,7 +510,7 @@ ExprHandle STPBuilder::constructActual(ref e, int *width_out) { case Expr::ZExt: { int srcWidth; - CastExpr *ce = static_ref_cast(e); + CastExpr *ce = cast(e); ExprHandle src = construct(ce->src, &srcWidth); *width_out = ce->getWidth(); if (srcWidth==1) { @@ -522,7 +522,7 @@ ExprHandle STPBuilder::constructActual(ref e, int *width_out) { case Expr::SExt: { int srcWidth; - CastExpr *ce = static_ref_cast(e); + CastExpr *ce = cast(e); ExprHandle src = construct(ce->src, &srcWidth); *width_out = ce->getWidth(); if (srcWidth==1) { @@ -535,7 +535,7 @@ ExprHandle STPBuilder::constructActual(ref e, int *width_out) { // Arithmetic case Expr::Add: { - AddExpr *ae = static_ref_cast(e); + AddExpr *ae = cast(e); ExprHandle left = construct(ae->left, width_out); ExprHandle right = construct(ae->right, width_out); assert(*width_out!=1 && "uncanonicalized add"); @@ -543,7 +543,7 @@ ExprHandle STPBuilder::constructActual(ref e, int *width_out) { } case Expr::Sub: { - SubExpr *se = static_ref_cast(e); + SubExpr *se = cast(e); ExprHandle left = construct(se->left, width_out); ExprHandle right = construct(se->right, width_out); assert(*width_out!=1 && "uncanonicalized sub"); @@ -551,7 +551,7 @@ ExprHandle STPBuilder::constructActual(ref e, int *width_out) { } case Expr::Mul: { - MulExpr *me = static_ref_cast(e); + MulExpr *me = cast(e); ExprHandle right = construct(me->right, width_out); assert(*width_out!=1 && "uncanonicalized mul"); @@ -565,7 +565,7 @@ ExprHandle STPBuilder::constructActual(ref e, int *width_out) { } case Expr::UDiv: { - UDivExpr *de = static_ref_cast(e); + UDivExpr *de = cast(e); ExprHandle left = construct(de->left, width_out); assert(*width_out!=1 && "uncanonicalized udiv"); @@ -587,7 +587,7 @@ ExprHandle STPBuilder::constructActual(ref e, int *width_out) { } case Expr::SDiv: { - SDivExpr *de = static_ref_cast(e); + SDivExpr *de = cast(e); ExprHandle left = construct(de->left, width_out); assert(*width_out!=1 && "uncanonicalized sdiv"); @@ -607,7 +607,7 @@ ExprHandle STPBuilder::constructActual(ref e, int *width_out) { } case Expr::URem: { - URemExpr *de = static_ref_cast(e); + URemExpr *de = cast(e); ExprHandle left = construct(de->left, width_out); assert(*width_out!=1 && "uncanonicalized urem"); @@ -643,7 +643,7 @@ ExprHandle STPBuilder::constructActual(ref e, int *width_out) { } case Expr::SRem: { - SRemExpr *de = static_ref_cast(e); + SRemExpr *de = cast(e); ExprHandle left = construct(de->left, width_out); ExprHandle right = construct(de->right, width_out); assert(*width_out!=1 && "uncanonicalized srem"); @@ -671,7 +671,7 @@ ExprHandle STPBuilder::constructActual(ref e, int *width_out) { // Binary case Expr::And: { - AndExpr *ae = static_ref_cast(e); + AndExpr *ae = cast(e); ExprHandle left = construct(ae->left, width_out); ExprHandle right = construct(ae->right, width_out); if (*width_out==1) { @@ -681,7 +681,7 @@ ExprHandle STPBuilder::constructActual(ref e, int *width_out) { } } case Expr::Or: { - OrExpr *oe = static_ref_cast(e); + OrExpr *oe = cast(e); ExprHandle left = construct(oe->left, width_out); ExprHandle right = construct(oe->right, width_out); if (*width_out==1) { @@ -692,7 +692,7 @@ ExprHandle STPBuilder::constructActual(ref e, int *width_out) { } case Expr::Xor: { - XorExpr *xe = static_ref_cast(e); + XorExpr *xe = cast(e); ExprHandle left = construct(xe->left, width_out); ExprHandle right = construct(xe->right, width_out); @@ -706,7 +706,7 @@ ExprHandle STPBuilder::constructActual(ref e, int *width_out) { } case Expr::Shl: { - ShlExpr *se = static_ref_cast(e); + ShlExpr *se = cast(e); ExprHandle left = construct(se->left, width_out); assert(*width_out!=1 && "uncanonicalized shl"); @@ -720,7 +720,7 @@ ExprHandle STPBuilder::constructActual(ref e, int *width_out) { } case Expr::LShr: { - LShrExpr *lse = static_ref_cast(e); + LShrExpr *lse = cast(e); ExprHandle left = construct(lse->left, width_out); unsigned shiftBits = getShiftBits(*width_out); assert(*width_out!=1 && "uncanonicalized lshr"); @@ -735,7 +735,7 @@ ExprHandle STPBuilder::constructActual(ref e, int *width_out) { } case Expr::AShr: { - AShrExpr *ase = static_ref_cast(e); + AShrExpr *ase = cast(e); ExprHandle left = construct(ase->left, width_out); assert(*width_out!=1 && "uncanonicalized ashr"); @@ -753,7 +753,7 @@ ExprHandle STPBuilder::constructActual(ref e, int *width_out) { // Comparison case Expr::Eq: { - EqExpr *ee = static_ref_cast(e); + EqExpr *ee = cast(e); ExprHandle left = construct(ee->left, width_out); ExprHandle right = construct(ee->right, width_out); if (*width_out==1) { @@ -770,7 +770,7 @@ ExprHandle STPBuilder::constructActual(ref e, int *width_out) { } case Expr::Ult: { - UltExpr *ue = static_ref_cast(e); + UltExpr *ue = cast(e); ExprHandle left = construct(ue->left, width_out); ExprHandle right = construct(ue->right, width_out); assert(*width_out!=1 && "uncanonicalized ult"); @@ -779,7 +779,7 @@ ExprHandle STPBuilder::constructActual(ref e, int *width_out) { } case Expr::Ule: { - UleExpr *ue = static_ref_cast(e); + UleExpr *ue = cast(e); ExprHandle left = construct(ue->left, width_out); ExprHandle right = construct(ue->right, width_out); assert(*width_out!=1 && "uncanonicalized ule"); @@ -788,7 +788,7 @@ ExprHandle STPBuilder::constructActual(ref e, int *width_out) { } case Expr::Slt: { - SltExpr *se = static_ref_cast(e); + SltExpr *se = cast(e); ExprHandle left = construct(se->left, width_out); ExprHandle right = construct(se->right, width_out); assert(*width_out!=1 && "uncanonicalized slt"); @@ -797,7 +797,7 @@ ExprHandle STPBuilder::constructActual(ref e, int *width_out) { } case Expr::Sle: { - SleExpr *se = static_ref_cast(e); + SleExpr *se = cast(e); ExprHandle left = construct(se->left, width_out); ExprHandle right = construct(se->right, width_out); assert(*width_out!=1 && "uncanonicalized sle"); -- cgit 1.4.1