File tree Expand file tree Collapse file tree 1 file changed +4
-7
lines changed
mlir/include/mlir/Dialect/Transform/IR Expand file tree Collapse file tree 1 file changed +4
-7
lines changed Original file line number Diff line number Diff line change @@ -298,13 +298,10 @@ void TransformDialect::addTypeIfNotRegistered() {
298298template <typename DataTy>
299299DataTy &TransformDialect::getOrCreateExtraData () {
300300 TypeID typeID = TypeID::get<DataTy>();
301- auto it = extraData.find (typeID);
302- if (it != extraData.end ())
303- return static_cast <DataTy &>(*it->getSecond ());
304-
305- auto emplaced =
306- extraData.try_emplace (typeID, std::make_unique<DataTy>(getContext ()));
307- return static_cast <DataTy &>(*emplaced.first ->getSecond ());
301+ auto [it, inserted] = extraData.try_emplace (typeID);
302+ if (inserted)
303+ it->getSecond () = std::make_unique<DataTy>(getContext ());
304+ return static_cast <DataTy &>(*it->getSecond ());
308305}
309306
310307// / A wrapper for transform dialect extensions that forces them to be
You can’t perform that action at this time.
0 commit comments