Skip to content

Commit 78309ef

Browse files
committed
Address code review comments
1 parent eee3487 commit 78309ef

File tree

3 files changed

+4
-5
lines changed

3 files changed

+4
-5
lines changed

clang/lib/CIR/CodeGen/CIRGenBuilder.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,8 @@ class CIRGenBuilderTy : public cir::CIRBaseBuilderTy {
8383
cir::IntType>(ty))
8484
return true;
8585

86-
if (mlir::isa<cir::VectorType>(ty))
87-
return isSized(mlir::cast<cir::VectorType>(ty).getElementType());
86+
if (const auto vt = mlir::dyn_cast<cir::VectorType>(ty))
87+
return isSized(vt.getElementType());
8888

8989
assert(!cir::MissingFeatures::unsizedTypes());
9090
return false;

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -669,8 +669,7 @@ mlir::LogicalResult cir::VectorType::verify(
669669
isAnyFloatingPointType(elementType))
670670
return success();
671671

672-
return emitError() << "expected LLVM-compatible fixed-vector type "
673-
"to be either builtin or LLVM dialect type";
672+
return emitError() << "unsupported element type for CIR vector";
674673
}
675674

676675
//===----------------------------------------------------------------------===//

clang/test/CIR/IR/invalid-vector.cir

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
module {
66

7-
// expected-error @below {{expected LLVM-compatible fixed-vector type}}
7+
// expected-error @below {{unsupported element type for CIR vector}}
88
cir.global external @vec_b = #cir.zero : !cir.vector<4 x !cir.array<!s32i x 10>>
99

1010
}

0 commit comments

Comments
 (0)