We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 7028c00 commit 13c484cCopy full SHA for 13c484c
clang/lib/CIR/Lowering/DirectToLLVM/LowerToLLVM.cpp
@@ -54,11 +54,11 @@ namespace direct {
54
namespace {
55
/// If the given type is a vector type, return the vector's element type.
56
/// Otherwise return the given type unchanged.
57
-// TODO(cir): Return the vector element type once we have support for vectors
58
-// instead of the identity type.
59
mlir::Type elementTypeIfVector(mlir::Type type) {
60
- assert(!cir::MissingFeatures::vectorType());
61
- return type;
+ return llvm::TypeSwitch<mlir::Type, mlir::Type>(type)
+ .Case<cir::VectorType, mlir::VectorType>(
+ [](auto p) { return p->getElementType(); })
+ .Default([](mlir::Type p) { return p; });
62
}
63
} // namespace
64
0 commit comments