}
/// Return all argument attributes of this function.
- MutableArrayRef<NamedAttributeList> getAllArgAttrs() {
- return impl->argAttrs;
+ void getAllArgAttrs(SmallVectorImpl<NamedAttributeList> &result) {
+ result.assign(impl->argAttrs.begin(), impl->argAttrs.end());
}
/// Return the specified attribute if present, null otherwise.
}
/// Return all argument attributes of this function.
- void getAllArgAttrs(SmallVectorImpl<DictionaryAttr> &result) {
+ void getAllArgAttrs(SmallVectorImpl<NamedAttributeList> &result) {
for (unsigned i = 0, e = getNumArguments(); i != e; ++i)
result.emplace_back(getArgAttrDict(i));
}
visitType(fn.getType());
for (auto attr : fn.getAttrs())
ModuleState::visitAttribute(attr.second);
- for (auto attrList : fn.getAllArgAttrs())
- for (auto attr : attrList.getAttrs())
- ModuleState::visitAttribute(attr.second);
fn.walk([&](Operation *op) { ModuleState::visitOperation(op); });
}
FunctionConverter funcConverter(ctx, target, patterns, &converter);
// Try to convert each of the functions within the module.
+ SmallVector<NamedAttributeList, 4> argAttrs;
for (auto func : fns) {
+ argAttrs.clear();
+ func.getAllArgAttrs(argAttrs);
+
// Convert the function type using the type converter.
- auto conversion =
- converter.convertSignature(func.getType(), func.getAllArgAttrs());
+ auto conversion = converter.convertSignature(func.getType(), argAttrs);
if (!conversion)
return failure();