1 instantiation of Label
ILAssembler (1)
MethodBodyWriter.cs (1)
32
return new
Label
(_labels.Count);
53 references to Label
ILAssembler (53)
Actions\GrammarActions.Conversions.cs (2)
21
using LabelHandle = ILAssembler.MethodBodyWriter.
Label
;
218
public Dictionary<string,
LabelHandle
> Labels { get; } = new();
Actions\GrammarActions.Instructions.cs (5)
14
using LabelHandle = ILAssembler.MethodBodyWriter.
Label
;
160
LabelHandle
label = GetOrCreateMethodLabel(method, labelName, opcodeToken);
300
if (!method.Labels.TryGetValue(labelName, out
LabelHandle
label))
330
List<(
LabelHandle
Label, int? Offset)> labels = new(builder.Operands.Count);
340
LabelHandle
label = GetOrCreateMethodLabel(
Actions\GrammarActions.MethodBodies.cs (3)
6
using LabelHandle = ILAssembler.MethodBodyWriter.
Label
;
32
private static
LabelHandle
GetOrCreateMethodLabel(
37
if (!method.Labels.TryGetValue(name, out
LabelHandle
label))
Actions\GrammarActions.MethodBodies.ExceptionHandling.cs (14)
9
using LabelHandle = ILAssembler.MethodBodyWriter.
Label
;
96
(
LabelHandle
Start,
LabelHandle
End)? tryRange = ResolveExceptionRange(tryRangeValue);
105
(
LabelHandle
Start,
LabelHandle
End)? handlerRange = ResolveExceptionRange(clause.Handler);
139
when ResolveExceptionFilter(filterClause.Filter) is
LabelHandle
filterStart:
218
private (
LabelHandle
Start,
LabelHandle
End)? ResolveExceptionRange(ExceptionRangeValue range)
231
private
LabelHandle
? ResolveExceptionFilter(ExceptionFilterValue filter)
240
private (
LabelHandle
Start,
LabelHandle
End) GetScopeRange(CILParser.ScopeBlockContext context)
253
private
LabelHandle
GetOrCreateMethodLabel(string name, IToken reference)
259
private
LabelHandle
DefineMethodLabelAtOffset(int offset)
262
LabelHandle
label = _currentMethod.Definition.MethodBody.DefineLabel();
EntityRegistry.cs (22)
11
using LabelHandle = ILAssembler.MethodBodyWriter.
Label
;
2326
internal abstract record ExceptionRegion(
LabelHandle
TryStart,
LabelHandle
TryEnd,
LabelHandle
HandlerStart,
LabelHandle
HandlerEnd, Location Location)
2328
internal sealed record CatchRegion(
LabelHandle
TryStart,
LabelHandle
TryEnd,
LabelHandle
HandlerStart,
LabelHandle
HandlerEnd, TypeEntity CatchType, Location Location) : ExceptionRegion(TryStart, TryEnd, HandlerStart, HandlerEnd, Location);
2329
internal sealed record FinallyRegion(
LabelHandle
TryStart,
LabelHandle
TryEnd,
LabelHandle
HandlerStart,
LabelHandle
HandlerEnd, Location Location) : ExceptionRegion(TryStart, TryEnd, HandlerStart, HandlerEnd, Location);
2330
internal sealed record FaultRegion(
LabelHandle
TryStart,
LabelHandle
TryEnd,
LabelHandle
HandlerStart,
LabelHandle
HandlerEnd, Location Location) : ExceptionRegion(TryStart, TryEnd, HandlerStart, HandlerEnd, Location);
2331
internal sealed record FilterRegion(
LabelHandle
TryStart,
LabelHandle
TryEnd,
LabelHandle
HandlerStart,
LabelHandle
HandlerEnd,
LabelHandle
FilterStart, Location Location) : ExceptionRegion(TryStart, TryEnd, HandlerStart, HandlerEnd, Location);
MethodBodyWriter.cs (7)
20
private readonly record struct BranchFixup(Blob Operand,
Label
Target, int EndOffset, ILOpCode OpCode, Location Location);
29
public
Label
DefineLabel()
35
public void MarkLabel(
Label
label) => MarkLabel(label, Offset);
37
public void MarkLabel(
Label
label, int offset) => _labels[label.Id - 1] = offset;
39
private int GetLabelOffset(
Label
label)
158
public void Branch(ILOpCode code,
Label
target, bool optimize, Location location)
186
public void Switch(IReadOnlyList<(
Label
Label, int? Offset)> targets, Location location)