Skip to content

Commit

Permalink
clang format
Browse files Browse the repository at this point in the history
  • Loading branch information
keram88 committed Oct 19, 2024
1 parent e04fceb commit f18245d
Show file tree
Hide file tree
Showing 5 changed files with 189 additions and 131 deletions.
8 changes: 5 additions & 3 deletions examples/equivalence/trunc.c
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
#include "smack.h"

double c_trunc(double x)
{
union {double f; unsigned long i;} u = {x};
double c_trunc(double x) {
union {
double f;
unsigned long i;
} u = {x};
__VERIFIER_equiv_store_unsigned_long(u.i, 0);
int e = (int)(u.i >> 52 & 0x7ff) - 0x3ff + 12;
unsigned long m;
Expand Down
1 change: 0 additions & 1 deletion lib/smack/Naming.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ const std::string Naming::LOOP_EXIT = "__SMACK_loop_exit";
const std::string Naming::EQUIV_STORE_COUNTER = "__SMACK_equiv_store_counter";
const std::string Naming::EQUIV_LOAD_COUNTER = "__SMACK_equiv_load_counter";


const std::string Naming::MEMORY = "$M";
const std::string Naming::ALLOC = "$alloc";
const std::string Naming::FREE = "$free";
Expand Down
8 changes: 5 additions & 3 deletions lib/smack/SmackModuleGenerator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,12 @@ void SmackModuleGenerator::generateProgram(llvm::Module &M) {
SmackRep rep(&M.getDataLayout(), &naming, program, &getAnalysis<Regions>());
std::list<Decl *> &decls = program->getDeclarations();

decls.insert(decls.end(), {Decl::variable(Naming::EQUIV_STORE_COUNTER, "int"),
Decl::variable(Naming::EQUIV_LOAD_COUNTER, "int")});
decls.insert(decls.end(),
{Decl::variable(Naming::EQUIV_STORE_COUNTER, "int"),
Decl::variable(Naming::EQUIV_LOAD_COUNTER, "int")});

decls.insert(decls.end(), {Decl::function("__SMACK_equiv_id", {{"id", "int"}}, "int")});
decls.insert(decls.end(),
{Decl::function("__SMACK_equiv_id", {{"id", "int"}}, "int")});

SDEBUG(errs() << "Analyzing globals...\n");

Expand Down
8 changes: 4 additions & 4 deletions lib/smack/SmackRep.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1244,10 +1244,10 @@ Decl *SmackRep::getInitFuncs() {
b->addStmt(
Stmt::assign(Expr::id(Naming::RMODE_VAR), Expr::lit(RModeKind::RNE)));
}
b->addStmt(
Stmt::assign(Expr::id(Naming::EQUIV_STORE_COUNTER), Expr::lit((unsigned int) 0)));
b->addStmt(
Stmt::assign(Expr::id(Naming::EQUIV_LOAD_COUNTER), Expr::lit((unsigned int) 0)));
b->addStmt(Stmt::assign(Expr::id(Naming::EQUIV_STORE_COUNTER),
Expr::lit((unsigned int)0)));
b->addStmt(Stmt::assign(Expr::id(Naming::EQUIV_LOAD_COUNTER),
Expr::lit((unsigned int)0)));
b->addStmt(Stmt::return_());
proc->getBlocks().push_back(b);
return proc;
Expand Down
Loading

0 comments on commit f18245d

Please sign in to comment.