def _build_local_typemap(t_param_mapping, typedef_mapping): # for resolving typedefed types in template instance args: local_map = dict((n, t.transformed(typedef_mapping)) for (n, t) in t_param_mapping.items()) # for resolving 'free' typedefs in method args and result types: if set(local_map) & set(typedef_mapping): raise Exception("t_param_mapping and typedef_mapping intersects") local_map.update(typedef_mapping) # resolve indirections induced by update: Utils.flatten(local_map) return local_map
def _build_typedef_mapping(decls): _check_typedefs(decls) mapping = dict((d.name, d.type_) for d in decls) Utils.flatten(mapping) return mapping