@@ -367,14 +367,17 @@ void IntOpGen::generateArithOps(std::stringstream &s) const {
367
367
const auto intBuiltinOp = new BuiltinOp<IntOp::attrT>(IntOp::intAttrFunc);
368
368
const auto uninterpretedOp = new UninterpretedOp ();
369
369
const std::vector<IntOpGen::IntArithOp> intArithOpTable{
370
- {" add" , 2 , new InlinedOp<IntOp::exprT>(
371
- IntOpGen::IntArithOp::intArithExpr<BinExpr::Plus>),
370
+ {" add" , 2 ,
371
+ new InlinedOp<IntOp::exprT>(
372
+ IntOpGen::IntArithOp::intArithExpr<BinExpr::Plus>),
372
373
bvBuiltinOp, true },
373
- {" sub" , 2 , new InlinedOp<IntOp::exprT>(
374
- IntOpGen::IntArithOp::intArithExpr<BinExpr::Minus>),
374
+ {" sub" , 2 ,
375
+ new InlinedOp<IntOp::exprT>(
376
+ IntOpGen::IntArithOp::intArithExpr<BinExpr::Minus>),
375
377
bvBuiltinOp, true },
376
- {" mul" , 2 , new InlinedOp<IntOp::exprT>(
377
- IntOpGen::IntArithOp::intArithExpr<BinExpr::Times>),
378
+ {" mul" , 2 ,
379
+ new InlinedOp<IntOp::exprT>(
380
+ IntOpGen::IntArithOp::intArithExpr<BinExpr::Times>),
378
381
bvBuiltinOp, true },
379
382
{" sdiv" , 2 , intBuiltinOp, bvBuiltinOp, false },
380
383
{" smod" , 2 , intBuiltinOp, bvBuiltinOp, false },
@@ -874,9 +877,9 @@ void MemDeclGen::generateGlobalAllocations(std::stringstream &s) const {
874
877
875
878
std::list<const Stmt *> stmts;
876
879
for (auto E : prelude.rep .globalAllocations )
877
- stmts.push_back (Stmt::call (
878
- " $galloc" ,
879
- {prelude. rep . expr (E. first ), prelude.rep .pointerLit (E.second )}));
880
+ stmts.push_back (
881
+ Stmt::call ( " $galloc" , {prelude. rep . expr (E. first ) ,
882
+ prelude.rep .pointerLit (E.second )}));
880
883
s << Decl::procedure (" $global_allocations" , {}, {}, {},
881
884
{Block::block (" " , stmts)})
882
885
<< " \n " ;
@@ -924,9 +927,8 @@ void PtrOpGen::generatePreds(std::stringstream &s) const {
924
927
indexedName (pred, {Naming::PTR_TYPE}),
925
928
{{" p1" , Naming::PTR_TYPE}, {" p2" , Naming::PTR_TYPE}},
926
929
prelude.rep .intType (1 ),
927
- Expr::cond (Expr::fn (indexedName (pred,
928
- {prelude.rep .pointerType (),
929
- Naming::BOOL_TYPE}),
930
+ Expr::cond (Expr::fn (indexedName (pred, {prelude.rep .pointerType (),
931
+ Naming::BOOL_TYPE}),
930
932
{Expr::id (" p1" ), Expr::id (" p2" )}),
931
933
prelude.rep .integerLit (1LL , 1 ),
932
934
prelude.rep .integerLit (0LL , 1 )),
@@ -1449,9 +1451,10 @@ void FpOpGen::generateMemOps(std::stringstream &s) const {
1449
1451
// e.g., function {:inline} $load.unsafe.bvhalf(M: [ref] i8, p: ref)
1450
1452
// returns (bvhalf) { $bitcast.i16.bvhalf($load.i16(M, p)) }
1451
1453
s << prelude.unsafeLoad (
1452
- type, Expr::fn (indexedName (" $bitcast" , {intType, type}),
1453
- Expr::fn (indexedName (" $load" , {intType}),
1454
- makeMapVarExpr (0 ), makePtrVarExpr (0 ))),
1454
+ type,
1455
+ Expr::fn (indexedName (" $bitcast" , {intType, type}),
1456
+ Expr::fn (indexedName (" $load" , {intType}),
1457
+ makeMapVarExpr (0 ), makePtrVarExpr (0 ))),
1455
1458
false )
1456
1459
<< " \n " ;
1457
1460
// e.g., function {:inline} $store.unsafe.bvfloat(M: [ref] i8, p: ref,
@@ -1488,10 +1491,9 @@ void FpOpGen::generateMemOps(std::stringstream &s) const {
1488
1491
// function {:inline} $store.bytes.float(M: [ref] bv8, p: ref, f: float)
1489
1492
// returns ([ref] bv8) { M[p := $bitcast.float.bv8(f)] }
1490
1493
s << prelude.unsafeStore (
1491
- binding,
1492
- prelude.mapUpdExpr (
1493
- 0 , Expr::fn (indexedName (" $bitcast" , {type, bvType}),
1494
- makeFpVarExpr (0 ))))
1494
+ binding, prelude.mapUpdExpr (
1495
+ 0 , Expr::fn (indexedName (" $bitcast" , {type, bvType}),
1496
+ makeFpVarExpr (0 ))))
1495
1497
<< " \n " ;
1496
1498
} else {
1497
1499
std::string intType = getIntTypeName (8 );
0 commit comments