[Mlir-commits] [mlir] [mlir][EmitC] Disallow string attributes as initial values (PR #75310)
Gil Rapaport
llvmlistbot at llvm.org
Sun Dec 17 04:20:35 PST 2023
================
@@ -50,6 +50,26 @@ void mlir::emitc::buildTerminatedBody(OpBuilder &builder, Location loc) {
builder.create<emitc::YieldOp>(loc);
}
+/// Check that the type of the initial value is compatible with the operations
+/// result type.
+LogicalResult verifyInitializationAttribute(Operation *op, Attribute value,
+ Type expectedType) {
----------------
aniragil wrote:
Since op is being passed in anyway for error emission, better to drop expectedType and call op->getType() inside? (would also make more meaningful original error message below accurate)
https://github.com/llvm/llvm-project/pull/75310
More information about the Mlir-commits
mailing list