std::pair<RValue, llvm::Value *> AtomicInfo::EmitAtomicCompareExchange(
RValue Expected, RValue Desired, llvm::AtomicOrdering Success,
llvm::AtomicOrdering Failure, bool IsWeak) {
- if (isStrongerThan(Failure, Success))
- // Don't assert on undefined behavior "failure argument shall be no stronger
- // than the success argument".
- Failure = llvm::AtomicCmpXchgInst::getStrongestFailureOrdering(Success);
-
// Check whether we should use a library call.
if (shouldUseLibcall()) {
// Produce a source address.