Changeset View
Changeset View
Standalone View
Standalone View
mlir/include/mlir/IR/FunctionSupport.h
Show First 20 Lines • Show All 606 Lines • ▼ Show 20 Lines | for (unsigned i = 0; i != numArgs; ++i) { | ||||
// Verify that all of the argument attributes are dialect attributes, i.e. | // Verify that all of the argument attributes are dialect attributes, i.e. | ||||
// that they contain a dialect prefix in their name. Call the dialect, if | // that they contain a dialect prefix in their name. Call the dialect, if | ||||
// registered, to verify the attributes themselves. | // registered, to verify the attributes themselves. | ||||
for (auto attr : argAttrs) { | for (auto attr : argAttrs) { | ||||
if (!attr.first.strref().contains('.')) | if (!attr.first.strref().contains('.')) | ||||
return funcOp.emitOpError( | return funcOp.emitOpError( | ||||
"arguments may only have dialect attributes"); | "arguments may only have dialect attributes"); | ||||
if (Dialect *dialect = attr.first.getDialect()) { | if (Dialect *dialect = attr.first.getReferencedDialect()) { | ||||
if (failed(dialect->verifyRegionArgAttribute(op, /*regionIndex=*/0, | if (failed(dialect->verifyRegionArgAttribute(op, /*regionIndex=*/0, | ||||
/*argIndex=*/i, attr))) | /*argIndex=*/i, attr))) | ||||
return failure(); | return failure(); | ||||
} | } | ||||
} | } | ||||
} | } | ||||
} | } | ||||
if (ArrayAttr allResultAttrs = funcOp.getAllResultAttrs()) { | if (ArrayAttr allResultAttrs = funcOp.getAllResultAttrs()) { | ||||
Show All 16 Lines | for (unsigned i = 0; i != numResults; ++i) { | ||||
} | } | ||||
// Verify that all of the result attributes are dialect attributes, i.e. | // Verify that all of the result attributes are dialect attributes, i.e. | ||||
// that they contain a dialect prefix in their name. Call the dialect, if | // that they contain a dialect prefix in their name. Call the dialect, if | ||||
// registered, to verify the attributes themselves. | // registered, to verify the attributes themselves. | ||||
for (auto attr : resultAttrs) { | for (auto attr : resultAttrs) { | ||||
if (!attr.first.strref().contains('.')) | if (!attr.first.strref().contains('.')) | ||||
return funcOp.emitOpError("results may only have dialect attributes"); | return funcOp.emitOpError("results may only have dialect attributes"); | ||||
if (Dialect *dialect = attr.first.getDialect()) { | if (Dialect *dialect = attr.first.getReferencedDialect()) { | ||||
if (failed(dialect->verifyRegionResultAttribute(op, /*regionIndex=*/0, | if (failed(dialect->verifyRegionResultAttribute(op, /*regionIndex=*/0, | ||||
/*resultIndex=*/i, | /*resultIndex=*/i, | ||||
attr))) | attr))) | ||||
return failure(); | return failure(); | ||||
} | } | ||||
} | } | ||||
} | } | ||||
} | } | ||||
▲ Show 20 Lines • Show All 145 Lines • Show Last 20 Lines |