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
;
203
public Dictionary<string,
LabelHandle
> Labels { get; } = new();
Actions\GrammarActions.Instructions.cs (5)
13
using LabelHandle = ILAssembler.MethodBodyWriter.
Label
;
159
LabelHandle
label = GetOrCreateMethodLabel(method, labelName, opcodeToken);
280
if (!method.Labels.TryGetValue(labelName, out
LabelHandle
label))
310
List<(
LabelHandle
Label, int? Offset)> labels = new(builder.Operands.Count);
320
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)
11
using LabelHandle = ILAssembler.MethodBodyWriter.
Label
;
103
(
LabelHandle
Start,
LabelHandle
End)? tryRange = ResolveExceptionRange(tryRangeValue);
112
(
LabelHandle
Start,
LabelHandle
End)? handlerRange = ResolveExceptionRange(clause.Handler);
146
when ResolveExceptionFilter(filterClause.Filter) is
LabelHandle
filterStart:
225
private (
LabelHandle
Start,
LabelHandle
End)? ResolveExceptionRange(ExceptionRangeValue range)
238
private
LabelHandle
? ResolveExceptionFilter(ExceptionFilterValue filter)
247
private (
LabelHandle
Start,
LabelHandle
End) GetScopeRange(CILParser.ScopeBlockContext context)
260
private
LabelHandle
GetOrCreateMethodLabel(string name, IToken reference)
266
private
LabelHandle
DefineMethodLabelAtOffset(int offset)
269
LabelHandle
label = _currentMethod.Definition.MethodBody.DefineLabel();
EntityRegistry.cs (22)
11
using LabelHandle = ILAssembler.MethodBodyWriter.
Label
;
2201
internal abstract record ExceptionRegion(
LabelHandle
TryStart,
LabelHandle
TryEnd,
LabelHandle
HandlerStart,
LabelHandle
HandlerEnd, Location Location)
2203
internal sealed record CatchRegion(
LabelHandle
TryStart,
LabelHandle
TryEnd,
LabelHandle
HandlerStart,
LabelHandle
HandlerEnd, TypeEntity CatchType, Location Location) : ExceptionRegion(TryStart, TryEnd, HandlerStart, HandlerEnd, Location);
2204
internal sealed record FinallyRegion(
LabelHandle
TryStart,
LabelHandle
TryEnd,
LabelHandle
HandlerStart,
LabelHandle
HandlerEnd, Location Location) : ExceptionRegion(TryStart, TryEnd, HandlerStart, HandlerEnd, Location);
2205
internal sealed record FaultRegion(
LabelHandle
TryStart,
LabelHandle
TryEnd,
LabelHandle
HandlerStart,
LabelHandle
HandlerEnd, Location Location) : ExceptionRegion(TryStart, TryEnd, HandlerStart, HandlerEnd, Location);
2206
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)