Skip to content

Commit 64ef173

Browse files
committed
Address code review comments
1 parent 1ee2eb2 commit 64ef173

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
@@ -699,8 +699,7 @@ mlir::LogicalResult cir::VectorType::verify(
699699
isAnyFloatingPointType(elementType))
700700
return success();
701701

702-
return emitError() << "expected LLVM-compatible fixed-vector type "
703-
"to be either builtin or LLVM dialect type";
702+
return emitError() << "unsupported element type for CIR vector";
704703
}
705704

706705
//===----------------------------------------------------------------------===//

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)