25 OpBuilder::InsertPoint &insertPoint,
28 assert(pathArray && !pathArray.empty());
31 auto pathIter =
pathCache.find(pathArray);
33 auto &hierPathOp = pathIter->getSecond();
34 auto oldLoc = hierPathOp->getLoc();
36 SmallVector<Location> locations;
37 if (
auto fusedLoc = dyn_cast<FusedLoc>(oldLoc)) {
38 auto oldLocs = fusedLoc.getLocations();
39 locations.append(oldLocs.begin(), oldLocs.end());
41 locations.push_back(oldLoc);
43 locations.push_back(loc);
45 hierPathOp->setLoc(FusedLoc::get(loc.getContext(), locations));
51 OpBuilder builder(insertPoint.getBlock(), insertPoint.getPoint());
56 .insert({pathArray, builder.create<hw::HierPathOp>(
59 path.setVisibility(SymbolTable::Visibility::Private);
63 insertPoint = builder.saveInsertionPoint();