4 writes to _currentMethod
ILAssembler (4)
Actions\GrammarActions.MethodBodies.ExceptionHandling.cs (1)
49_currentMethod = null;
Actions\GrammarActions.MethodHeaders.cs (3)
27_currentMethod = new(methodDefinition); 125_currentMethod = new(methodDefinition); 130_currentMethod = null;
81 references to _currentMethod
ILAssembler (81)
Actions\GrammarActions.cs (1)
22_currentMethod is null
Actions\GrammarActions.Data.cs (1)
20_currentMethod is not null));
Actions\GrammarActions.Debug.cs (4)
131if (_currentMethod is null || _currentDocumentPath is null) 136int ilOffset = _currentMethod.Definition.MethodBody.Offset; 137EntityRegistry.MethodDebugInfo debugInfo = _currentMethod.Definition.DebugInfo; 225(context.Parent is not CILParser.MethodDeclContext || _currentMethod is not null);
Actions\GrammarActions.Instructions.cs (9)
244_currentMethod?.Definition.MethodBody.CodeBuilder.WriteByte((byte)ParseInt32(valueToken)); 249if (_currentMethod is not null) 251_currentMethod.Definition.MaxStack = ParseInt32(valueToken); 257if (_currentMethod is not null) 259_entityRegistry.EntryPoint = _currentMethod.Definition; 265if (_currentMethod is not null) 267_currentMethod.Definition.BodyAttributes = MethodBodyAttributes.InitLocals; 273if (_currentMethod is not { } method) 333if (_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 (36)
23if (hasSyntaxError || _currentMethod is null || context.arguments is null) 30_currentMethod.Definition.BodyAttributes = MethodBodyAttributes.InitLocals; 34if (_currentMethod.LocalsScopes.Count > 0) 36localsScope = _currentMethod.LocalsScopes[^1]; 41_currentMethod.LocalsScopes.Add(localsScope); 50localsScope.TryAdd(local.Name, _currentMethod.AllLocals.Count); 53_currentMethod.AllLocals.Add(local); 64if (_currentMethod is null) 69_currentMethod.Definition.ExportOrdinal = -1; 70_currentMethod.Definition.ExportAlias = null; 71_exportDirectiveContexts.Remove(_currentMethod.Definition); 94_currentMethod.Definition.ExportOrdinal = ordinal; 95_currentMethod.Definition.ExportAlias = alias; 96_exportDirectiveContexts[_currentMethod.Definition] = context; 106if (_currentMethod is null) 111_currentMethod.Definition.VTableEntry = 0; 112_currentMethod.Definition.VTableSlot = 0; 113_vtableEntryDirectiveContexts.Remove(_currentMethod.Definition); 127_currentMethod.Definition.VTableEntry = vtableEntry; 128_currentMethod.Definition.VTableSlot = vtableSlot; 129_vtableEntryDirectiveContexts[_currentMethod.Definition] = context; 140_currentMethod is null || 148BlobBuilder signature = _currentMethod.Definition.MethodSignature!; 168EntityRegistry.CreateUnrecordedMethodImplementation(_currentMethod.Definition, declaration)); 220if (hasSyntaxError || _currentMethod is null) 259_currentMethod.Definition.GenericParameterConstraints.Add(constraint); 272if ((uint)index >= (uint)_currentMethod.Definition.Parameters.Count) 281EntityRegistry.ParameterEntity parameterEntity = _currentMethod.Definition.Parameters[index]; 313Debug.Assert(_currentMethod is not null); 317if ((uint)index >= (uint)_currentMethod.Definition.GenericParameters.Count) 326return _currentMethod.Definition.GenericParameters[index]; 330_currentMethod.Definition.GenericParameters.FirstOrDefault(candidate => candidate.Name == name); 371if (_currentMethod is null || context.HasSyntaxError) 377security?.Parent = _currentMethod.Definition; 390if (_currentMethod is null || context.HasSyntaxError) 398attribute.Owner ??= _currentMethod.Definition;
Actions\GrammarActions.MethodBodies.ExceptionHandling.cs (21)
31if (_currentMethod is not null) 33if (_currentMethod.AllLocals.Count > 0) 38encoder.LocalVariableSignature(_currentMethod.AllLocals.Count); 39foreach (SignatureArg local in _currentMethod.AllLocals) 44_currentMethod.Definition.LocalsSignature = 64if (_currentMethod is not null) 67new ScopeFrame(context, CurrentMethodBodyOffset, _currentMethod.LocalsScopes.Count)); 79if (_currentMethod is not null && frame.LocalsScopeCount < _currentMethod.LocalsScopes.Count) 81_currentMethod.LocalsScopes.RemoveRange( 83_currentMethod.LocalsScopes.Count - frame.LocalsScopeCount); 93if (_currentMethod is null || 163if (_currentMethod is null || 221Debug.Assert(_currentMethod is not null); 222_currentMethod.Definition.ExceptionRegions.Add(region); 262Debug.Assert(_currentMethod is not null); 263return GetOrCreateMethodLabel(_currentMethod, name, reference); 268Debug.Assert(_currentMethod is not null); 269LabelHandle label = _currentMethod.Definition.MethodBody.DefineLabel(); 270_currentMethod.Definition.MethodBody.MarkLabel(label, offset); 274private 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)