void symex_target_equationt::SSA_stept::output( const namespacet &ns, std::ostream &out) const { if(source.is_set) { out << "Thread " << source.thread_nr; if(source.pc->location.is_not_nil()) out << " " << source.pc->location << std::endl; else out << std::endl; } switch(type) { case goto_trace_stept::ASSERT: out << "ASSERT" << std::endl; break; case goto_trace_stept::ASSUME: out << "ASSUME" << std::endl; break; case goto_trace_stept::LOCATION: out << "LOCATION" << std::endl; break; case goto_trace_stept::INPUT: out << "INPUT" << std::endl; break; case goto_trace_stept::OUTPUT: out << "OUTPUT" << std::endl; break; case goto_trace_stept::DECL: out << "DECL" << std::endl; out << from_expr(ns, "", ssa_lhs) << std::endl; break; case goto_trace_stept::ASSIGNMENT: out << "ASSIGNMENT ("; switch(assignment_type) { case HIDDEN: out << "HIDDEN"; break; case STATE: out << "STATE"; break; default:; } out << ")" << std::endl; break; case goto_trace_stept::DEAD: out << "DEAD" << std::endl; break; case goto_trace_stept::FUNCTION_CALL: out << "FUNCTION_CALL" << std::endl; break; case goto_trace_stept::FUNCTION_RETURN: out << "FUNCTION_RETURN" << std::endl; break; default: assert(false); } if(is_assert() || is_assume() || is_assignment()) out << from_expr(ns, "", cond_expr) << std::endl; if(is_assert()) out << comment << std::endl; out << "Guard: " << from_expr(ns, "", guard_expr) << std::endl; }
bool SpinAssumePass::is_spin(const llvm::Loop *l) const{ for(auto B_it = l->block_begin(); B_it != l->block_end(); ++B_it){ for(auto it = (*B_it)->begin(); it != (*B_it)->end(); ++it){ if(it->mayHaveSideEffects() && !llvm::isa<llvm::LoadInst>(*it) && !is_assume(*it)){ return false; } if(llvm::isa<llvm::AllocaInst>(*it)){ return false; } if(llvm::isa<llvm::PHINode>(*it)){ return false; } } } return true; }
void symex_target_equationt::SSA_stept::output( const namespacet &ns, std::ostream &out) const { if(source.is_set) { out << "Thread " << source.thread_nr; if(source.pc->source_location.is_not_nil()) out << " " << source.pc->source_location << std::endl; else out << std::endl; } switch(type) { case goto_trace_stept::ASSERT: out << "ASSERT " << from_expr(ns, "", cond_expr) << std::endl; break; case goto_trace_stept::ASSUME: out << "ASSUME " << from_expr(ns, "", cond_expr) << std::endl; break; case goto_trace_stept::LOCATION: out << "LOCATION" << std::endl; break; case goto_trace_stept::INPUT: out << "INPUT" << std::endl; break; case goto_trace_stept::OUTPUT: out << "OUTPUT" << std::endl; break; case goto_trace_stept::DECL: out << "DECL" << std::endl; out << from_expr(ns, "", ssa_lhs) << std::endl; break; case goto_trace_stept::ASSIGNMENT: out << "ASSIGNMENT ("; switch(assignment_type) { case HIDDEN: out << "HIDDEN"; break; case STATE: out << "STATE"; break; case VISIBLE_ACTUAL_PARAMETER: out << "VISIBLE_ACTUAL_PARAMETER"; break; case HIDDEN_ACTUAL_PARAMETER: out << "HIDDEN_ACTUAL_PARAMETER"; break; case PHI: out << "PHI"; break; case GUARD: out << "GUARD"; break; default:; } out << ")" << std::endl; break; case goto_trace_stept::DEAD: out << "DEAD" << std::endl; break; case goto_trace_stept::FUNCTION_CALL: out << "FUNCTION_CALL" << std::endl; break; case goto_trace_stept::FUNCTION_RETURN: out << "FUNCTION_RETURN" << std::endl; break; case goto_trace_stept::CONSTRAINT: out << "CONSTRAINT" << std::endl; break; case goto_trace_stept::SHARED_READ: out << "SHARED READ" << std::endl; break; case goto_trace_stept::SHARED_WRITE: out << "SHARED WRITE" << std::endl; break; case goto_trace_stept::ATOMIC_BEGIN: out << "ATOMIC_BEGIN" << std::endl; break; case goto_trace_stept::ATOMIC_END: out << "AUTOMIC_END" << std::endl; break; case goto_trace_stept::SPAWN: out << "SPAWN" << std::endl; break; case goto_trace_stept::MEMORY_BARRIER: out << "MEMORY_BARRIER" << std::endl; break; case goto_trace_stept::GOTO: out << "IF " << from_expr(ns, "", cond_expr) << " GOTO" << std::endl; break; default: assert(false); } if(is_assert() || is_assume() || is_assignment() || is_constraint()) out << from_expr(ns, "", cond_expr) << std::endl; if(is_assert() || is_constraint()) out << comment << std::endl; if(is_shared_read() || is_shared_write()) out << from_expr(ns, "", ssa_lhs) << std::endl; out << "Guard: " << from_expr(ns, "", guard) << std::endl; }