26 Operation *defOp = v.getDefiningOp();
27 if (
auto inst = dyn_cast_or_null<hw::InstanceOp>(defOp)) {
28 Operation *modOp = syms.
getDefinition(inst.getModuleNameAttr());
30 assert(isa<hw::HWModuleLike>(modOp) &&
"Instance must point to a module");
31 OpResult instResult = cast<OpResult>(v);
32 auto mod = cast<hw::HWModuleLike>(modOp);
34 llvm::raw_string_ostream os(buff);
35 os << inst.getInstanceName() <<
".";
36 StringAttr name = mod.getOutputNameAttr(instResult.getResultNumber());
38 os << name.getValue();
42 if (
auto blockArg = dyn_cast<BlockArgument>(v)) {
44 cast<hw::PortList>(blockArg.getOwner()->getParent()->getParentOp())
48 if (
auto constOp = dyn_cast<hw::ConstantOp>(defOp)) {
50 llvm::raw_string_ostream(buff) <<
"c" << constOp.getValue();