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)
131
if (
_currentMethod
is null || _currentDocumentPath is null)
136
int ilOffset =
_currentMethod
.Definition.MethodBody.Offset;
137
EntityRegistry.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));
249
if (
_currentMethod
is not null)
251
_currentMethod
.Definition.MaxStack = ParseInt32(valueToken);
257
if (
_currentMethod
is not null)
259
_entityRegistry.EntryPoint =
_currentMethod
.Definition;
265
if (
_currentMethod
is not null)
267
_currentMethod
.Definition.BodyAttributes = MethodBodyAttributes.InitLocals;
273
if (
_currentMethod
is not { } method)
333
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 (36)
23
if (hasSyntaxError ||
_currentMethod
is null || context.arguments is null)
30
_currentMethod
.Definition.BodyAttributes = MethodBodyAttributes.InitLocals;
34
if (
_currentMethod
.LocalsScopes.Count > 0)
36
localsScope =
_currentMethod
.LocalsScopes[^1];
41
_currentMethod
.LocalsScopes.Add(localsScope);
50
localsScope.TryAdd(local.Name,
_currentMethod
.AllLocals.Count);
53
_currentMethod
.AllLocals.Add(local);
64
if (
_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;
106
if (
_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 ||
148
BlobBuilder signature =
_currentMethod
.Definition.MethodSignature!;
168
EntityRegistry.CreateUnrecordedMethodImplementation(
_currentMethod
.Definition, declaration));
220
if (hasSyntaxError ||
_currentMethod
is null)
259
_currentMethod
.Definition.GenericParameterConstraints.Add(constraint);
272
if ((uint)index >= (uint)
_currentMethod
.Definition.Parameters.Count)
281
EntityRegistry.ParameterEntity parameterEntity =
_currentMethod
.Definition.Parameters[index];
313
Debug.Assert(
_currentMethod
is not null);
317
if ((uint)index >= (uint)
_currentMethod
.Definition.GenericParameters.Count)
326
return
_currentMethod
.Definition.GenericParameters[index];
330
_currentMethod
.Definition.GenericParameters.FirstOrDefault(candidate => candidate.Name == name);
371
if (
_currentMethod
is null || context.HasSyntaxError)
377
security?.Parent =
_currentMethod
.Definition;
390
if (
_currentMethod
is null || context.HasSyntaxError)
398
attribute.Owner ??=
_currentMethod
.Definition;
Actions\GrammarActions.MethodBodies.ExceptionHandling.cs (21)
31
if (
_currentMethod
is not null)
33
if (
_currentMethod
.AllLocals.Count > 0)
38
encoder.LocalVariableSignature(
_currentMethod
.AllLocals.Count);
39
foreach (SignatureArg local in
_currentMethod
.AllLocals)
44
_currentMethod
.Definition.LocalsSignature =
64
if (
_currentMethod
is not null)
67
new ScopeFrame(context, CurrentMethodBodyOffset,
_currentMethod
.LocalsScopes.Count));
79
if (
_currentMethod
is not null && frame.LocalsScopeCount <
_currentMethod
.LocalsScopes.Count)
81
_currentMethod
.LocalsScopes.RemoveRange(
83
_currentMethod
.LocalsScopes.Count - frame.LocalsScopeCount);
93
if (
_currentMethod
is null ||
163
if (
_currentMethod
is null ||
221
Debug.Assert(
_currentMethod
is not null);
222
_currentMethod
.Definition.ExceptionRegions.Add(region);
262
Debug.Assert(
_currentMethod
is not null);
263
return GetOrCreateMethodLabel(
_currentMethod
, name, reference);
268
Debug.Assert(
_currentMethod
is not null);
269
LabelHandle label =
_currentMethod
.Definition.MethodBody.DefineLabel();
270
_currentMethod
.Definition.MethodBody.MarkLabel(label, offset);
274
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)