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)
180
type: _module.Translate(localSymbol.Type, bodySyntax,
_diagnostics
.DiagnosticBag),
227
asyncCatchHandlerOffset =
_diagnostics
.HasAnyErrors() ? -1 : _builder.GetILOffsetFromMarker(_asyncCatchHandlerOffset);
234
if (yieldPoints == null ||
_diagnostics
.HasAnyErrors())
290
if (!
_diagnostics
.HasAnyErrors())
297
Debug.Assert(
_diagnostics
.HasAnyErrors());
341
_builder.EmitToken(symbol, syntaxNode,
_diagnostics
.DiagnosticBag);
346
EmitTypeReferenceToken(_module.Translate(symbol, syntaxNode,
_diagnostics
.DiagnosticBag), syntaxNode);
351
var methodRef = _module.Translate(method, syntaxNode,
_diagnostics
.DiagnosticBag, optArgList, needDeclaration: encodeAsRawDefinitionToken);
352
_builder.EmitToken(methodRef, syntaxNode,
_diagnostics
.DiagnosticBag, encodeAsRawDefinitionToken ? Cci.MetadataWriter.RawTokenEncoding.RowId : 0);
357
var 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)
412
arrayAccess.Syntax,
_diagnostics
.DiagnosticBag);
CodeGen\EmitArrayInitializer.cs (18)
58
_builder.EmitArrayBlockInitializer(data, inits.Syntax,
_diagnostics
.DiagnosticBag);
434
RoslynDebug.Assert(
_diagnostics
.DiagnosticBag is not null, $"Expected non-null {nameof(
_diagnostics
)}.{nameof(
_diagnostics
.DiagnosticBag)}");
464
var rosPointerCtor = (MethodSymbol?)Binder.GetWellKnownTypeMember(_module.Compilation, WellKnownMember.System_ReadOnlySpan_T__ctor_Pointer,
_diagnostics
, syntax: wrappedExpression.Syntax, isOptional: true);
557
var field = _builder.module.GetFieldForData(data, alignment: 1, wrappedExpression.Syntax,
_diagnostics
.DiagnosticBag);
559
_builder.EmitToken(field, wrappedExpression.Syntax,
_diagnostics
.DiagnosticBag);
610
MethodSymbol? createSpan = (MethodSymbol?)Binder.GetWellKnownTypeMember(_module.Compilation, WellKnownMember.System_Runtime_CompilerServices_RuntimeHelpers__CreateSpanRuntimeFieldHandle,
_diagnostics
, syntax: wrappedExpression.Syntax, isOptional: true);
618
var field = _builder.module.GetFieldForData(data, alignment: (ushort)specialElementType.SizeInBytes(), wrappedExpression.Syntax,
_diagnostics
.DiagnosticBag);
620
_builder.EmitToken(field, wrappedExpression.Syntax,
_diagnostics
.DiagnosticBag);
651
var 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);
710
arrayCreation.Syntax,
_diagnostics
.DiagnosticBag);
717
_builder.EmitToken(cachingField, arrayCreation.Syntax,
_diagnostics
.DiagnosticBag);
727
_builder.EmitToken(cachingField, arrayCreation.Syntax,
_diagnostics
.DiagnosticBag);
779
rosArrayCtor = (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,
820
EmitExpression(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);
3576
var 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)
25
Debug.Assert(
_diagnostics
.DiagnosticBag is not null);
59
var field = _builder.module.GetFieldForData(data, alignment: 1, inits.Syntax,
_diagnostics
.DiagnosticBag);
62
_builder.EmitToken(field, inits.Syntax,
_diagnostics
.DiagnosticBag);
70
if (Binder.GetWellKnownTypeMember(_module.Compilation, WellKnownMember.System_Runtime_CompilerServices_RuntimeHelpers__CreateSpanRuntimeFieldHandle,
_diagnostics
, syntax: syntaxNode, isOptional: true) is MethodSymbol createSpanHelper &&
71
Binder.GetWellKnownTypeMember(_module.Compilation, WellKnownMember.System_ReadOnlySpan_T__get_Item,
_diagnostics
, syntax: syntaxNode, isOptional: true) is MethodSymbol spanGetItemDefinition)
82
var 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);
1096
var exceptionType = _module.Translate(catchBlock.ExceptionTypeOpt, catchBlock.Syntax,
_diagnostics
.DiagnosticBag);
1099
_builder.EmitToken(exceptionType, catchBlock.Syntax,
_diagnostics
.DiagnosticBag);
1393
var int32Type = Binder.GetSpecialType(_module.Compilation, SpecialType.System_Int32, syntaxNode,
_diagnostics
);
1418
var charType = Binder.GetSpecialType(_module.Compilation, SpecialType.System_Char, syntaxNode,
_diagnostics
);
1495
var privateImplClass = _module.GetPrivateImplClass(syntaxNode,
_diagnostics
.DiagnosticBag).PrivateImplementationDetails;
1516
_builder.EmitToken(stringHashMethodRef, syntaxNode,
_diagnostics
.DiagnosticBag);
1518
var UInt32Type = Binder.GetSpecialType(_module.Compilation, SpecialType.System_UInt32, syntaxNode,
_diagnostics
);
1537
_diagnostics
, syntax: syntaxNode);
1539
var sequenceEqualsCharMethod = sequenceEqualsTMethod.Construct(Binder.GetSpecialType(_module.Compilation, SpecialType.System_Char, syntaxNode,
_diagnostics
));
1540
sequenceEqualsMethodRef = _module.Translate(sequenceEqualsCharMethod, null,
_diagnostics
.DiagnosticBag);
1542
var asSpanMethod = (MethodSymbol)Binder.GetWellKnownTypeMember(_module.Compilation, WellKnownMember.System_MemoryExtensions__AsSpan_String,
_diagnostics
, syntax: syntaxNode);
1544
asSpanMethodRef = _module.Translate(asSpanMethod, null,
_diagnostics
.DiagnosticBag);
1550
stringEqualityMethodRef = _module.Translate(stringEqualityMethod, syntaxNode,
_diagnostics
.DiagnosticBag);
1630
_diagnostics
, syntax: syntaxNode);
1634
return _module.Translate(spanCharLengthMethod, syntaxNode,
_diagnostics
.DiagnosticBag);
1641
return _module.Translate(stringLengthMethod, syntaxNode,
_diagnostics
.DiagnosticBag);
1654
_diagnostics
, syntax: syntaxNode);
1659
return _module.Translate(spanCharLengthMethod, null,
_diagnostics
.DiagnosticBag);
1667
return _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);
1768
MetadataConstant 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);
1806
translatedType = _module.Translate(local.Type, syntaxNode,
_diagnostics
.DiagnosticBag);
1811
_module.GetFakeSymbolTokenForIL(translatedType, syntaxNode,
_diagnostics
.DiagnosticBag);
1903
_module.Translate(type, syntaxNode,
_diagnostics
.DiagnosticBag),