Skip to content

Commit 15b3558

Browse files
committed
fix
1 parent 96960e3 commit 15b3558

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

clang/lib/CodeGen/CGBuiltin.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5179,8 +5179,9 @@ RValue CodeGenFunction::EmitBuiltinExpr(const GlobalDecl GD, unsigned BuiltinID,
51795179

51805180
Value *Order = EmitScalarExpr(E->getArg(0));
51815181
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) {
51845185
SyncScope SS = ScopeModel->isValid(Scp->getZExtValue())
51855186
? ScopeModel->map(Scp->getZExtValue())
51865187
: ScopeModel->map(ScopeModel->getFallBackValue());
@@ -5225,7 +5226,7 @@ RValue CodeGenFunction::EmitBuiltinExpr(const GlobalDecl GD, unsigned BuiltinID,
52255226

52265227
llvm::SmallVector<std::pair<llvm::BasicBlock *, llvm::AtomicOrdering>>
52275228
OrderBBs;
5228-
if (auto Ord = dyn_cast<llvm::ConstantInt>(Order)) {
5229+
if (Ord) {
52295230
switch (Ord->getZExtValue()) {
52305231
case 0: // memory_order_relaxed
52315232
default: // invalid order
@@ -5272,7 +5273,7 @@ RValue CodeGenFunction::EmitBuiltinExpr(const GlobalDecl GD, unsigned BuiltinID,
52725273

52735274
for (auto &[OrderBB, Ordering] : OrderBBs) {
52745275
Builder.SetInsertPoint(OrderBB);
5275-
if (auto Scp = dyn_cast<llvm::ConstantInt>(Scope)) {
5276+
if (Scp) {
52765277
SyncScope SS = ScopeModel->isValid(Scp->getZExtValue())
52775278
? ScopeModel->map(Scp->getZExtValue())
52785279
: ScopeModel->map(ScopeModel->getFallBackValue());

0 commit comments

Comments
 (0)