public void LogWarning(string text, int code, MethodIL origin, int ilOffset, string subcategory = MessageSubCategory.None) { string document = null; int? lineNumber = null; IEnumerable <ILSequencePoint> sequencePoints = origin.GetDebugInfo()?.GetSequencePoints(); if (sequencePoints != null) { foreach (var sequencePoint in sequencePoints) { if (sequencePoint.Offset <= ilOffset) { document = sequencePoint.Document; lineNumber = sequencePoint.LineNumber; } } } MethodDesc warnedMethod = CompilerGeneratedState.GetUserDefinedMethodForCompilerGeneratedMember(origin.OwningMethod) ?? origin.OwningMethod; MessageOrigin messageOrigin = new MessageOrigin(warnedMethod, document, lineNumber, null); LogWarning(text, code, messageOrigin, subcategory); }
public void LogWarning(MethodIL origin, int ilOffset, DiagnosticId id, params string[] args) { string document = null; int? lineNumber = null; IEnumerable <ILSequencePoint> sequencePoints = origin.GetDebugInfo()?.GetSequencePoints(); if (sequencePoints != null) { foreach (var sequencePoint in sequencePoints) { if (sequencePoint.Offset <= ilOffset) { document = sequencePoint.Document; lineNumber = sequencePoint.LineNumber; } } } MethodDesc warnedMethod = CompilerGeneratedState.GetUserDefinedMethodForCompilerGeneratedMember(origin.OwningMethod) ?? origin.OwningMethod; MessageOrigin messageOrigin = new MessageOrigin(warnedMethod, document, lineNumber, null); LogWarning(messageOrigin, id, args); }
public void LogWarning(string text, int code, MethodIL origin, int ilOffset, string subcategory = MessageSubCategory.None) { MessageOrigin messageOrigin = new MessageOrigin(origin, ilOffset); LogWarning(text, code, messageOrigin, subcategory); }
public void LogWarning(MethodIL origin, int ilOffset, DiagnosticId id, params string[] args) { MessageOrigin messageOrigin = new MessageOrigin(origin, ilOffset); LogWarning(messageOrigin, id, args); }
public virtual void GetDependenciesDueToAccess(ref DependencyList dependencies, NodeFactory factory, MethodIL methodIL, FieldDesc writtenField) { }
public virtual void GetDependenciesDueToAccess(ref DependencyList dependencies, NodeFactory factory, MethodIL methodIL, MethodDesc calledMethod) { }
protected virtual void GetDependenciesDueToMethodCodePresenceInternal(ref DependencyList dependencies, NodeFactory factory, MethodDesc method, MethodIL methodIL) { // MetadataManagers can override this to provide additional dependencies caused by the presence of a // compiled method body. }
/// <summary> /// This method is an extension point that can provide additional metadata-based dependencies to generated method bodies. /// </summary> public void GetDependenciesDueToMethodCodePresence(ref DependencyList dependencies, NodeFactory factory, MethodDesc method, MethodIL methodIL) { if (method.HasInstantiation) { ExactMethodInstantiationsNode.GetExactMethodInstantiationDependenciesForMethod(ref dependencies, factory, method); } GetDependenciesDueToMethodCodePresenceInternal(ref dependencies, factory, method, methodIL); }