public MethodDefinition resolve(MethodReference method) { if (method == null) { return(null); } var methodDef = method as MethodDefinition; if (methodDef != null) { return(methodDef); } var type = resolve(method.DeclaringType); if (type == null) { return(null); } foreach (var m in type.Methods) { if (MemberReferenceHelper.compareMethodReference(method, m)) { return(m); } } return(null); }
public MMethod getMethod(MethodReference methodReference) { var type = getType(methodReference.DeclaringType); if (type != null) { return(type.getMethod(methodReference)); } if (!MemberReferenceHelper.compareTypes(moduleType, methodReference.DeclaringType)) { return(null); } initGlobalMethods(); foreach (var method in tokenToGlobalMethod.Values) { if (MemberReferenceHelper.compareMethodReference(methodReference, method.methodDefinition)) { return(method); } } return(null); }