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() {
298
298
template <typename DataTy>
299
299
DataTy &TransformDialect::getOrCreateExtraData () {
300
300
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 ());
308
305
}
309
306
310
307
// / A wrapper for transform dialect extensions that forces them to be
You can’t perform that action at this time.
0 commit comments