Skip to content

Commit a1450d5

Browse files
switch to ++iValue, drop void cast & braces
1 parent 9e40189 commit a1450d5

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

clang/lib/CIR/Dialect/IR/CIRDialect.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -976,9 +976,8 @@ void cir::SwitchFlatOp::build(OpBuilder &builder, OperationState &result,
976976
ArrayRef<ValueRange> caseOperands) {
977977

978978
std::vector<mlir::Attribute> caseValuesAttrs;
979-
for (const APInt &val : caseValues) {
979+
for (const APInt &val : caseValues)
980980
caseValuesAttrs.push_back(cir::IntAttr::get(value.getType(), val));
981-
}
982981
mlir::ArrayAttr attrs = ArrayAttr::get(builder.getContext(), caseValuesAttrs);
983982

984983
build(builder, result, value, defaultOperands, caseOperands, attrs,

clang/lib/CIR/Dialect/Transforms/FlattenCFG.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -374,8 +374,7 @@ class CIRSwitchOpFlattening : public mlir::OpRewritePattern<cir::SwitchOp> {
374374
constexpr int kSmallRangeThreshold = 64;
375375
if ((upperBound - lowerBound)
376376
.ult(llvm::APInt(32, kSmallRangeThreshold))) {
377-
for (APInt iValue = lowerBound; iValue.sle(upperBound);
378-
(void)iValue++) {
377+
for (APInt iValue = lowerBound; iValue.sle(upperBound); ++iValue) {
379378
caseValues.push_back(iValue);
380379
caseOperands.push_back(operand);
381380
caseDestinations.push_back(destination);

0 commit comments

Comments
 (0)