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

Mehdi Amini llvmlistbot at llvm.org
Wed Mar 20 00:23:53 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);";
----------------
joker-eph wrote:

> Nope :(
> 
> ```
> build/tools/mlir/include/mlir/Dialect/Bufferization/TransformOps/BufferizationTransformOps.cpp.inc:502:27: error: use of undeclared identifier 'targetRawOperands'; did you mean 'targetRawOperand'?
>   if (parser.parseOperand(targetRawOperands[0]))
>                           ^~~~~~~~~~~~~~~~~
>                           targetRawOperand
> ```
> 
> Same for rawTypes as well.


That's because you stopped short of fixing the other occurrences of RawOperands I believe? Just remove the `[0]` and it'll work I believe.

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


More information about the Mlir-commits mailing list