These methods for results and arguments would create an ArrayRef full
of nullptrs when there were no argument attributes. This is problematic
because this result could not be passed to the FuncOp::build creator
without causing a segfault. Now the list will have empty attributes.
Differential Revision: https://reviews.llvm.org/D114358
auto argAttrRange = argAttrs.template getAsRange<DictionaryAttr>();
result.append(argAttrRange.begin(), argAttrRange.end());
} else {
- result.resize(getNumArguments());
+ result.append(getNumArguments(),
+ DictionaryAttr::get(this->getOperation()->getContext()));
}
}
auto argAttrRange = argAttrs.template getAsRange<DictionaryAttr>();
result.append(argAttrRange.begin(), argAttrRange.end());
} else {
- result.resize(getNumResults());
+ result.append(getNumResults(),
+ DictionaryAttr::get(this->getOperation()->getContext()));
}
}