| 5689 | } |
| 5690 | |
| 5691 | void checkStop() noexcept { |
| 5692 | if (!Interruptible) { |
| 5693 | return; |
| 5694 | } |
| 5695 | auto NotStopBB = LLVM::BasicBlock::create(LLContext, F.Fn, "NotStop"); |
| 5696 | auto StopToken = Builder.createAtomicRMW( |
| 5697 | LLVMAtomicRMWBinOpXchg, Context.getStopToken(Builder, ExecCtx), |
| 5698 | LLContext.getInt32(0), LLVMAtomicOrderingMonotonic); |
| 5699 | #if LLVM_VERSION_MAJOR >= 13 |
| 5700 | StopToken.setAlignment(32); |
| 5701 | #endif |
| 5702 | auto NotStop = Builder.createLikely( |
| 5703 | Builder.createICmpEQ(StopToken, LLContext.getInt32(0))); |
| 5704 | Builder.createCondBr(NotStop, NotStopBB, |
| 5705 | getTrapBB(ErrCode::Value::Interrupted)); |
| 5706 | |
| 5707 | Builder.positionAtEnd(NotStopBB); |
| 5708 | } |
| 5709 | |
| 5710 | void setUnreachable() noexcept { |
| 5711 | if (ControlStack.empty()) { |
nothing calls this directly
no test coverage detected