use of com.dat3m.dartagnan.program.event.lang.svcomp.LoopEnd in project Dat3M by hernanponcedeleon.
the class FindSpinLoops method markAnnotatedSpinLoops.
private void markAnnotatedSpinLoops(Thread t) {
Event pred = t.getEntry();
Event curr = pred.getSuccessor();
while (curr != null) {
if (curr instanceof LoopEnd) {
// This assume the following implementation of await_while
// #define await_while(cond) \
// for (int tmp = (__VERIFIER_loop_begin(), 0); __VERIFIER_spin_start(), \
// tmp = cond, __VERIFIER_spin_end(!tmp), tmp;)
Event spinloop = curr.getSuccessors().stream().filter(e -> e instanceof CondJump && ((CondJump) e).isGoto()).findFirst().get();
spinloop.addFilters(Tag.SPINLOOP, Tag.NOOPT);
((CondJump) spinloop).getLabel().addFilters(Tag.SPINLOOP, Tag.NOOPT);
spinloops++;
}
curr = curr.getSuccessor();
}
t.clearCache();
}