================
@@ -5133,6 +5133,132 @@ RValue CodeGenFunction::EmitBuiltinExpr(const 
GlobalDecl GD, unsigned BuiltinID,
     Builder.SetInsertPoint(ContBB);
     return RValue::get(nullptr);
   }
+  case Builtin::BI__scoped_atomic_thread_fence: {
+    auto ScopeModel = AtomicScopeModel::create(AtomicScopeModelKind::Generic);
+
+    Value *Order = EmitScalarExpr(E->getArg(0));
+    Value *Scope = EmitScalarExpr(E->getArg(1));
+    if (isa<llvm::ConstantInt>(Order) && isa<llvm::ConstantInt>(Scope)) {
+      int Ord = cast<llvm::ConstantInt>(Order)->getZExtValue();
+      int Scp = cast<llvm::ConstantInt>(Scope)->getZExtValue();
----------------
arsenm wrote:

dyn_cast instead of isa + cast 

https://github.com/llvm/llvm-project/pull/115545
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to