@@ -5179,8 +5179,9 @@ RValue CodeGenFunction::EmitBuiltinExpr(const GlobalDecl GD, unsigned BuiltinID,
5179
5179
5180
5180
Value *Order = EmitScalarExpr(E->getArg(0));
5181
5181
Value *Scope = EmitScalarExpr(E->getArg(1));
5182
- if (auto Ord = dyn_cast<llvm::ConstantInt>(Order);
5183
- auto Scp = dyn_cast<llvm::ConstantInt>(Scope)) {
5182
+ auto Ord = dyn_cast<llvm::ConstantInt>(Order);
5183
+ auto Scp = dyn_cast<llvm::ConstantInt>(Scope);
5184
+ if (Ord && Scp) {
5184
5185
SyncScope SS = ScopeModel->isValid(Scp->getZExtValue())
5185
5186
? ScopeModel->map(Scp->getZExtValue())
5186
5187
: ScopeModel->map(ScopeModel->getFallBackValue());
@@ -5225,7 +5226,7 @@ RValue CodeGenFunction::EmitBuiltinExpr(const GlobalDecl GD, unsigned BuiltinID,
5225
5226
5226
5227
llvm::SmallVector<std::pair<llvm::BasicBlock *, llvm::AtomicOrdering>>
5227
5228
OrderBBs;
5228
- if (auto Ord = dyn_cast<llvm::ConstantInt>(Order) ) {
5229
+ if (Ord) {
5229
5230
switch (Ord->getZExtValue()) {
5230
5231
case 0: // memory_order_relaxed
5231
5232
default: // invalid order
@@ -5272,7 +5273,7 @@ RValue CodeGenFunction::EmitBuiltinExpr(const GlobalDecl GD, unsigned BuiltinID,
5272
5273
5273
5274
for (auto &[OrderBB, Ordering] : OrderBBs) {
5274
5275
Builder.SetInsertPoint(OrderBB);
5275
- if (auto Scp = dyn_cast<llvm::ConstantInt>(Scope) ) {
5276
+ if (Scp) {
5276
5277
SyncScope SS = ScopeModel->isValid(Scp->getZExtValue())
5277
5278
? ScopeModel->map(Scp->getZExtValue())
5278
5279
: ScopeModel->map(ScopeModel->getFallBackValue());
0 commit comments