================
@@ -844,9 +869,63 @@ RValue CIRGenFunction::emitAtomicExpr(AtomicExpr *e) {
emitAtomicOp(*this, e, dest, ptr, val1, val2, isWeakExpr, orderFailExpr,
size, static_cast<cir::MemOrder>(ord));
} else {
- assert(!cir::MissingFeatures::atomicExpr());
- cgm.errorNYI(e->getSourceRange(), "emitAtomicExpr: dynamic memory order");
- return RValue::get(nullptr);
+ // The memory order is not known at compile-time. The atomic operations
+ // can't handle runtime memory orders; the memory order must be hard coded.
+ // Generate a "switch" statement that converts a runtime value into a
+ // compile-time value.
+ cir::SwitchOp::create(
----------------
bcardosolopes wrote:
Please move the logic for this whole section to a new function
https://github.com/llvm/llvm-project/pull/168892
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits