Skip to content

Commit aa047bf

Browse files
committed
[CIR] Added missing brace to avoid potential dangling else
1 parent ba0f0cc commit aa047bf

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

clang/lib/CIR/CodeGen/CIRGenBuilder.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,11 @@ mlir::Value CIRGenBuilderTy::promoteArrayIndex(const clang::TargetInfo &ti,
4242

4343
// If this an integer, ensure that it is at least as width as the array index
4444
// type.
45-
if (auto intTy = mlir::dyn_cast<cir::IntType>(index.getType()))
45+
if (auto intTy = mlir::dyn_cast<cir::IntType>(index.getType())) {
4646
if (intTy.getWidth() < arrayIndexWidth)
4747
return create<cir::CastOp>(loc, arrayIndexType, cir::CastKind::integral,
4848
index);
49+
}
4950

5051
return index;
5152
}

0 commit comments

Comments
 (0)