2 types derived from LabelSymbol
Microsoft.CodeAnalysis.CSharp (2)
Symbols\Source\SourceLabelSymbol.cs (1)
13internal sealed class SourceLabelSymbol : LabelSymbol
Symbols\Synthesized\GeneratedLabelSymbol.cs (1)
12internal sealed class GeneratedLabelSymbol : LabelSymbol
351 references to LabelSymbol
Microsoft.CodeAnalysis.CSharp (351)
Binder\Binder_Expressions.cs (2)
2214var symbol = (LabelSymbol)result.Symbols.First();
Binder\Binder_Patterns.cs (4)
54LabelSymbol whenTrueLabel = new GeneratedLabelSymbol("isPatternSuccess"); 55LabelSymbol whenFalseLabel = new GeneratedLabelSymbol("isPatternFailure"); 129static bool? getConstantResult(BoundDecisionDag decisionDag, bool negated, LabelSymbol whenTrueLabel, LabelSymbol whenFalseLabel)
Binder\Binder_Statements.cs (5)
477var symbol = result.Symbols.Count > 0 && result.IsMultiViable ? 478(LabelSymbol)result.Symbols.First() : 519var symbol = boundLabel.Label; 3956internal virtual ImmutableArray<LabelSymbol> Labels 3960return ImmutableArray<LabelSymbol>.Empty;
Binder\BlockBinder.cs (3)
51protected override ImmutableArray<LabelSymbol> BuildLabels() 53ArrayBuilder<LabelSymbol> labels = null; 55return (labels != null) ? labels.ToImmutableAndFree() : ImmutableArray<LabelSymbol>.Empty;
Binder\DecisionDagBuilder.cs (11)
62private readonly LabelSymbol _defaultLabel; 70private DecisionDagBuilder(CSharpCompilation compilation, LabelSymbol defaultLabel, bool forLowering, BindingDiagnosticBag diagnostics) 87LabelSymbol defaultLabel, 103LabelSymbol defaultLabel, 119LabelSymbol whenTrueLabel, 120LabelSymbol whenFalseLabel, 132LabelSymbol whenTrueLabel) 186LabelSymbol label) 984BoundDecisionDagNode finalState(SyntaxNode syntax, LabelSymbol label, ImmutableArray<BoundPatternBinding> bindings) 1836public readonly LabelSymbol CaseLabel; 1843LabelSymbol CaseLabel)
Binder\EmbeddedStatementBinder.cs (3)
53protected override ImmutableArray<LabelSymbol> BuildLabels() 55ArrayBuilder<LabelSymbol> labels = null; 58return labels?.ToImmutableAndFree() ?? ImmutableArray<LabelSymbol>.Empty;
Binder\LocalScopeBinder.cs (11)
20private ImmutableArray<LabelSymbol> _labels; 68internal sealed override ImmutableArray<LabelSymbol> Labels 74ImmutableInterlocked.InterlockedCompareExchange(ref _labels, BuildLabels(), default(ImmutableArray<LabelSymbol>)); 81protected virtual ImmutableArray<LabelSymbol> BuildLabels() 83return ImmutableArray<LabelSymbol>.Empty; 114private SmallDictionary<string, LabelSymbol> _lazyLabelsMap; 115private SmallDictionary<string, LabelSymbol> LabelsMap 307protected void BuildLabels(SyntaxList<StatementSyntax> statements, ref ArrayBuilder<LabelSymbol> labels) 316internal static void BuildLabels(MethodSymbol containingMethod, StatementSyntax statement, ref ArrayBuilder<LabelSymbol> labels) 323labels = ArrayBuilder<LabelSymbol>.GetInstance(); 386LabelSymbol labelSymbol;
Binder\ScriptLocalScopeBinder.cs (5)
29protected override ImmutableArray<LabelSymbol> BuildLabels() 57private ImmutableArray<LabelSymbol> _lazyLabels; 70internal ImmutableArray<LabelSymbol> GetLabels() 79private static ImmutableArray<LabelSymbol> GetLabels(SynthesizedInteractiveInitializerMethod scriptInitializer, CompilationUnitSyntax syntax) 81var builder = ArrayBuilder<LabelSymbol>.GetInstance();
Binder\SimpleProgramBinder.cs (3)
64protected override ImmutableArray<LabelSymbol> BuildLabels() 66ArrayBuilder<LabelSymbol>? labels = null; 76return labels?.ToImmutableAndFree() ?? ImmutableArray<LabelSymbol>.Empty;
Binder\SimpleProgramUnitBinder.cs (2)
44protected override ImmutableArray<LabelSymbol> BuildLabels() 46return ImmutableArray<LabelSymbol>.Empty;
Binder\SwitchBinder.cs (9)
89private static Dictionary<object, SourceLabelSymbol> BuildLabelsByValue(ImmutableArray<LabelSymbol> labels) 170protected override ImmutableArray<LabelSymbol> BuildLabels() 175ArrayBuilder<LabelSymbol> labels = ArrayBuilder<LabelSymbol>.GetInstance(); 196private void BuildSwitchLabels(SyntaxList<SwitchLabelSyntax> labelsSyntax, Binder sectionBinder, ArrayBuilder<LabelSymbol> labels, BindingDiagnosticBag tempDiagnosticBag) 445private Dictionary<SyntaxNode, LabelSymbol> _labelsByNode; 446protected Dictionary<SyntaxNode, LabelSymbol> LabelsByNode 452var result = new Dictionary<SyntaxNode, LabelSymbol>(); 453foreach (var label in Labels)
Binder\SwitchBinder_Patterns.cs (4)
78static bool isSubsumed(BoundSwitchLabel switchLabel, ImmutableHashSet<LabelSymbol> reachableLabels) 190Dictionary<SyntaxNode, LabelSymbol> labelsByNode = LabelsByNode; 194LabelSymbol label = labelsByNode[labelSyntax]; 230LabelSymbol label,
Binder\SwitchExpressionBinder.cs (2)
33bool reportedNotExhaustive = CheckSwitchExpressionExhaustive(node, boundInputExpression, switchArms, out BoundDecisionDag decisionDag, out LabelSymbol? defaultLabel, diagnostics); 58[NotNullWhen(true)] out LabelSymbol? defaultLabel,
BoundTree\BoundDecisionDag.cs (3)
20private ImmutableHashSet<LabelSymbol> _reachableLabels; 40public ImmutableHashSet<LabelSymbol> ReachableLabels 46var result = ImmutableHashSet.CreateBuilder<LabelSymbol>(Symbols.SymbolEqualityComparer.ConsiderEverything);
BoundTree\BoundStatementExtensions.cs (1)
28internal static void AssertIsLabeledStatementWithLabel(this BoundStatement node, LabelSymbol label)
BoundTree\BoundSwitchExpression.cs (1)
12public BoundDecisionDag GetDecisionDagForLowering(CSharpCompilation compilation, out LabelSymbol? defaultLabel)
BoundTree\Constructors.cs (2)
590public BoundGotoStatement(SyntaxNode syntax, LabelSymbol label, bool hasErrors = false) 630public BoundTryStatement(SyntaxNode syntax, BoundBlock tryBlock, ImmutableArray<BoundCatchBlock> catchBlocks, BoundBlock? finallyBlockOpt, LabelSymbol? finallyLabelOpt = null)
BoundTree\LengthBasedStringSwitchData.cs (26)
87public readonly LabelSymbol? NullCaseLabel; 88public readonly ImmutableArray<(int value, LabelSymbol label)> LengthCaseLabels; 90public LengthJumpTable(LabelSymbol? nullCaseLabel, ImmutableArray<(int value, LabelSymbol label)> lengthCaseLabels) 101public readonly LabelSymbol Label; 103public readonly ImmutableArray<(char value, LabelSymbol label)> CharCaseLabels; 105internal CharJumpTable(LabelSymbol label, int selectedCharPosition, ImmutableArray<(char value, LabelSymbol label)> charCaseLabels) 117public readonly LabelSymbol Label; 118public readonly ImmutableArray<(string value, LabelSymbol label)> StringCaseLabels; 120internal StringJumpTable(LabelSymbol label, ImmutableArray<(string value, LabelSymbol label)> stringCaseLabels) 137internal static LengthBasedStringSwitchData Create(ImmutableArray<(ConstantValue value, LabelSymbol label)> inputCases) 141LabelSymbol? nullCaseLabel = null; 151var lengthCaseLabels = ArrayBuilder<(int value, LabelSymbol label)>.GetInstance(); 157var labelForLength = CreateAndRegisterCharJumpTables(stringLength, group.SelectAsArray(c => (c.value.StringValue!, c.label)), charJumpTables, stringJumpTables); 165private static LabelSymbol CreateAndRegisterCharJumpTables(int stringLength, ImmutableArray<(string value, LabelSymbol label)> casesWithGivenLength, 186var charCaseLabels = ArrayBuilder<(char value, LabelSymbol label)>.GetInstance(); 191LabelSymbol label = (stringLength == 1) 202static int selectBestCharacterIndex(int stringLength, ImmutableArray<(string value, LabelSymbol label)> caseLabels) 229static (int singleEntryCount, int largestBucket) positionScore(int position, ImmutableArray<(string value, LabelSymbol label)> caseLabels) 253private static LabelSymbol CreateAndRegisterStringJumpTable(ImmutableArray<(string value, LabelSymbol label)> cases, ArrayBuilder<StringJumpTable> stringJumpTables) 290void dump<T>(ImmutableArray<(T value, LabelSymbol label)> cases) 298string readable(LabelSymbol? label)
CodeGen\EmitStatement.cs (10)
1226LabelSymbol fallThroughLabel, 1317LabelSymbol fallThroughLabel, 1357void emitLengthDispatch(LengthBasedStringSwitchData lengthBasedSwitchInfo, LocalOrParameter keyTemp, LabelSymbol fallThroughLabel, SyntaxNode syntaxNode) 1391void emitCharDispatches(LengthBasedStringSwitchData lengthBasedSwitchInfo, LocalOrParameter keyTemp, LabelSymbol fallThroughLabel, SyntaxNode syntaxNode) 1429void emitFinalDispatches(LengthBasedStringSwitchData lengthBasedSwitchInfo, LocalOrParameter keyTemp, TypeSymbol keyType, LabelSymbol fallThroughLabel, SyntaxNode syntaxNode) 1456LabelSymbol fallThroughLabel, 1910private Dictionary<LabelSymbol, GeneratedLabelSymbol> _labelClones; 1957var casesBuilder = ArrayBuilder<(ConstantValue, LabelSymbol)>.GetInstance(); 1979private GeneratedLabelSymbol GetLabelClone(LabelSymbol label) 1984_labelClones = labelClones = new Dictionary<LabelSymbol, GeneratedLabelSymbol>();
CodeGen\Optimizer.cs (3)
1376foreach ((_, LabelSymbol label) in node.Cases) 1762private void RecordBranch(LabelSymbol label) 1779private void RecordLabel(LabelSymbol label)
Compilation\MemberSemanticModel.cs (2)
754foreach (var label in binder.Labels) 779foreach (var label in binder.Labels)
Compiler\MethodBodySynthesizer.Lowered.cs (4)
58LabelSymbol again = F.GenerateLabel("again"); 59LabelSymbol start = F.GenerateLabel("start"); 156LabelSymbol again = F.GenerateLabel("again"); 157LabelSymbol start = F.GenerateLabel("start");
FlowAnalysis\AbstractFlowPass.cs (12)
80private readonly PooledDictionary<LabelSymbol, TLocalState> _labels; 211_labels = PooledDictionary<LabelSymbol, TLocalState>.GetInstance(); 239foreach (var key in _labels.Keys) 401public readonly LabelSymbol? Label; 404public PendingBranch(BoundNode branch, TLocalState state, LabelSymbol label, bool isConditionalState = false, TLocalState stateWhenTrue = default, TLocalState stateWhenFalse = default) 515protected virtual TLocalState LabelState(LabelSymbol label) 716private void ResolveBreaks(TLocalState breakState, LabelSymbol label) 725private void ResolveContinues(LabelSymbol continueLabel) 738private void JoinPendingBranches(ref TLocalState state, LabelSymbol label) 766private bool ResolveBranches(LabelSymbol label, BoundStatement? target) 785protected virtual void ResolveBranch(PendingBranch pending, LabelSymbol label, BoundStatement? target, ref bool labelStateChanged) 3145protected void VisitLabel(LabelSymbol label, BoundStatement node)
FlowAnalysis\AbstractFlowPass.PendingBranchesCollection.cs (5)
17private PooledDictionary<LabelSymbol, ArrayBuilder<PendingBranch>>? _labeledBranches; 60internal ArrayBuilder<PendingBranch>? GetAndRemoveBranches(LabelSymbol? label) 88var label = branch.Label; 113private ArrayBuilder<PendingBranch> GetOrAddLabeledBranches(LabelSymbol label) 117_labeledBranches = PooledDictionary<LabelSymbol, ArrayBuilder<PendingBranch>>.GetInstance();
FlowAnalysis\AbstractFlowPass_Switch.cs (1)
136foreach ((_, LabelSymbol label) in node.Cases)
FlowAnalysis\AlwaysAssignedWalker.cs (4)
25private readonly HashSet<LabelSymbol> _labelsInside = new HashSet<LabelSymbol>(); 81protected override void ResolveBranch(PendingBranch pending, LabelSymbol label, BoundStatement target, ref bool labelStateChanged) 104private void ResolveLabel(BoundNode node, LabelSymbol label)
FlowAnalysis\ControlFlowPass.cs (5)
19private readonly PooledDictionary<LabelSymbol, BoundNode> _labelsDefined = PooledDictionary<LabelSymbol, BoundNode>.GetInstance(); 20private readonly PooledHashSet<LabelSymbol> _labelsUsed = PooledHashSet<LabelSymbol>.GetInstance(); 112protected override LocalState LabelState(LabelSymbol label)
FlowAnalysis\ExitPointsWalker.cs (2)
20private readonly ArrayBuilder<LabelSymbol> _labelsInside; 26_labelsInside = new ArrayBuilder<LabelSymbol>();
FlowAnalysis\NullableWalker_Patterns.cs (5)
336private PooledDictionary<LabelSymbol, (LocalState state, bool believedReachable)> LearnFromDecisionDag( 378var labelStateMap = PooledDictionary<LabelSymbol, (LocalState state, bool believedReachable)>.GetInstance(); 942PooledDictionary<LabelSymbol, (LocalState state, bool believedReachable)> labelStateMap, 987PooledDictionary<LabelSymbol, (LocalState state, bool believedReachable)> labelStateMap, 999LocalState getStateForArm(BoundSwitchExpressionArm arm, PooledDictionary<LabelSymbol, (LocalState state, bool believedReachable)> labelStateMap)
Generated\BoundNodes.xml.Generated.cs (48)
3704public BoundSwitchDispatch(SyntaxNode syntax, BoundExpression expression, ImmutableArray<(ConstantValue value, LabelSymbol label)> cases, LabelSymbol defaultLabel, LengthBasedStringSwitchData? lengthBasedStringSwitchDataOpt, bool hasErrors = false) 3719public ImmutableArray<(ConstantValue value, LabelSymbol label)> Cases { get; } 3720public LabelSymbol DefaultLabel { get; } 3726public BoundSwitchDispatch Update(BoundExpression expression, ImmutableArray<(ConstantValue value, LabelSymbol label)> cases, LabelSymbol defaultLabel, LengthBasedStringSwitchData? lengthBasedStringSwitchDataOpt) 4111public BoundTryStatement(SyntaxNode syntax, BoundBlock tryBlock, ImmutableArray<BoundCatchBlock> catchBlocks, BoundBlock? finallyBlockOpt, LabelSymbol? finallyLabelOpt, bool preferFaultHandler, bool hasErrors = false) 4128public LabelSymbol? FinallyLabelOpt { get; } 4134public BoundTryStatement Update(BoundBlock tryBlock, ImmutableArray<BoundCatchBlock> catchBlocks, BoundBlock? finallyBlockOpt, LabelSymbol? finallyLabelOpt, bool preferFaultHandler) 4561public BoundLabelStatement(SyntaxNode syntax, LabelSymbol label, bool hasErrors) 4570public BoundLabelStatement(SyntaxNode syntax, LabelSymbol label) 4579public LabelSymbol Label { get; } 4584public BoundLabelStatement Update(LabelSymbol label) 4598public BoundGotoStatement(SyntaxNode syntax, LabelSymbol label, BoundExpression? caseExpressionOpt, BoundLabel? labelExpressionOpt, bool hasErrors = false) 4609public LabelSymbol Label { get; } 4616public BoundGotoStatement Update(LabelSymbol label, BoundExpression? caseExpressionOpt, BoundLabel? labelExpressionOpt) 4630public BoundLabeledStatement(SyntaxNode syntax, LabelSymbol label, BoundStatement body, bool hasErrors = false) 4641public LabelSymbol Label { get; } 4647public BoundLabeledStatement Update(LabelSymbol label, BoundStatement body) 4661public BoundLabel(SyntaxNode syntax, LabelSymbol label, TypeSymbol? type, bool hasErrors) 4670public BoundLabel(SyntaxNode syntax, LabelSymbol label, TypeSymbol? type) 4679public LabelSymbol Label { get; } 4684public BoundLabel Update(LabelSymbol label, TypeSymbol? type) 4735public BoundConditionalGoto(SyntaxNode syntax, BoundExpression condition, bool jumpIfTrue, LabelSymbol label, bool hasErrors = false) 4749public LabelSymbol Label { get; } 4754public BoundConditionalGoto Update(BoundExpression condition, bool jumpIfTrue, LabelSymbol label) 4768protected BoundSwitchExpression(BoundKind kind, SyntaxNode syntax, BoundExpression expression, ImmutableArray<BoundSwitchExpressionArm> switchArms, BoundDecisionDag reachabilityDecisionDag, LabelSymbol? defaultLabel, bool reportedNotExhaustive, TypeSymbol? type, bool hasErrors = false) 4786public LabelSymbol? DefaultLabel { get; } 4792public BoundSwitchExpressionArm(SyntaxNode syntax, ImmutableArray<LocalSymbol> locals, BoundPattern pattern, BoundExpression? whenClause, BoundExpression value, LabelSymbol label, bool hasErrors = false) 4812public LabelSymbol Label { get; } 4817public BoundSwitchExpressionArm Update(ImmutableArray<LocalSymbol> locals, BoundPattern pattern, BoundExpression? whenClause, BoundExpression value, LabelSymbol label) 4831public BoundUnconvertedSwitchExpression(SyntaxNode syntax, BoundExpression expression, ImmutableArray<BoundSwitchExpressionArm> switchArms, BoundDecisionDag reachabilityDecisionDag, LabelSymbol? defaultLabel, bool reportedNotExhaustive, TypeSymbol? type, bool hasErrors = false) 4845public BoundUnconvertedSwitchExpression Update(BoundExpression expression, ImmutableArray<BoundSwitchExpressionArm> switchArms, BoundDecisionDag reachabilityDecisionDag, LabelSymbol? defaultLabel, bool reportedNotExhaustive, TypeSymbol? type) 4859public BoundConvertedSwitchExpression(SyntaxNode syntax, TypeSymbol? naturalTypeOpt, bool wasTargetTyped, BoundExpression expression, ImmutableArray<BoundSwitchExpressionArm> switchArms, BoundDecisionDag reachabilityDecisionDag, LabelSymbol? defaultLabel, bool reportedNotExhaustive, TypeSymbol type, bool hasErrors = false) 4879public BoundConvertedSwitchExpression Update(TypeSymbol? naturalTypeOpt, bool wasTargetTyped, BoundExpression expression, ImmutableArray<BoundSwitchExpressionArm> switchArms, BoundDecisionDag reachabilityDecisionDag, LabelSymbol? defaultLabel, bool reportedNotExhaustive, TypeSymbol type) 5035public BoundLeafDecisionDagNode(SyntaxNode syntax, LabelSymbol label, bool hasErrors) 5044public BoundLeafDecisionDagNode(SyntaxNode syntax, LabelSymbol label) 5053public LabelSymbol Label { get; } 5058public BoundLeafDecisionDagNode Update(LabelSymbol label) 5579public BoundSwitchLabel(SyntaxNode syntax, LabelSymbol label, BoundPattern pattern, BoundExpression? whenClause, bool hasErrors = false) 5591public LabelSymbol Label { get; } 5598public BoundSwitchLabel Update(LabelSymbol label, BoundPattern pattern, BoundExpression? whenClause) 7629public BoundIsPatternExpression(SyntaxNode syntax, BoundExpression expression, BoundPattern pattern, bool isNegated, BoundDecisionDag reachabilityDecisionDag, LabelSymbol whenTrueLabel, LabelSymbol whenFalseLabel, TypeSymbol? type, bool hasErrors = false) 7651public LabelSymbol WhenTrueLabel { get; } 7652public LabelSymbol WhenFalseLabel { get; } 7657public BoundIsPatternExpression Update(BoundExpression expression, BoundPattern pattern, bool isNegated, BoundDecisionDag reachabilityDecisionDag, LabelSymbol whenTrueLabel, LabelSymbol whenFalseLabel, TypeSymbol? type)
Lowering\AsyncRewriter\AsyncExceptionHandlerRewriter.cs (25)
236LabelSymbol finallyLabel) 250var proxied = proxiedLabels[i - 1]; 251var proxy = proxyLabels[proxied]; 268LabelSymbol proxy, 271LabelSymbol finallyLabel) 300var target = proxiedLabels[i - 1]; 301var parentProxy = parent.ProxyLabelIfNeeded(target); 318var returnLabel = parent.ProxyReturnIfNeeded(_F.CurrentFunction, pendingValue, out returnValue); 351var proxyLabel = _currentAwaitFinallyFrame.ProxyLabelIfNeeded(node.Label); 364var returnLabel = _currentAwaitFinallyFrame.ProxyReturnIfNeeded( 726private Dictionary<BoundTryStatement, HashSet<LabelSymbol>> _labelsInInterestingTry; 767internal HashSet<LabelSymbol> Labels(BoundTryStatement statement) 789_labelsInInterestingTry = labelsInInterestingTry = new Dictionary<BoundTryStatement, HashSet<LabelSymbol>>(); 882public readonly HashSet<LabelSymbol> LabelsOpt; 892public Dictionary<LabelSymbol, LabelSymbol> proxyLabels; 894public List<LabelSymbol> proxiedLabels; 904public AwaitFinallyFrame(AwaitFinallyFrame parent, HashSet<LabelSymbol> labelsOpt, SyntaxNode syntax) 923public LabelSymbol ProxyLabelIfNeeded(LabelSymbol label) 935this.proxyLabels = proxyLabels = new Dictionary<LabelSymbol, LabelSymbol>(); 936this.proxiedLabels = proxiedLabels = new List<LabelSymbol>(); 939LabelSymbol proxy; 950public LabelSymbol ProxyReturnIfNeeded(
Lowering\AsyncRewriter\AsyncIteratorMethodToStateMachineRewriter.cs (4)
33private LabelSymbol _currentDisposalLabel; 39private readonly LabelSymbol _exprReturnLabelTrue; 340var savedDisposalLabel = _currentDisposalLabel; 381var savedDisposalLabel = _currentDisposalLabel;
Lowering\AsyncRewriter\AsyncMethodToStateMachineRewriter.cs (2)
44protected readonly LabelSymbol _exprReturnLabel; 49private readonly LabelSymbol _exitLabel;
Lowering\ClosureConversion\ClosureConversion.Analysis.Tree.cs (9)
320private readonly PooledDictionary<LabelSymbol, ArrayBuilder<Scope>> _scopesAfterLabel = PooledDictionary<LabelSymbol, ArrayBuilder<Scope>>.GetInstance(); 329private readonly ArrayBuilder<ArrayBuilder<LabelSymbol>> _labelsInScope = ArrayBuilder<ArrayBuilder<LabelSymbol>>.GetInstance(); 343_labelsInScope.Push(ArrayBuilder<LabelSymbol>.GetInstance()); 530private void CheckCanMergeWithParent(LabelSymbol jumpTarget) 714foreach (var label in _labelsInScope.Peek()) 719_labelsInScope.Push(ArrayBuilder<LabelSymbol>.GetInstance()); 754foreach (var label in labels)
Lowering\IteratorRewriter\IteratorMethodToStateMachineRewriter.cs (5)
33private LabelSymbol? _exitLabel; 354var proxyLabel = _currentFinallyFrame.ProxyLabelIfNeeded(node.Label); 443var proxy = p.Value; 444var destination = p.Key; 453var parentProxy = parent.ProxyLabelIfNeeded(destination);
Lowering\IteratorRewriter\IteratorMethodToStateMachineRewriter.IteratorFinallyFrame.cs (9)
34public readonly HashSet<LabelSymbol> labels; 41public Dictionary<LabelSymbol, LabelSymbol> proxyLabels; 47HashSet<LabelSymbol> labels) 98public LabelSymbol ProxyLabelIfNeeded(LabelSymbol label) 109this.proxyLabels = proxyLabels = new Dictionary<LabelSymbol, LabelSymbol>(); 112LabelSymbol proxy;
Lowering\IteratorRewriter\IteratorMethodToStateMachineRewriter.YieldsInTryAnalysis.cs (6)
23private Dictionary<BoundTryStatement, HashSet<LabelSymbol>> _labelsInYieldingTrys; 54internal HashSet<LabelSymbol> Labels(BoundTryStatement statement) 77_labelsInYieldingTrys = yieldingTryLabels = new Dictionary<BoundTryStatement, HashSet<LabelSymbol>>(); 122protected HashSet<LabelSymbol> currentLabels; 130private void CollectLabel(LabelSymbol label) 137this.currentLabels = currentLabels = new HashSet<LabelSymbol>();
Lowering\LocalRewriter\LocalRewriter.DecisionDagRewriter.cs (33)
43private readonly PooledDictionary<BoundDecisionDagNode, LabelSymbol> _dagNodeLabels = PooledDictionary<BoundDecisionDagNode, LabelSymbol>.GetInstance(); 111protected virtual LabelSymbol GetDagNodeLabel(BoundDecisionDagNode dag) 113if (!_dagNodeLabels.TryGetValue(dag, out LabelSymbol label)) 401if (_dagNodeLabels.TryGetValue(node, out LabelSymbol label)) 567bool foundLabel = this._dagNodeLabels.TryGetValue(node, out LabelSymbol label); 573var label = GetDagNodeLabel(node); 590var cases = ArrayBuilder<(ConstantValue value, LabelSymbol label)>.GetInstance(); 609var label = GetDagNodeLabel(node); 621ImmutableArray<(ConstantValue value, LabelSymbol label)> cases, 644(ImmutableArray<(ConstantValue value, LabelSymbol label)> whenTrueCases, ImmutableArray<(ConstantValue value, LabelSymbol label)> whenFalseCases) 645splitCases(ImmutableArray<(ConstantValue value, LabelSymbol label)> cases, BinaryOperatorKind op, ConstantValue value) 647var whenTrueBuilder = ArrayBuilder<(ConstantValue value, LabelSymbol label)>.GetInstance(); 648var whenFalseBuilder = ArrayBuilder<(ConstantValue value, LabelSymbol label)>.GetInstance(); 682LabelSymbol trueLabel = whenTrue.Label; 688LabelSymbol falseLabel = whenFalse.Label; 694LabelSymbol falseLabel = _factory.GenerateLabel("relationalDispatch"); 705private sealed class CasesComparer : IComparer<(ConstantValue value, LabelSymbol label)> 714int IComparer<(ConstantValue value, LabelSymbol label)>.Compare((ConstantValue value, LabelSymbol label) left, (ConstantValue value, LabelSymbol label) right) 745LabelSymbol defaultLabel = node.Otherwise; 787ImmutableArray<(ConstantValue value, LabelSymbol label)> cases; 1002var whenExpressionMap = PooledDictionary<BoundExpression, (LabelSymbol LabelToWhenExpression, ArrayBuilder<BoundWhenDecisionDagNode> WhenNodes)>.GetInstance(); 1003var whenNodeMap = PooledDictionary<BoundWhenDecisionDagNode, (LabelSymbol LabelToWhenExpression, int WhenNodeIdentifier)>.GetInstance(); 1011LabelSymbol labelToWhenExpression; 1062LabelSymbol labelToSectionScope = GetDagNodeLabel(whenNode); 1079void lowerWhenExpressionIfShared(BoundExpression whenExpression, LabelSymbol labelToWhenExpression, ArrayBuilder<BoundWhenDecisionDagNode> whenNodes) 1087var whenTrueLabel = GetDagNodeLabel(whenNodes[0].WhenTrue); 1123void addConditionalGoto(BoundExpression whenExpression, SyntaxNode whenClauseSyntax, LabelSymbol whenTrueLabel, ArrayBuilder<BoundStatement> sectionBuilder) 1153LabelSymbol labelToSectionScope = GetDagNodeLabel(whenClause); 1160var trueLabel = GetDagNodeLabel(whenTrue);
Lowering\LocalRewriter\LocalRewriter.DecisionDagRewriter.ValueDispatchNode.cs (6)
38public readonly ImmutableArray<(ConstantValue value, LabelSymbol label)> Cases; 39public readonly LabelSymbol Otherwise; 40public SwitchDispatch(SyntaxNode syntax, ImmutableArray<(ConstantValue value, LabelSymbol label)> dispatches, LabelSymbol otherwise) : base(syntax) 53public readonly LabelSymbol Label; 54public LeafDispatchNode(SyntaxNode syntax, LabelSymbol Label) : base(syntax) => this.Label = Label;
Lowering\LocalRewriter\LocalRewriter_FixedStatement.cs (3)
167private Dictionary<BoundNode, HashSet<LabelSymbol>>? _lazyUnmatchedLabelCache; 179_lazyUnmatchedLabelCache = new Dictionary<BoundNode, HashSet<LabelSymbol>>(); 182HashSet<LabelSymbol> unmatched = UnmatchedGotoFinder.Find(node, _lazyUnmatchedLabelCache, RecursionDepth);
Lowering\LocalRewriter\LocalRewriter_IsPatternOperator.cs (10)
58LabelSymbol whenTrueLabel, 59LabelSymbol whenFalseLabel) 121LabelSymbol afterIsPatternExpression = _factory.GenerateLabel("afterIsPatternExpression"); 122LabelSymbol trueLabel = node.WhenTrueLabel; 123LabelSymbol falseLabel = node.WhenFalseLabel; 137private static bool IsFailureNode(BoundDecisionDagNode node, LabelSymbol whenFalseLabel) 221LabelSymbol whenTrueLabel, 222LabelSymbol whenFalseLabel) 239LabelSymbol whenTrueLabel, 240LabelSymbol whenFalseLabel)
Lowering\LocalRewriter\LocalRewriter_PatternSwitchStatement.cs (5)
26private readonly Dictionary<SyntaxNode, LabelSymbol> _sectionLabels = PooledDictionary<SyntaxNode, LabelSymbol>.GetInstance(); 40protected override LabelSymbol GetDagNodeLabel(BoundDecisionDagNode dag) 42var result = base.GetDagNodeLabel(dag); 52if (_sectionLabels.TryGetValue(section, out LabelSymbol? replacementLabel))
Lowering\LocalRewriter\LocalRewriter_SwitchExpression.cs (2)
54node.GetDecisionDagForLowering(_factory.Compilation, out LabelSymbol? defaultLabel), 90LabelSymbol afterSwitchExpression = _factory.GenerateLabel("afterSwitchExpression");
Lowering\StateMachineRewriter\MethodToStateMachineRewriter.cs (3)
64private Dictionary<LabelSymbol, List<StateMachineState>> _dispatches = new(); 229_dispatches ??= new Dictionary<LabelSymbol, List<StateMachineState>>(); 856oldDispatches ??= new Dictionary<LabelSymbol, List<StateMachineState>>();
Lowering\SyntheticBoundNodeFactory.cs (6)
856public BoundStatement ConditionalGoto(BoundExpression condition, LabelSymbol label, bool jumpIfTrue) 1013var caseBuilder = ArrayBuilder<(ConstantValue Value, LabelSymbol label)>.GetInstance(); 1018LabelSymbol sectionLabel = new GeneratedLabelSymbol("case " + section.Values[0]); 1052public BoundGotoStatement Goto(LabelSymbol label) 1057public BoundLabelStatement Label(LabelSymbol label) 1455LabelSymbol? finallyLabel = null)
Lowering\UnmatchedGotoFinder.cs (15)
22private readonly Dictionary<BoundNode, HashSet<LabelSymbol>> _unmatchedLabelsCache; // NB: never modified. 24private HashSet<LabelSymbol> _gotos; 25private HashSet<LabelSymbol> _targets; 27private UnmatchedGotoFinder(Dictionary<BoundNode, HashSet<LabelSymbol>> unmatchedLabelsCache, int recursionDepth) 34public static HashSet<LabelSymbol> Find(BoundNode node, Dictionary<BoundNode, HashSet<LabelSymbol>> unmatchedLabelsCache, int recursionDepth) 38HashSet<LabelSymbol> gotos = finder._gotos; 39HashSet<LabelSymbol> targets = finder._targets; 49HashSet<LabelSymbol> unmatched; 54foreach (LabelSymbol label in unmatched) 81foreach ((_, LabelSymbol label) in node.Cases) 101private void AddGoto(LabelSymbol label) 105_gotos = new HashSet<LabelSymbol>(); 111private void AddTarget(LabelSymbol label) 115_targets = new HashSet<LabelSymbol>();
Operations\CSharpOperationFactory.cs (1)
2604LabelSymbol label = boundSwitchLabel.Label;
Symbols\LabelSymbol.cs (2)
138/// Gets the immediately containing symbol of the <see cref="LabelSymbol"/>. 150/// Gets the immediately containing symbol of the <see cref="LabelSymbol"/>.
Symbols\PublicModel\LabelSymbol.cs (2)
11private readonly Symbols.LabelSymbol _underlying; 13public LabelSymbol(Symbols.LabelSymbol underlying)
Symbols\SymbolExtensions.cs (1)
635internal static ILabelSymbol? GetPublicSymbol(this LabelSymbol? symbol)
Symbols\SymbolVisitor.cs (1)
60public virtual void VisitLabel(LabelSymbol symbol)
Symbols\SymbolVisitor`1.cs (1)
60public virtual TResult VisitLabel(LabelSymbol symbol)
Symbols\SymbolVisitor`2.cs (2)
257/// Called when visiting a <see cref="LabelSymbol" />; Override this with specific 263public virtual TResult VisitLabel(LabelSymbol symbol, TArgument argument)