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; 218public Dictionary<string, LabelHandle> Labels { get; } = new();
Actions\GrammarActions.Instructions.cs (5)
14using LabelHandle = ILAssembler.MethodBodyWriter.Label; 160LabelHandle label = GetOrCreateMethodLabel(method, labelName, opcodeToken); 300if (!method.Labels.TryGetValue(labelName, out LabelHandle label)) 330List<(LabelHandle Label, int? Offset)> labels = new(builder.Operands.Count); 340LabelHandle 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)
9using LabelHandle = ILAssembler.MethodBodyWriter.Label; 96(LabelHandle Start, LabelHandle End)? tryRange = ResolveExceptionRange(tryRangeValue); 105(LabelHandle Start, LabelHandle End)? handlerRange = ResolveExceptionRange(clause.Handler); 139when ResolveExceptionFilter(filterClause.Filter) is LabelHandle filterStart: 218private (LabelHandle Start, LabelHandle End)? ResolveExceptionRange(ExceptionRangeValue range) 231private LabelHandle? ResolveExceptionFilter(ExceptionFilterValue filter) 240private (LabelHandle Start, LabelHandle End) GetScopeRange(CILParser.ScopeBlockContext context) 253private LabelHandle GetOrCreateMethodLabel(string name, IToken reference) 259private LabelHandle DefineMethodLabelAtOffset(int offset) 262LabelHandle label = _currentMethod.Definition.MethodBody.DefineLabel();
EntityRegistry.cs (22)
11using LabelHandle = ILAssembler.MethodBodyWriter.Label; 2326internal abstract record ExceptionRegion(LabelHandle TryStart, LabelHandle TryEnd, LabelHandle HandlerStart, LabelHandle HandlerEnd, Location Location) 2328internal sealed record CatchRegion(LabelHandle TryStart, LabelHandle TryEnd, LabelHandle HandlerStart, LabelHandle HandlerEnd, TypeEntity CatchType, Location Location) : ExceptionRegion(TryStart, TryEnd, HandlerStart, HandlerEnd, Location); 2329internal sealed record FinallyRegion(LabelHandle TryStart, LabelHandle TryEnd, LabelHandle HandlerStart, LabelHandle HandlerEnd, Location Location) : ExceptionRegion(TryStart, TryEnd, HandlerStart, HandlerEnd, Location); 2330internal sealed record FaultRegion(LabelHandle TryStart, LabelHandle TryEnd, LabelHandle HandlerStart, LabelHandle HandlerEnd, Location Location) : ExceptionRegion(TryStart, TryEnd, HandlerStart, HandlerEnd, Location); 2331internal 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)