[Mlir-commits] [mlir] [mlir][OpFormatGen][NFC] Initialize C-style arrays upon creation (PR #85631)

Andrei Golubev llvmlistbot at llvm.org
Thu Mar 21 02:03:35 PDT 2024


================
@@ -842,7 +842,7 @@ static void genElementParserStorage(FormatElement *element, const Operator &op,
       }
     } else {
       body << "  ::mlir::OpAsmParser::UnresolvedOperand " << name
-           << "RawOperands[1];\n"
+           << "RawOperands[1] = {};\n"
            << "  ::llvm::ArrayRef<::mlir::OpAsmParser::UnresolvedOperand> "
            << name << "Operands(" << name << "RawOperands);";
----------------
andrey-golubev wrote:

no, I haven't. let me try your way then. how come the other "case" is not triggered anywhere? (the one where we have variable length operands and a `SmallVector<>` instead of a c array)

https://github.com/llvm/llvm-project/pull/85631


More information about the Mlir-commits mailing list