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
437 references to LabelSymbol
Microsoft.CodeAnalysis.CSharp (437)
Binder\Binder_Expressions.cs (2)
2536var symbol = (LabelSymbol)result.Symbols.First();
Binder\Binder_Patterns.cs (4)
574LabelSymbol whenTrueLabel = new GeneratedLabelSymbol(negated ? "isPatternFailure" : "isPatternSuccess"); 575LabelSymbol whenFalseLabel = new GeneratedLabelSymbol(negated ? "isPatternSuccess" : "isPatternFailure"); 659static bool? getConstantResult(BoundDecisionDag decisionDag, bool negated, LabelSymbol whenTrueLabel, LabelSymbol whenFalseLabel)
Binder\Binder_Statements.cs (6)
480var symbol = result.Symbols.Count > 0 && result.IsMultiViable ? 481(LabelSymbol)result.Symbols.First() : 522var symbol = boundLabel.Label; 2970LabelSymbol? target = isBreak ? this.GetBreakLabel(labelName) : this.GetContinueLabel(labelName); 4167internal virtual ImmutableArray<LabelSymbol> Labels 4171return 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)
60private readonly LabelSymbol _defaultLabel; 69private DecisionDagBuilder(CSharpCompilation compilation, LabelSymbol defaultLabel, bool forLowering, BindingDiagnosticBag diagnostics) 86LabelSymbol defaultLabel, 102LabelSymbol defaultLabel, 119LabelSymbol whenTrueLabel, 120LabelSymbol whenFalseLabel, 133LabelSymbol whenTrueLabel) 192LabelSymbol label) 1659BoundDecisionDagNode finalState(SyntaxNode syntax, LabelSymbol label, ImmutableArray<BoundPatternBinding> bindings) 3162public readonly LabelSymbol CaseLabel; 3169LabelSymbol CaseLabel)
Binder\DecisionDagBuilder_CheckOrReachability.cs (5)
73LabelSymbol defaultLabel = new GeneratedLabelSymbol("defaultLabel"); 119LabelSymbol defaultLabel = new GeneratedLabelSymbol("defaultLabel"); 170LabelSymbol defaultLabel = new GeneratedLabelSymbol("defaultLabel"); 392static void populateStateForCases(ArrayBuilder<BoundPattern> set, PooledHashSet<LabelSymbol> labelsToIgnore, 523var labelsToIgnore = PooledHashSet<LabelSymbol>.GetInstance();
Binder\EmbeddedStatementBinder.cs (3)
53protected override ImmutableArray<LabelSymbol> BuildLabels() 55ArrayBuilder<LabelSymbol> labels = null; 58return labels?.ToImmutableAndFree() ?? ImmutableArray<LabelSymbol>.Empty;
Binder\LocalScopeBinder.cs (11)
23private ImmutableArray<LabelSymbol> _labels; 71internal sealed override ImmutableArray<LabelSymbol> Labels 77ImmutableInterlocked.InterlockedCompareExchange(ref _labels, BuildLabels(), default(ImmutableArray<LabelSymbol>)); 84protected virtual ImmutableArray<LabelSymbol> BuildLabels() 86return ImmutableArray<LabelSymbol>.Empty; 117private SmallDictionary<string, LabelSymbol> _lazyLabelsMap; 118private SmallDictionary<string, LabelSymbol> LabelsMap 353protected void BuildLabels(SyntaxList<StatementSyntax> statements, ref ArrayBuilder<LabelSymbol> labels) 362internal static void BuildLabels(MethodSymbol containingMethod, StatementSyntax statement, ref ArrayBuilder<LabelSymbol> labels) 369labels = ArrayBuilder<LabelSymbol>.GetInstance(); 432LabelSymbol 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)
96private static Dictionary<object, SourceLabelSymbol> BuildLabelsByValue(ImmutableArray<LabelSymbol> labels) 174protected override ImmutableArray<LabelSymbol> BuildLabels() 179ArrayBuilder<LabelSymbol> labels = ArrayBuilder<LabelSymbol>.GetInstance(); 200private void BuildSwitchLabels(SyntaxList<SwitchLabelSyntax> labelsSyntax, Binder sectionBinder, ArrayBuilder<LabelSymbol> labels, BindingDiagnosticBag tempDiagnosticBag) 471private Dictionary<SyntaxNode, LabelSymbol> _labelsByNode; 472protected Dictionary<SyntaxNode, LabelSymbol> LabelsByNode 478var result = new Dictionary<SyntaxNode, LabelSymbol>(); 479foreach (var label in Labels)
Binder\SwitchBinder_Patterns.cs (4)
85static bool isSubsumed(BoundSwitchLabel switchLabel, ImmutableHashSet<LabelSymbol> reachableLabels) 200Dictionary<SyntaxNode, LabelSymbol> labelsByNode = LabelsByNode; 204LabelSymbol label = labelsByNode[labelSyntax]; 240LabelSymbol label,
Binder\SwitchExpressionBinder.cs (2)
36out BoundDecisionDag decisionDag, out LabelSymbol? defaultLabel, out bool wasReported, diagnostics); 66[NotNullWhen(true)] out LabelSymbol? defaultLabel,
BoundTree\BoundDecisionDag.cs (3)
21private ImmutableHashSet<LabelSymbol> _reachableLabels; 46public ImmutableHashSet<LabelSymbol> ReachableLabels 52var 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\BoundTreeRewriter.cs (3)
80public virtual LabelSymbol? VisitLabelSymbol(LabelSymbol? symbol) => symbol; 129return VisitLabelSymbol((LabelSymbol)symbol);
BoundTree\Constructors.cs (2)
588public BoundGotoStatement(SyntaxNode syntax, LabelSymbol label, bool hasErrors = false) 628public 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)
1278LabelSymbol fallThroughLabel, 1369LabelSymbol fallThroughLabel, 1409void emitLengthDispatch(LengthBasedStringSwitchData lengthBasedSwitchInfo, LocalOrParameter keyTemp, LabelSymbol fallThroughLabel, SyntaxNode syntaxNode) 1446void emitCharDispatches(LengthBasedStringSwitchData lengthBasedSwitchInfo, LocalOrParameter keyTemp, LabelSymbol fallThroughLabel, SyntaxNode syntaxNode) 1487void emitFinalDispatches(LengthBasedStringSwitchData lengthBasedSwitchInfo, LocalOrParameter keyTemp, TypeSymbol keyType, LabelSymbol fallThroughLabel, SyntaxNode syntaxNode) 1514LabelSymbol fallThroughLabel, 1967private Dictionary<LabelSymbol, GeneratedLabelSymbol> _labelClones; 2014var casesBuilder = ArrayBuilder<(ConstantValue, LabelSymbol)>.GetInstance(); 2036private GeneratedLabelSymbol GetLabelClone(LabelSymbol label) 2041_labelClones = labelClones = new Dictionary<LabelSymbol, GeneratedLabelSymbol>();
CodeGen\Optimizer.cs (3)
1454foreach ((_, LabelSymbol label) in node.Cases) 1842private void RecordBranch(LabelSymbol label) 1859private void RecordLabel(LabelSymbol label)
Compilation\MemberSemanticModel.cs (2)
772foreach (var label in binder.Labels) 797foreach (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)
79private readonly PooledDictionary<LabelSymbol, TLocalState> _labels; 210_labels = PooledDictionary<LabelSymbol, TLocalState>.GetInstance(); 238foreach (var key in _labels.Keys) 400public readonly LabelSymbol? Label; 403public PendingBranch(BoundNode branch, TLocalState state, LabelSymbol label, bool isConditionalState = false, TLocalState stateWhenTrue = default, TLocalState stateWhenFalse = default) 514protected virtual TLocalState LabelState(LabelSymbol label) 723private void ResolveBreaks(TLocalState breakState, LabelSymbol label) 732private void ResolveContinues(LabelSymbol continueLabel) 745private void JoinPendingBranches(ref TLocalState state, LabelSymbol label) 773private bool ResolveBranches(LabelSymbol label, BoundStatement? target) 792protected virtual void ResolveBranch(PendingBranch pending, LabelSymbol label, BoundStatement? target, ref bool labelStateChanged) 3375protected 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)
26private readonly HashSet<LabelSymbol> _labelsInside = new HashSet<LabelSymbol>(); 82protected override void ResolveBranch(PendingBranch pending, LabelSymbol label, BoundStatement target, ref bool labelStateChanged) 105private void ResolveLabel(BoundNode node, LabelSymbol label)
FlowAnalysis\ControlFlowPass.cs (5)
18private readonly PooledDictionary<LabelSymbol, BoundNode> _labelsDefined = PooledDictionary<LabelSymbol, BoundNode>.GetInstance(); 19private readonly PooledHashSet<LabelSymbol> _labelsUsed = PooledHashSet<LabelSymbol>.GetInstance(); 111protected override LocalState LabelState(LabelSymbol label)
FlowAnalysis\ExitPointsWalker.cs (2)
20private readonly ArrayBuilder<LabelSymbol> _labelsInside; 26_labelsInside = new ArrayBuilder<LabelSymbol>();
FlowAnalysis\NullableWalker_Patterns.cs (5)
377private PooledDictionary<LabelSymbol, (LocalState state, bool believedReachable)> LearnFromDecisionDag( 421var labelStateMap = PooledDictionary<LabelSymbol, (LocalState state, bool believedReachable)>.GetInstance(); 1181PooledDictionary<LabelSymbol, (LocalState state, bool believedReachable)> labelStateMap, 1226PooledDictionary<LabelSymbol, (LocalState state, bool believedReachable)> labelStateMap, 1238LocalState getStateForArm(BoundSwitchExpressionArm arm, PooledDictionary<LabelSymbol, (LocalState state, bool believedReachable)> labelStateMap)
Generated\BoundNodes.xml.Generated.cs (106)
3750public BoundBreakStatement(SyntaxNode syntax, LabelSymbol label, BoundLabel? labelExpressionOpt, bool hasErrors = false) 3760public LabelSymbol Label { get; } 3766public BoundBreakStatement Update(LabelSymbol label, BoundLabel? labelExpressionOpt) 3780public BoundContinueStatement(SyntaxNode syntax, LabelSymbol label, BoundLabel? labelExpressionOpt, bool hasErrors = false) 3790public LabelSymbol Label { get; } 3796public BoundContinueStatement Update(LabelSymbol label, BoundLabel? labelExpressionOpt) 3810public BoundSwitchStatement(SyntaxNode syntax, BoundExpression expression, ImmutableArray<LocalSymbol> innerLocals, ImmutableArray<MethodSymbol> innerLocalFunctions, ImmutableArray<BoundSwitchSection> switchSections, BoundDecisionDag reachabilityDecisionDag, BoundSwitchLabel? defaultLabel, LabelSymbol breakLabel, bool hasErrors = false) 3836public LabelSymbol BreakLabel { get; } 3841public BoundSwitchStatement Update(BoundExpression expression, ImmutableArray<LocalSymbol> innerLocals, ImmutableArray<MethodSymbol> innerLocalFunctions, ImmutableArray<BoundSwitchSection> switchSections, BoundDecisionDag reachabilityDecisionDag, BoundSwitchLabel? defaultLabel, LabelSymbol breakLabel) 3855public BoundSwitchDispatch(SyntaxNode syntax, BoundExpression expression, ImmutableArray<(ConstantValue value, LabelSymbol label)> cases, LabelSymbol defaultLabel, LengthBasedStringSwitchData? lengthBasedStringSwitchDataOpt, bool hasErrors = false) 3870public ImmutableArray<(ConstantValue value, LabelSymbol label)> Cases { get; } 3871public LabelSymbol DefaultLabel { get; } 3877public BoundSwitchDispatch Update(BoundExpression expression, ImmutableArray<(ConstantValue value, LabelSymbol label)> cases, LabelSymbol defaultLabel, LengthBasedStringSwitchData? lengthBasedStringSwitchDataOpt) 3924protected BoundLoopStatement(BoundKind kind, SyntaxNode syntax, LabelSymbol breakLabel, LabelSymbol continueLabel, bool hasErrors) 3935protected BoundLoopStatement(BoundKind kind, SyntaxNode syntax, LabelSymbol breakLabel, LabelSymbol continueLabel) 3946public LabelSymbol BreakLabel { get; } 3947public LabelSymbol ContinueLabel { get; } 3952protected BoundConditionalLoopStatement(BoundKind kind, SyntaxNode syntax, ImmutableArray<LocalSymbol> locals, BoundExpression condition, BoundStatement body, LabelSymbol breakLabel, LabelSymbol continueLabel, bool hasErrors = false) 3974public BoundDoStatement(SyntaxNode syntax, ImmutableArray<LocalSymbol> locals, BoundExpression condition, BoundStatement body, LabelSymbol breakLabel, LabelSymbol continueLabel, bool hasErrors = false) 3990public BoundDoStatement Update(ImmutableArray<LocalSymbol> locals, BoundExpression condition, BoundStatement body, LabelSymbol breakLabel, LabelSymbol continueLabel) 4004public BoundWhileStatement(SyntaxNode syntax, ImmutableArray<LocalSymbol> locals, BoundExpression condition, BoundStatement body, LabelSymbol breakLabel, LabelSymbol continueLabel, bool hasErrors = false) 4020public BoundWhileStatement Update(ImmutableArray<LocalSymbol> locals, BoundExpression condition, BoundStatement body, LabelSymbol breakLabel, LabelSymbol continueLabel) 4034public BoundForStatement(SyntaxNode syntax, ImmutableArray<LocalSymbol> outerLocals, BoundStatement? initializer, ImmutableArray<LocalSymbol> innerLocals, BoundExpression? condition, BoundStatement? increment, BoundStatement body, LabelSymbol breakLabel, LabelSymbol continueLabel, bool hasErrors = false) 4062public BoundForStatement Update(ImmutableArray<LocalSymbol> outerLocals, BoundStatement? initializer, ImmutableArray<LocalSymbol> innerLocals, BoundExpression? condition, BoundStatement? increment, BoundStatement body, LabelSymbol breakLabel, LabelSymbol continueLabel) 4076public BoundForEachStatement(SyntaxNode syntax, ForEachEnumeratorInfo? enumeratorInfoOpt, BoundValuePlaceholder? elementPlaceholder, BoundExpression? elementConversion, BoundTypeExpression iterationVariableType, ImmutableArray<LocalSymbol> iterationVariables, BoundExpression? iterationErrorExpressionOpt, BoundExpression expression, BoundForEachDeconstructStep? deconstructionOpt, BoundStatement body, LabelSymbol breakLabel, LabelSymbol continueLabel, bool hasErrors = false) 4111public BoundForEachStatement Update(ForEachEnumeratorInfo? enumeratorInfoOpt, BoundValuePlaceholder? elementPlaceholder, BoundExpression? elementConversion, BoundTypeExpression iterationVariableType, ImmutableArray<LocalSymbol> iterationVariables, BoundExpression? iterationErrorExpressionOpt, BoundExpression expression, BoundForEachDeconstructStep? deconstructionOpt, BoundStatement body, LabelSymbol breakLabel, LabelSymbol continueLabel) 4260public BoundTryStatement(SyntaxNode syntax, BoundBlock tryBlock, ImmutableArray<BoundCatchBlock> catchBlocks, BoundBlock? finallyBlockOpt, LabelSymbol? finallyLabelOpt, bool preferFaultHandler, bool hasErrors = false) 4277public LabelSymbol? FinallyLabelOpt { get; } 4283public BoundTryStatement Update(BoundBlock tryBlock, ImmutableArray<BoundCatchBlock> catchBlocks, BoundBlock? finallyBlockOpt, LabelSymbol? finallyLabelOpt, bool preferFaultHandler) 4710public BoundLabelStatement(SyntaxNode syntax, LabelSymbol label, bool hasErrors) 4719public BoundLabelStatement(SyntaxNode syntax, LabelSymbol label) 4728public LabelSymbol Label { get; } 4733public BoundLabelStatement Update(LabelSymbol label) 4747public BoundGotoStatement(SyntaxNode syntax, LabelSymbol label, BoundExpression? caseExpressionOpt, BoundLabel? labelExpressionOpt, bool hasErrors = false) 4758public LabelSymbol Label { get; } 4765public BoundGotoStatement Update(LabelSymbol label, BoundExpression? caseExpressionOpt, BoundLabel? labelExpressionOpt) 4779public BoundLabeledStatement(SyntaxNode syntax, LabelSymbol label, BoundStatement body, bool hasErrors = false) 4790public LabelSymbol Label { get; } 4796public BoundLabeledStatement Update(LabelSymbol label, BoundStatement body) 4810public BoundLabel(SyntaxNode syntax, LabelSymbol label, TypeSymbol? type, bool hasErrors) 4819public BoundLabel(SyntaxNode syntax, LabelSymbol label, TypeSymbol? type) 4828public LabelSymbol Label { get; } 4833public BoundLabel Update(LabelSymbol label, TypeSymbol? type) 4884public BoundConditionalGoto(SyntaxNode syntax, BoundExpression condition, bool jumpIfTrue, LabelSymbol label, bool hasErrors = false) 4898public LabelSymbol Label { get; } 4903public BoundConditionalGoto Update(BoundExpression condition, bool jumpIfTrue, LabelSymbol label) 4917protected BoundSwitchExpression(BoundKind kind, SyntaxNode syntax, BoundExpression expression, ImmutableArray<BoundSwitchExpressionArm> switchArms, BoundDecisionDag reachabilityDecisionDag, LabelSymbol? defaultLabel, bool reportedNotExhaustive, TypeSymbol? type, bool hasErrors = false) 4935public LabelSymbol? DefaultLabel { get; } 4941public BoundSwitchExpressionArm(SyntaxNode syntax, ImmutableArray<LocalSymbol> locals, BoundPattern pattern, bool hasUnionMatching, BoundExpression? whenClause, BoundExpression value, LabelSymbol label, bool hasErrors = false) 4963public LabelSymbol Label { get; } 4968public BoundSwitchExpressionArm Update(ImmutableArray<LocalSymbol> locals, BoundPattern pattern, bool hasUnionMatching, BoundExpression? whenClause, BoundExpression value, LabelSymbol label) 4982public BoundUnconvertedSwitchExpression(SyntaxNode syntax, BoundExpression expression, ImmutableArray<BoundSwitchExpressionArm> switchArms, BoundDecisionDag reachabilityDecisionDag, LabelSymbol? defaultLabel, bool reportedNotExhaustive, TypeSymbol? type, bool hasErrors = false) 4996public BoundUnconvertedSwitchExpression Update(BoundExpression expression, ImmutableArray<BoundSwitchExpressionArm> switchArms, BoundDecisionDag reachabilityDecisionDag, LabelSymbol? defaultLabel, bool reportedNotExhaustive, TypeSymbol? type) 5010public BoundConvertedSwitchExpression(SyntaxNode syntax, TypeSymbol? naturalTypeOpt, bool wasTargetTyped, BoundExpression expression, ImmutableArray<BoundSwitchExpressionArm> switchArms, BoundDecisionDag reachabilityDecisionDag, LabelSymbol? defaultLabel, bool reportedNotExhaustive, TypeSymbol type, bool hasErrors = false) 5030public BoundConvertedSwitchExpression Update(TypeSymbol? naturalTypeOpt, bool wasTargetTyped, BoundExpression expression, ImmutableArray<BoundSwitchExpressionArm> switchArms, BoundDecisionDag reachabilityDecisionDag, LabelSymbol? defaultLabel, bool reportedNotExhaustive, TypeSymbol type) 5188public BoundLeafDecisionDagNode(SyntaxNode syntax, LabelSymbol label, bool hasErrors) 5197public BoundLeafDecisionDagNode(SyntaxNode syntax, LabelSymbol label) 5206public LabelSymbol Label { get; } 5211public BoundLeafDecisionDagNode Update(LabelSymbol label) 5758public BoundSwitchLabel(SyntaxNode syntax, LabelSymbol label, BoundPattern pattern, bool hasUnionMatching, BoundExpression? whenClause, bool hasErrors = false) 5771public LabelSymbol Label { get; } 5779public BoundSwitchLabel Update(LabelSymbol label, BoundPattern pattern, bool hasUnionMatching, BoundExpression? whenClause) 8067public BoundIsPatternExpression(SyntaxNode syntax, BoundExpression expression, BoundPattern pattern, bool hasUnionMatching, bool isNegated, BoundDecisionDag reachabilityDecisionDag, LabelSymbol whenTrueLabel, LabelSymbol whenFalseLabel, TypeSymbol? type, bool hasErrors = false) 8091public LabelSymbol WhenTrueLabel { get; } 8092public LabelSymbol WhenFalseLabel { get; } 8097public BoundIsPatternExpression Update(BoundExpression expression, BoundPattern pattern, bool hasUnionMatching, bool isNegated, BoundDecisionDag reachabilityDecisionDag, LabelSymbol whenTrueLabel, LabelSymbol whenFalseLabel, TypeSymbol? type) 11704LabelSymbol label = this.VisitLabelSymbol(node.Label); 11710LabelSymbol label = this.VisitLabelSymbol(node.Label); 11718LabelSymbol breakLabel = this.VisitLabelSymbol(node.BreakLabel); 11727LabelSymbol defaultLabel = this.VisitLabelSymbol(node.DefaultLabel); 11741LabelSymbol breakLabel = this.VisitLabelSymbol(node.BreakLabel); 11742LabelSymbol continueLabel = this.VisitLabelSymbol(node.ContinueLabel); 11750LabelSymbol breakLabel = this.VisitLabelSymbol(node.BreakLabel); 11751LabelSymbol continueLabel = this.VisitLabelSymbol(node.ContinueLabel); 11760LabelSymbol breakLabel = this.VisitLabelSymbol(node.BreakLabel); 11761LabelSymbol continueLabel = this.VisitLabelSymbol(node.ContinueLabel); 11771LabelSymbol breakLabel = this.VisitLabelSymbol(node.BreakLabel); 11772LabelSymbol continueLabel = this.VisitLabelSymbol(node.ContinueLabel); 11812LabelSymbol? finallyLabelOpt = this.VisitLabelSymbol(node.FinallyLabelOpt); 11885LabelSymbol label = this.VisitLabelSymbol(node.Label); 11890LabelSymbol label = this.VisitLabelSymbol(node.Label); 11897LabelSymbol label = this.VisitLabelSymbol(node.Label); 11903LabelSymbol label = this.VisitLabelSymbol(node.Label); 11914LabelSymbol label = this.VisitLabelSymbol(node.Label); 11921LabelSymbol label = this.VisitLabelSymbol(node.Label); 11929LabelSymbol? defaultLabel = this.VisitLabelSymbol(node.DefaultLabel); 11938LabelSymbol? defaultLabel = this.VisitLabelSymbol(node.DefaultLabel); 11973LabelSymbol label = this.VisitLabelSymbol(node.Label); 12078LabelSymbol label = this.VisitLabelSymbol(node.Label); 12502LabelSymbol whenTrueLabel = this.VisitLabelSymbol(node.WhenTrueLabel); 12503LabelSymbol whenFalseLabel = this.VisitLabelSymbol(node.WhenFalseLabel);
Lowering\AsyncRewriter\AsyncExceptionHandlerRewriter.cs (25)
286LabelSymbol finallyLabel) 300var proxied = proxiedLabels[i - 1]; 301var proxy = proxyLabels[proxied]; 318LabelSymbol proxy, 321LabelSymbol finallyLabel) 350var target = proxiedLabels[i - 1]; 351var parentProxy = parent.ProxyLabelIfNeeded(target); 368var returnLabel = parent.ProxyReturnIfNeeded(_F.CurrentFunction, pendingValue, out returnValue); 402var proxyLabel = _currentAwaitFinallyFrame.ProxyLabelIfNeeded(node.Label); 415var returnLabel = _currentAwaitFinallyFrame.ProxyReturnIfNeeded( 846private Dictionary<BoundTryStatement, HashSet<LabelSymbol>> _labelsInInterestingTry; 887internal HashSet<LabelSymbol> Labels(BoundTryStatement statement) 909_labelsInInterestingTry = labelsInInterestingTry = new Dictionary<BoundTryStatement, HashSet<LabelSymbol>>(); 1002public readonly HashSet<LabelSymbol> LabelsOpt; 1012public Dictionary<LabelSymbol, LabelSymbol> proxyLabels; 1014public List<LabelSymbol> proxiedLabels; 1024public AwaitFinallyFrame(AwaitFinallyFrame parent, HashSet<LabelSymbol> labelsOpt, SyntaxNode syntax) 1043public LabelSymbol ProxyLabelIfNeeded(LabelSymbol label) 1055this.proxyLabels = proxyLabels = new Dictionary<LabelSymbol, LabelSymbol>(); 1056this.proxiedLabels = proxiedLabels = new List<LabelSymbol>(); 1059LabelSymbol proxy; 1070public LabelSymbol ProxyReturnIfNeeded(
Lowering\AsyncRewriter\AsyncIteratorMethodToStateMachineRewriter.cs (5)
34private LabelSymbol _currentDisposalLabel; 40private readonly LabelSymbol _exprReturnLabelTrue; 369var savedDisposalLabel = _currentDisposalLabel; 370LabelSymbol afterFinally = null; 408var savedDisposalLabel = _currentDisposalLabel;
Lowering\AsyncRewriter\AsyncMethodToStateMachineRewriter.cs (2)
45protected readonly LabelSymbol _exprReturnLabel; 50private readonly LabelSymbol _exitLabel;
Lowering\ClosureConversion\ClosureConversion.Analysis.Tree.cs (9)
338private readonly PooledDictionary<LabelSymbol, ArrayBuilder<Scope>> _scopesAfterLabel = PooledDictionary<LabelSymbol, ArrayBuilder<Scope>>.GetInstance(); 347private readonly ArrayBuilder<ArrayBuilder<LabelSymbol>> _labelsInScope = ArrayBuilder<ArrayBuilder<LabelSymbol>>.GetInstance(); 361_labelsInScope.Push(ArrayBuilder<LabelSymbol>.GetInstance()); 549private void CheckCanMergeWithParent(LabelSymbol jumpTarget) 734foreach (var label in _labelsInScope.Peek()) 739_labelsInScope.Push(ArrayBuilder<LabelSymbol>.GetInstance()); 774foreach (var label in labels)
Lowering\IteratorRewriter\IteratorMethodToStateMachineRewriter.cs (5)
34private LabelSymbol? _exitLabel; 360var proxyLabel = _currentFinallyFrame.ProxyLabelIfNeeded(node.Label); 449var proxy = p.Value; 450var destination = p.Key; 459var 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)) 400if (_dagNodeLabels.TryGetValue(node, out LabelSymbol label)) 566bool foundLabel = this._dagNodeLabels.TryGetValue(node, out LabelSymbol label); 572var label = GetDagNodeLabel(node); 589var cases = ArrayBuilder<(ConstantValue value, LabelSymbol label)>.GetInstance(); 608var label = GetDagNodeLabel(node); 620ImmutableArray<(ConstantValue value, LabelSymbol label)> cases, 643(ImmutableArray<(ConstantValue value, LabelSymbol label)> whenTrueCases, ImmutableArray<(ConstantValue value, LabelSymbol label)> whenFalseCases) 644splitCases(ImmutableArray<(ConstantValue value, LabelSymbol label)> cases, BinaryOperatorKind op, ConstantValue value) 646var whenTrueBuilder = ArrayBuilder<(ConstantValue value, LabelSymbol label)>.GetInstance(); 647var whenFalseBuilder = ArrayBuilder<(ConstantValue value, LabelSymbol label)>.GetInstance(); 681LabelSymbol trueLabel = whenTrue.Label; 687LabelSymbol falseLabel = whenFalse.Label; 693LabelSymbol falseLabel = _factory.GenerateLabel("relationalDispatch"); 704private sealed class CasesComparer : IComparer<(ConstantValue value, LabelSymbol label)> 713int IComparer<(ConstantValue value, LabelSymbol label)>.Compare((ConstantValue value, LabelSymbol label) left, (ConstantValue value, LabelSymbol label) right) 744LabelSymbol defaultLabel = node.Otherwise; 787ImmutableArray<(ConstantValue value, LabelSymbol label)> cases; 1010var whenExpressionMap = PooledDictionary<BoundExpression, (LabelSymbol LabelToWhenExpression, ArrayBuilder<BoundWhenDecisionDagNode> WhenNodes)>.GetInstance(); 1011var whenNodeMap = PooledDictionary<BoundWhenDecisionDagNode, (LabelSymbol LabelToWhenExpression, int WhenNodeIdentifier)>.GetInstance(); 1019LabelSymbol labelToWhenExpression; 1070LabelSymbol labelToSectionScope = GetDagNodeLabel(whenNode); 1087void lowerWhenExpressionIfShared(BoundExpression whenExpression, LabelSymbol labelToWhenExpression, ArrayBuilder<BoundWhenDecisionDagNode> whenNodes) 1095var whenTrueLabel = GetDagNodeLabel(whenNodes[0].WhenTrue); 1131void addConditionalGoto(BoundExpression whenExpression, SyntaxNode whenClauseSyntax, LabelSymbol whenTrueLabel, ArrayBuilder<BoundStatement> sectionBuilder) 1161LabelSymbol labelToSectionScope = GetDagNodeLabel(whenClause); 1168var 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_ForEachStatement.cs (10)
148LabelSymbol breakLabel, 149LabelSymbol continueLabel, 604LabelSymbol breakLabel, 605LabelSymbol continueLabel, 900LabelSymbol breakLabel, 901LabelSymbol continueLabel, 1049LabelSymbol breakLabel, 1050LabelSymbol continueLabel, 1160LabelSymbol breakLabelInner = dimension == 0 // outermost for-loop 1180LabelSymbol continueLabelInner;
Lowering\LocalRewriter\LocalRewriter_ForStatement.cs (2)
47LabelSymbol breakLabel, 48LabelSymbol continueLabel,
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 (6)
26private readonly Dictionary<SyntaxNode, LabelSymbol> _sectionLabels = PooledDictionary<SyntaxNode, LabelSymbol>.GetInstance(); 38((PooledDictionary<SyntaxNode, LabelSymbol>)_sectionLabels).Free(); 46protected override LabelSymbol GetDagNodeLabel(BoundDecisionDagNode dag) 48var result = base.GetDagNodeLabel(dag); 58if (_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\LocalRewriter\LocalRewriter_WhileStatement.cs (4)
45LabelSymbol breakLabel, 46LabelSymbol continueLabel, 111LabelSymbol breakLabel, 112LabelSymbol continueLabel,
Lowering\StateMachineRewriter\MethodToStateMachineRewriter.cs (4)
64private Dictionary<LabelSymbol, List<StateMachineState>> _dispatches = new Dictionary<LabelSymbol, List<StateMachineState>>(); 238_dispatches ??= new Dictionary<LabelSymbol, List<StateMachineState>>(); 746oldDispatches ??= new Dictionary<LabelSymbol, List<StateMachineState>>();
Lowering\SyntheticBoundNodeFactory.cs (6)
958public BoundStatement ConditionalGoto(BoundExpression condition, LabelSymbol label, bool jumpIfTrue) 1115var caseBuilder = ArrayBuilder<(ConstantValue Value, LabelSymbol label)>.GetInstance(); 1120LabelSymbol sectionLabel = new GeneratedLabelSymbol("case " + section.Values[0]); 1154public BoundGotoStatement Goto(LabelSymbol label) 1159public BoundLabelStatement Label(LabelSymbol label) 1598LabelSymbol? 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)
2815LabelSymbol label = boundSwitchLabel.Label;
Symbols\LabelSymbol.cs (2)
141/// Gets the immediately containing symbol of the <see cref="LabelSymbol"/>. 153/// 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)
629internal 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)