Mangle the name of `stmt` (typedef or grouping).

        Return the mangled name and dictionary where the definition is
        to be installed. The `inrpc` flag indicates when we are inside
        an RPC, in which case the name gets the "__rpc" suffix.

def unique_def_name(self, stmt, inrpc=False):
        """Mangle the name of `stmt` (typedef or grouping).

        Return the mangled name and dictionary where the definition is
        to be installed. The `inrpc` flag indicates when we are inside
        an RPC, in which case the name gets the "__rpc" suffix.
        """
        module = stmt.main_module()
        name = ""
        while True:
            pref = stmt.arg if stmt.arg else stmt.keyword
            name = "__" + pref + name
            if stmt.keyword == "grouping": name = "_" + name
            if stmt.parent.parent is None: break
            stmt = stmt.parent
        defs = (self.global_defs
                if stmt.keyword in ("grouping", "typedef")
                else self.local_defs)
        if inrpc: name += "__rpc"
        return (module.arg + name, defs)