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)
172
if (
_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));
250
if (
_currentMethod
is not null)
252
_currentMethod
.Definition.MaxStack = ParseInt32(valueToken);
258
if (
_currentMethod
is null)
272
if (!
_currentMethod
.Definition.MethodAttributes.HasFlag(MethodAttributes.Static))
280
_entityRegistry.EntryPoint =
_currentMethod
.Definition;
285
if (
_currentMethod
is not null)
287
_currentMethod
.Definition.BodyAttributes = MethodBodyAttributes.InitLocals;
293
if (
_currentMethod
is not { } method)
359
if (
_currentMethod
is not { } method)
Actions\GrammarActions.MethodBodies.cs (6)
14
if (
_currentMethod
is null)
20
foreach (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)
28
if (hasSyntaxError ||
_currentMethod
is null || context.arguments is null)
35
_currentMethod
.Definition.BodyAttributes = MethodBodyAttributes.InitLocals;
38
DeclareLocals(
_currentMethod
, ApplyExplicitLocalSlots(context.arguments.Value), context);
54
if (
_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;
96
if (
_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 ||
138
BlobBuilder signature =
_currentMethod
.Definition.MethodSignature!;
158
EntityRegistry.CreateUnrecordedMethodImplementation(
_currentMethod
.Definition, declaration));
210
if (hasSyntaxError ||
_currentMethod
is null)
249
_currentMethod
.Definition.GenericParameterConstraints.Add(constraint);
262
if ((uint)index >= (uint)
_currentMethod
.Definition.Parameters.Count)
271
EntityRegistry.ParameterEntity parameterEntity =
_currentMethod
.Definition.Parameters[index];
303
Debug.Assert(
_currentMethod
is not null);
307
if ((uint)index >= (uint)
_currentMethod
.Definition.GenericParameters.Count)
316
return
_currentMethod
.Definition.GenericParameters[index];
320
_currentMethod
.Definition.GenericParameters.FirstOrDefault(candidate => candidate.Name == name);
361
if (
_currentMethod
is null || context.HasSyntaxError)
367
security?.Parent =
_currentMethod
.Definition;
380
if (
_currentMethod
is null || context.HasSyntaxError)
388
attribute.Owner ??=
_currentMethod
.Definition;
Actions\GrammarActions.MethodBodies.ExceptionHandling.cs (18)
29
if (
_currentMethod
is not null)
32
CloseLexicalScopes(
_currentMethod
, 0);
33
EmitLocalSignature(
_currentMethod
);
54
if (
_currentMethod
is not null)
57
new ScopeFrame(context, CurrentMethodBodyOffset,
_currentMethod
.OpenScopes.Count));
58
OpenLexicalScope(
_currentMethod
);
74
if (
_currentMethod
is not null)
76
CloseLexicalScopes(
_currentMethod
, frame.OpenScopeCount);
86
if (
_currentMethod
is null ||
156
if (
_currentMethod
is null ||
214
Debug.Assert(
_currentMethod
is not null);
215
_currentMethod
.Definition.ExceptionRegions.Add(region);
255
Debug.Assert(
_currentMethod
is not null);
256
return GetOrCreateMethodLabel(
_currentMethod
, name, reference);
261
Debug.Assert(
_currentMethod
is not null);
262
LabelHandle label =
_currentMethod
.Definition.MethodBody.DefineLabel();
263
_currentMethod
.Definition.MethodBody.MarkLabel(label, offset);
267
private int CurrentMethodBodyOffset =>
_currentMethod
?.Definition.MethodBody.Offset ?? 0;
Actions\GrammarActions.Signatures.Types.cs (3)
149
if (
_currentMethod
is null)
159
for (int i = 0; i <
_currentMethod
.Definition.GenericParameters.Count; i++)
161
if (
_currentMethod
.Definition.GenericParameters[i].Name == name)