def find_matching_function(self, name, param_count, must_return): """Finds and returns the function definition which matches with the given 'name' and parameter count. If 'must_return' is True, then the function must also return some value to be valid """ f = self.functions.get(Function.mangle(name, param_count)) if f and (not must_return or f.returns is not None): return f return None