1 instantiation of Label
ILAssembler (1)
MethodBodyWriter.cs (1)
32return new Label(_labels.Count);
53 references to Label
ILAssembler (53)
Actions\GrammarActions.Conversions.cs (2)
21using LabelHandle = ILAssembler.MethodBodyWriter.Label; 203public Dictionary<string, LabelHandle> Labels { get; } = new();
Actions\GrammarActions.Instructions.cs (5)
13using LabelHandle = ILAssembler.MethodBodyWriter.Label; 159LabelHandle label = GetOrCreateMethodLabel(method, labelName, opcodeToken); 280if (!method.Labels.TryGetValue(labelName, out LabelHandle label)) 310List<(LabelHandle Label, int? Offset)> labels = new(builder.Operands.Count); 320LabelHandle label = GetOrCreateMethodLabel(
Actions\GrammarActions.MethodBodies.cs (3)
6using LabelHandle = ILAssembler.MethodBodyWriter.Label; 32private static LabelHandle GetOrCreateMethodLabel( 37if (!method.Labels.TryGetValue(name, out LabelHandle label))
Actions\GrammarActions.MethodBodies.ExceptionHandling.cs (14)
11using LabelHandle = ILAssembler.MethodBodyWriter.Label; 103(LabelHandle Start, LabelHandle End)? tryRange = ResolveExceptionRange(tryRangeValue); 112(LabelHandle Start, LabelHandle End)? handlerRange = ResolveExceptionRange(clause.Handler); 146when ResolveExceptionFilter(filterClause.Filter) is LabelHandle filterStart: 225private (LabelHandle Start, LabelHandle End)? ResolveExceptionRange(ExceptionRangeValue range) 238private LabelHandle? ResolveExceptionFilter(ExceptionFilterValue filter) 247private (LabelHandle Start, LabelHandle End) GetScopeRange(CILParser.ScopeBlockContext context) 260private LabelHandle GetOrCreateMethodLabel(string name, IToken reference) 266private LabelHandle DefineMethodLabelAtOffset(int offset) 269LabelHandle label = _currentMethod.Definition.MethodBody.DefineLabel();
EntityRegistry.cs (22)
11using LabelHandle = ILAssembler.MethodBodyWriter.Label; 2201internal abstract record ExceptionRegion(LabelHandle TryStart, LabelHandle TryEnd, LabelHandle HandlerStart, LabelHandle HandlerEnd, Location Location) 2203internal sealed record CatchRegion(LabelHandle TryStart, LabelHandle TryEnd, LabelHandle HandlerStart, LabelHandle HandlerEnd, TypeEntity CatchType, Location Location) : ExceptionRegion(TryStart, TryEnd, HandlerStart, HandlerEnd, Location); 2204internal sealed record FinallyRegion(LabelHandle TryStart, LabelHandle TryEnd, LabelHandle HandlerStart, LabelHandle HandlerEnd, Location Location) : ExceptionRegion(TryStart, TryEnd, HandlerStart, HandlerEnd, Location); 2205internal sealed record FaultRegion(LabelHandle TryStart, LabelHandle TryEnd, LabelHandle HandlerStart, LabelHandle HandlerEnd, Location Location) : ExceptionRegion(TryStart, TryEnd, HandlerStart, HandlerEnd, Location); 2206internal sealed record FilterRegion(LabelHandle TryStart, LabelHandle TryEnd, LabelHandle HandlerStart, LabelHandle HandlerEnd, LabelHandle FilterStart, Location Location) : ExceptionRegion(TryStart, TryEnd, HandlerStart, HandlerEnd, Location);
MethodBodyWriter.cs (7)
20private readonly record struct BranchFixup(Blob Operand, Label Target, int EndOffset, ILOpCode OpCode, Location Location); 29public Label DefineLabel() 35public void MarkLabel(Label label) => MarkLabel(label, Offset); 37public void MarkLabel(Label label, int offset) => _labels[label.Id - 1] = offset; 39private int GetLabelOffset(Label label) 158public void Branch(ILOpCode code, Label target, bool optimize, Location location) 186public void Switch(IReadOnlyList<(Label Label, int? Offset)> targets, Location location)