1 write to _diagnostics
Microsoft.CodeAnalysis.CSharp (1)
CodeGen\CodeGenerator.cs (1)
103_diagnostics = diagnostics;
93 references to _diagnostics
Microsoft.CodeAnalysis.CSharp (93)
CodeGen\CodeGenerator.cs (12)
180type: _module.Translate(localSymbol.Type, bodySyntax, _diagnostics.DiagnosticBag), 227asyncCatchHandlerOffset = _diagnostics.HasAnyErrors() ? -1 : _builder.GetILOffsetFromMarker(_asyncCatchHandlerOffset); 234if (yieldPoints == null || _diagnostics.HasAnyErrors()) 290if (!_diagnostics.HasAnyErrors()) 297Debug.Assert(_diagnostics.HasAnyErrors()); 341_builder.EmitToken(symbol, syntaxNode, _diagnostics.DiagnosticBag); 346EmitTypeReferenceToken(_module.Translate(symbol, syntaxNode, _diagnostics.DiagnosticBag), syntaxNode); 351var methodRef = _module.Translate(method, syntaxNode, _diagnostics.DiagnosticBag, optArgList, needDeclaration: encodeAsRawDefinitionToken); 352_builder.EmitToken(methodRef, syntaxNode, _diagnostics.DiagnosticBag, encodeAsRawDefinitionToken ? Cci.MetadataWriter.RawTokenEncoding.RowId : 0); 357var fieldRef = _module.Translate(symbol, syntaxNode, _diagnostics.DiagnosticBag); 358_builder.EmitToken(fieldRef, syntaxNode, _diagnostics.DiagnosticBag); 363_builder.EmitToken(_module.Translate(symbol).Signature, syntaxNode, _diagnostics.DiagnosticBag);
CodeGen\EmitAddress.cs (1)
412arrayAccess.Syntax, _diagnostics.DiagnosticBag);
CodeGen\EmitArrayInitializer.cs (18)
58_builder.EmitArrayBlockInitializer(data, inits.Syntax, _diagnostics.DiagnosticBag); 434RoslynDebug.Assert(_diagnostics.DiagnosticBag is not null, $"Expected non-null {nameof(_diagnostics)}.{nameof(_diagnostics.DiagnosticBag)}"); 464var rosPointerCtor = (MethodSymbol?)Binder.GetWellKnownTypeMember(_module.Compilation, WellKnownMember.System_ReadOnlySpan_T__ctor_Pointer, _diagnostics, syntax: wrappedExpression.Syntax, isOptional: true); 557var field = _builder.module.GetFieldForData(data, alignment: 1, wrappedExpression.Syntax, _diagnostics.DiagnosticBag); 559_builder.EmitToken(field, wrappedExpression.Syntax, _diagnostics.DiagnosticBag); 610MethodSymbol? createSpan = (MethodSymbol?)Binder.GetWellKnownTypeMember(_module.Compilation, WellKnownMember.System_Runtime_CompilerServices_RuntimeHelpers__CreateSpanRuntimeFieldHandle, _diagnostics, syntax: wrappedExpression.Syntax, isOptional: true); 618var field = _builder.module.GetFieldForData(data, alignment: (ushort)specialElementType.SizeInBytes(), wrappedExpression.Syntax, _diagnostics.DiagnosticBag); 620_builder.EmitToken(field, wrappedExpression.Syntax, _diagnostics.DiagnosticBag); 651var cachingField = _builder.module.GetArrayCachingFieldForData(data, _module.Translate(arrayType), wrappedExpression.Syntax, _diagnostics.DiagnosticBag); 657_builder.EmitToken(cachingField, wrappedExpression.Syntax, _diagnostics.DiagnosticBag); 668_builder.EmitArrayBlockInitializer(data, wrappedExpression.Syntax, _diagnostics.DiagnosticBag); 671_builder.EmitToken(cachingField, wrappedExpression.Syntax, _diagnostics.DiagnosticBag); 710arrayCreation.Syntax, _diagnostics.DiagnosticBag); 717_builder.EmitToken(cachingField, arrayCreation.Syntax, _diagnostics.DiagnosticBag); 727_builder.EmitToken(cachingField, arrayCreation.Syntax, _diagnostics.DiagnosticBag); 779rosArrayCtor = (MethodSymbol?)Binder.GetWellKnownTypeMember(_module.Compilation, WellKnownMember.System_ReadOnlySpan_T__ctor_Array, _diagnostics, syntax: syntax, isOptional: true);
CodeGen\EmitConversion.cs (1)
394_diagnostics.Add(ErrorCode.ERR_BadDelegateConstructor, syntax.Location, delegateType);
CodeGen\EmitExpression.cs (21)
88_diagnostics.Add(ErrorCode.ERR_InsufficientStack, 820EmitExpression(expression.EmitExpressions.GetValue(expression, _diagnostics.DiagnosticBag), used); 1101_builder.EmitArrayElementLoad(_module.Translate((ArrayTypeSymbol)arrayAccess.Expression.Type), arrayAccess.Expression.Syntax, _diagnostics.DiagnosticBag); 2385_builder.EmitArrayCreation(_module.Translate(arrayType), expression.Syntax, _diagnostics.DiagnosticBag); 3203_builder.EmitArrayElementStore(_module.Translate(arrayType), syntaxNode, _diagnostics.DiagnosticBag); 3576var fieldRef = _module.Translate(field, syntax, _diagnostics.DiagnosticBag, needDeclaration: true); 3579_builder.EmitToken(fieldRef, syntax, _diagnostics.DiagnosticBag, Cci.MetadataWriter.RawTokenEncoding.LiftedVariableId); 3604_module.GetModuleVersionId(_module.Translate(node.Type, node.Syntax, _diagnostics.DiagnosticBag), node.Syntax, _diagnostics.DiagnosticBag), 3606_diagnostics.DiagnosticBag); 3615_module.GetModuleCancellationToken(_module.Translate(cancellationTokenType, syntax, _diagnostics.DiagnosticBag), syntax, _diagnostics.DiagnosticBag), 3617_diagnostics.DiagnosticBag); 3626_module.Translate(throwMethod, syntax, _diagnostics.DiagnosticBag), 3628_diagnostics.DiagnosticBag); 3637_module.GetModuleCancellationToken(_module.Translate(cancellationTokenType, syntax, _diagnostics.DiagnosticBag), syntax, _diagnostics.DiagnosticBag), 3639_diagnostics.DiagnosticBag); 3662_builder.EmitToken(_module.GetInstrumentationPayloadRoot(node.AnalysisKind, _module.Translate(node.Type, node.Syntax, _diagnostics.DiagnosticBag), node.Syntax, _diagnostics.DiagnosticBag), node.Syntax, _diagnostics.DiagnosticBag);
CodeGen\EmitStackAllocInitializer.cs (8)
25Debug.Assert(_diagnostics.DiagnosticBag is not null); 59var field = _builder.module.GetFieldForData(data, alignment: 1, inits.Syntax, _diagnostics.DiagnosticBag); 62_builder.EmitToken(field, inits.Syntax, _diagnostics.DiagnosticBag); 70if (Binder.GetWellKnownTypeMember(_module.Compilation, WellKnownMember.System_Runtime_CompilerServices_RuntimeHelpers__CreateSpanRuntimeFieldHandle, _diagnostics, syntax: syntaxNode, isOptional: true) is MethodSymbol createSpanHelper && 71Binder.GetWellKnownTypeMember(_module.Compilation, WellKnownMember.System_ReadOnlySpan_T__get_Item, _diagnostics, syntax: syntaxNode, isOptional: true) is MethodSymbol spanGetItemDefinition) 82var field = _builder.module.GetFieldForData(data, alignment: (ushort)sizeInBytes, syntaxNode, _diagnostics.DiagnosticBag); 84_builder.EmitToken(field, syntaxNode, _diagnostics.DiagnosticBag); 87_builder.EmitToken(createSpanHelperReference, syntaxNode, _diagnostics.DiagnosticBag);
CodeGen\EmitStatement.cs (32)
387_diagnostics.Add(ErrorCode.ERR_InsufficientStack, 915_module.Translate(expressionOpt.Type, boundReturnStatement.Syntax, _diagnostics.DiagnosticBag); 1049_module.Translate(catchBlock.ExceptionTypeOpt, catchBlock.Syntax, _diagnostics.DiagnosticBag) : 1050_module.GetSpecialType(SpecialType.System_Object, catchBlock.Syntax, _diagnostics.DiagnosticBag); 1096var exceptionType = _module.Translate(catchBlock.ExceptionTypeOpt, catchBlock.Syntax, _diagnostics.DiagnosticBag); 1099_builder.EmitToken(exceptionType, catchBlock.Syntax, _diagnostics.DiagnosticBag); 1393var int32Type = Binder.GetSpecialType(_module.Compilation, SpecialType.System_Int32, syntaxNode, _diagnostics); 1418var charType = Binder.GetSpecialType(_module.Compilation, SpecialType.System_Char, syntaxNode, _diagnostics); 1495var privateImplClass = _module.GetPrivateImplClass(syntaxNode, _diagnostics.DiagnosticBag).PrivateImplementationDetails; 1516_builder.EmitToken(stringHashMethodRef, syntaxNode, _diagnostics.DiagnosticBag); 1518var UInt32Type = Binder.GetSpecialType(_module.Compilation, SpecialType.System_UInt32, syntaxNode, _diagnostics); 1537_diagnostics, syntax: syntaxNode); 1539var sequenceEqualsCharMethod = sequenceEqualsTMethod.Construct(Binder.GetSpecialType(_module.Compilation, SpecialType.System_Char, syntaxNode, _diagnostics)); 1540sequenceEqualsMethodRef = _module.Translate(sequenceEqualsCharMethod, null, _diagnostics.DiagnosticBag); 1542var asSpanMethod = (MethodSymbol)Binder.GetWellKnownTypeMember(_module.Compilation, WellKnownMember.System_MemoryExtensions__AsSpan_String, _diagnostics, syntax: syntaxNode); 1544asSpanMethodRef = _module.Translate(asSpanMethod, null, _diagnostics.DiagnosticBag); 1550stringEqualityMethodRef = _module.Translate(stringEqualityMethod, syntaxNode, _diagnostics.DiagnosticBag); 1630_diagnostics, syntax: syntaxNode); 1634return _module.Translate(spanCharLengthMethod, syntaxNode, _diagnostics.DiagnosticBag); 1641return _module.Translate(stringLengthMethod, syntaxNode, _diagnostics.DiagnosticBag); 1654_diagnostics, syntax: syntaxNode); 1659return _module.Translate(spanCharLengthMethod, null, _diagnostics.DiagnosticBag); 1667return _module.Translate(stringCharsIndexer, syntaxNode, _diagnostics.DiagnosticBag); 1707_builder.EmitToken(stringEqualityMethodRef, syntaxNode, _diagnostics.DiagnosticBag); 1734_builder.EmitToken(asSpanRef, syntaxNode, _diagnostics.DiagnosticBag); 1736_builder.EmitToken(sequenceEqualsRef, syntaxNode, _diagnostics.DiagnosticBag); 1768MetadataConstant compileTimeValue = _module.CreateConstant(local.Type, local.ConstantValue, syntaxNode, _diagnostics.DiagnosticBag); 1799? _module.GetSpecialType(SpecialType.System_IntPtr, syntaxNode, _diagnostics.DiagnosticBag) 1800: _module.Translate(pointedAtType, syntaxNode, _diagnostics.DiagnosticBag); 1806translatedType = _module.Translate(local.Type, syntaxNode, _diagnostics.DiagnosticBag); 1811_module.GetFakeSymbolTokenForIL(translatedType, syntaxNode, _diagnostics.DiagnosticBag); 1903_module.Translate(type, syntaxNode, _diagnostics.DiagnosticBag),