20 if (failed(parseResult)) {
21 return parser.emitError(parser.getCurrentLocation(),
"failed to parse struct parameters");
24 value = parser.getBuilder().getArrayAttr(own);
38FailureOr<SymbolLookupResult<StructDefOp>>
47 if (failed(res) || !res.value()) {
53 auto defParams = res.value().get().getConstParams();
54 size_t numExpected = defParams ? defParams->size() : 0;
55 if (typeParams.size() != numExpected) {
56 return op->emitError() <<
"'" <<
StructType::name <<
"' type has " << typeParams.size()
57 <<
" parameters but \"" << res.value().get().getSymName()
58 <<
"\" expects " << numExpected;
73 return lookup->get().hasColumns();
static constexpr ::llvm::StringLiteral getOperationName()
::mlir::SymbolRefAttr getNameRef() const
mlir::LogicalResult hasColumns(mlir::SymbolTableCollection &symbolTable, mlir::Operation *op) const
Returns wether the struct this type refers to has fields marked as columns.
::mlir::LogicalResult verify(::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError, ::mlir::SymbolRefAttr nameRef, ::mlir::ArrayAttr params)
::mlir::ArrayAttr getParams() const
::mlir::FailureOr< SymbolLookupResult< StructDefOp > > getDefinition(::mlir::SymbolTableCollection &symbolTable, ::mlir::Operation *op) const
Gets the struct op that defines this struct.
::mlir::LogicalResult verifySymbolRef(::mlir::SymbolTableCollection &symbolTable, ::mlir::Operation *op)
static constexpr ::llvm::StringLiteral name
void printStructParams(AsmPrinter &printer, ArrayAttr value)
ParseResult parseStructParams(AsmParser &parser, ArrayAttr &value)
mlir::FailureOr< SymbolLookupResultUntyped > lookupTopLevelSymbol(mlir::SymbolTableCollection &tables, mlir::SymbolRefAttr symbol, mlir::Operation *origin, bool reportMissing=true)
llvm::function_ref< mlir::InFlightDiagnostic()> EmitErrorFn
SmallVector< Attribute > forceIntAttrTypes(ArrayRef< Attribute > attrList)
void printAttrs(AsmPrinter &printer, ArrayRef< Attribute > attrs, const StringRef &separator)
LogicalResult verifyStructTypeParams(EmitErrorFn emitError, ArrayAttr params)