4 writes to _currentMethod
ILAssembler (4)
Actions\GrammarActions.MethodBodies.ExceptionHandling.cs (1)
35_currentMethod = null;
Actions\GrammarActions.MethodHeaders.cs (3)
27_currentMethod = new(methodDefinition); 125_currentMethod = new(methodDefinition); 130_currentMethod = null;
74 references to _currentMethod
ILAssembler (74)
Actions\GrammarActions.cs (1)
25_currentMethod is null
Actions\GrammarActions.Data.cs (1)
20_currentMethod is not null));
Actions\GrammarActions.Debug.cs (3)
172if (_currentMethod is not null) 174_currentMethod.LastRejectedSequencePointSpan = null; 423(context.Parent is not CILParser.MethodDeclContext || _currentMethod is not null);
Actions\GrammarActions.Instructions.cs (10)
245_currentMethod?.Definition.MethodBody.CodeBuilder.WriteByte((byte)ParseInt32(valueToken)); 250if (_currentMethod is not null) 252_currentMethod.Definition.MaxStack = ParseInt32(valueToken); 258if (_currentMethod is null) 272if (!_currentMethod.Definition.MethodAttributes.HasFlag(MethodAttributes.Static)) 280_entityRegistry.EntryPoint = _currentMethod.Definition; 285if (_currentMethod is not null) 287_currentMethod.Definition.BodyAttributes = MethodBodyAttributes.InitLocals; 293if (_currentMethod is not { } method) 359if (_currentMethod is not { } method)
Actions\GrammarActions.MethodBodies.cs (6)
14if (_currentMethod is null) 20foreach (var undefinedLabel in _currentMethod.UndefinedLabelReferences) 27_currentMethod.Definition.MethodBody.MarkLabel(_currentMethod.Labels[undefinedLabel.Key], 0); 29_diagnostics.AddRange(_currentMethod.Definition.MethodBody.Complete(_currentMethod.Definition.ExceptionRegions));
Actions\GrammarActions.MethodBodies.Directives.cs (32)
28if (hasSyntaxError || _currentMethod is null || context.arguments is null) 35_currentMethod.Definition.BodyAttributes = MethodBodyAttributes.InitLocals; 38DeclareLocals(_currentMethod, ApplyExplicitLocalSlots(context.arguments.Value), context); 54if (_currentMethod is null) 59_currentMethod.Definition.ExportOrdinal = -1; 60_currentMethod.Definition.ExportAlias = null; 61_exportDirectiveContexts.Remove(_currentMethod.Definition); 84_currentMethod.Definition.ExportOrdinal = ordinal; 85_currentMethod.Definition.ExportAlias = alias; 86_exportDirectiveContexts[_currentMethod.Definition] = context; 96if (_currentMethod is null) 101_currentMethod.Definition.VTableEntry = 0; 102_currentMethod.Definition.VTableSlot = 0; 103_vtableEntryDirectiveContexts.Remove(_currentMethod.Definition); 117_currentMethod.Definition.VTableEntry = vtableEntry; 118_currentMethod.Definition.VTableSlot = vtableSlot; 119_vtableEntryDirectiveContexts[_currentMethod.Definition] = context; 130_currentMethod is null || 138BlobBuilder signature = _currentMethod.Definition.MethodSignature!; 158EntityRegistry.CreateUnrecordedMethodImplementation(_currentMethod.Definition, declaration)); 210if (hasSyntaxError || _currentMethod is null) 249_currentMethod.Definition.GenericParameterConstraints.Add(constraint); 262if ((uint)index >= (uint)_currentMethod.Definition.Parameters.Count) 271EntityRegistry.ParameterEntity parameterEntity = _currentMethod.Definition.Parameters[index]; 303Debug.Assert(_currentMethod is not null); 307if ((uint)index >= (uint)_currentMethod.Definition.GenericParameters.Count) 316return _currentMethod.Definition.GenericParameters[index]; 320_currentMethod.Definition.GenericParameters.FirstOrDefault(candidate => candidate.Name == name); 361if (_currentMethod is null || context.HasSyntaxError) 367security?.Parent = _currentMethod.Definition; 380if (_currentMethod is null || context.HasSyntaxError) 388attribute.Owner ??= _currentMethod.Definition;
Actions\GrammarActions.MethodBodies.ExceptionHandling.cs (18)
29if (_currentMethod is not null) 32CloseLexicalScopes(_currentMethod, 0); 33EmitLocalSignature(_currentMethod); 54if (_currentMethod is not null) 57new ScopeFrame(context, CurrentMethodBodyOffset, _currentMethod.OpenScopes.Count)); 58OpenLexicalScope(_currentMethod); 74if (_currentMethod is not null) 76CloseLexicalScopes(_currentMethod, frame.OpenScopeCount); 86if (_currentMethod is null || 156if (_currentMethod is null || 214Debug.Assert(_currentMethod is not null); 215_currentMethod.Definition.ExceptionRegions.Add(region); 255Debug.Assert(_currentMethod is not null); 256return GetOrCreateMethodLabel(_currentMethod, name, reference); 261Debug.Assert(_currentMethod is not null); 262LabelHandle label = _currentMethod.Definition.MethodBody.DefineLabel(); 263_currentMethod.Definition.MethodBody.MarkLabel(label, offset); 267private int CurrentMethodBodyOffset => _currentMethod?.Definition.MethodBody.Offset ?? 0;
Actions\GrammarActions.Signatures.Types.cs (3)
149if (_currentMethod is null) 159for (int i = 0; i < _currentMethod.Definition.GenericParameters.Count; i++) 161if (_currentMethod.Definition.GenericParameters[i].Name == name)