1 instantiation of Label
Microsoft.DotNet.ILAssembler (1)
MethodBodyWriter.cs (1)
32
return new
Label
(_labels.Count);
53 references to Label
Microsoft.DotNet.ILAssembler (53)
Actions\GrammarActions.Conversions.cs (2)
21
using LabelHandle = Microsoft.DotNet.ILAssembler.MethodBodyWriter.
Label
;
218
public Dictionary<string,
LabelHandle
> Labels { get; } = new();
Actions\GrammarActions.Instructions.cs (5)
15
using LabelHandle = Microsoft.DotNet.ILAssembler.MethodBodyWriter.
Label
;
161
LabelHandle
label = GetOrCreateMethodLabel(method, labelName, opcodeToken);
320
if (!method.Labels.TryGetValue(labelName, out
LabelHandle
label))
350
List<(
LabelHandle
Label, int? Offset)> labels = new(builder.Operands.Count);
360
LabelHandle
label = GetOrCreateMethodLabel(
Actions\GrammarActions.MethodBodies.cs (3)
7
using LabelHandle = Microsoft.DotNet.ILAssembler.MethodBodyWriter.
Label
;
33
private static
LabelHandle
GetOrCreateMethodLabel(
38
if (!method.Labels.TryGetValue(name, out
LabelHandle
label))
Actions\GrammarActions.MethodBodies.ExceptionHandling.cs (14)
9
using LabelHandle = Microsoft.DotNet.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 = Microsoft.DotNet.ILAssembler.MethodBodyWriter.
Label
;
2495
internal abstract record ExceptionRegion(
LabelHandle
TryStart,
LabelHandle
TryEnd,
LabelHandle
HandlerStart,
LabelHandle
HandlerEnd, Location Location)
2497
internal sealed record CatchRegion(
LabelHandle
TryStart,
LabelHandle
TryEnd,
LabelHandle
HandlerStart,
LabelHandle
HandlerEnd, TypeEntity CatchType, Location Location) : ExceptionRegion(TryStart, TryEnd, HandlerStart, HandlerEnd, Location);
2498
internal sealed record FinallyRegion(
LabelHandle
TryStart,
LabelHandle
TryEnd,
LabelHandle
HandlerStart,
LabelHandle
HandlerEnd, Location Location) : ExceptionRegion(TryStart, TryEnd, HandlerStart, HandlerEnd, Location);
2499
internal sealed record FaultRegion(
LabelHandle
TryStart,
LabelHandle
TryEnd,
LabelHandle
HandlerStart,
LabelHandle
HandlerEnd, Location Location) : ExceptionRegion(TryStart, TryEnd, HandlerStart, HandlerEnd, Location);
2500
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)
160
public void Branch(ILOpCode code,
Label
target, bool optimize, Location location)
188
public void Switch(IReadOnlyList<(
Label
Label, int? Offset)> targets, Location location)