7 instantiations of TableEntry
Microsoft.CodeAnalysis (7)
SourceGeneration\Nodes\NodeStateTable.cs (7)
340_states.Add(new TableEntry(OneOrMany.Create(chosen), state)); 451_states.Add(new TableEntry(OneOrMany.Create(value), state)); 458var tableEntry = new TableEntry(OneOrMany.Create(values), state); 639return new TableEntry(_items, s_allCachedEntries, anyRemoved: false); 652return new TableEntry(OneOrMany.Create(itemBuilder.ToImmutableArray()), s_allCachedEntries, anyRemoved: false); 655public TableEntry AsRemovedDueToInputRemoval() => new(_items, s_allRemovedDueToInputRemoval, anyRemoved: true); 768return new TableEntry(_items.ToOneOrManyAndFree(), _states?.ToImmutableAndFree() ?? GetSingleArray(_currentState.Value), anyRemoved: _anyRemoved);
31 references to TableEntry
Microsoft.CodeAnalysis (30)
SourceGeneration\Nodes\NodeStateTable.cs (29)
64internal static NodeStateTable<T> Empty { get; } = new NodeStateTable<T>(ImmutableArray<TableEntry>.Empty, ImmutableArray<IncrementalGeneratorRunStep>.Empty, hasTrackedSteps: true, isCached: false); 66private readonly ImmutableArray<TableEntry> _states; 68private NodeStateTable(ImmutableArray<TableEntry> states, ImmutableArray<IncrementalGeneratorRunStep> steps, bool hasTrackedSteps, bool isCached) 100private TableEntry _inputEntry; 161var compacted = ArrayBuilder<TableEntry>.GetInstance(nonRemovedCount); 162foreach (var entry in _states) 204foreach (var state in _states) 229private readonly ArrayBuilder<TableEntry> _states; 257_states = ArrayBuilder<TableEntry>.GetInstance(tableCapacity ?? previous.GetTotalEntryItemCount()); 271if (!TryGetPreviousEntry(out var previousEntry)) 279var previousEntries = previousEntry.AsRemovedDueToInputRemoval(); 299if (!TryGetPreviousEntry(out var previousEntries)) 312internal bool TryUseCachedEntries(TimeSpan elapsedTime, ImmutableArray<(IncrementalGeneratorRunStep InputStep, int OutputIndex)> stepInputs, out TableEntry entry) 326if (!TryGetPreviousEntry(out var previousEntry)) 354if (!TryGetPreviousEntry(out var previousEntry)) 377var builder = previousEntry.Count == outputs.Length ? null : new TableEntry.Builder(capacity: totalBuilderItems); 401builder = new TableEntry.Builder(capacity: totalBuilderItems); 437public bool TryModifyEntries(ImmutableArray<T> outputs, TimeSpan elapsedTime, ImmutableArray<(IncrementalGeneratorRunStep InputStep, int OutputIndex)> stepInputs, EntryState overallInputState, out TableEntry entry) 456public TableEntry AddEntries(ImmutableArray<T> values, EntryState state, TimeSpan elapsedTime, ImmutableArray<(IncrementalGeneratorRunStep InputStep, int OutputIndex)> stepInputs, EntryState overallInputState) 458var tableEntry = new TableEntry(OneOrMany.Create(values), state); 465private bool TryGetPreviousEntry(out TableEntry previousEntry) 484TableEntry outputInfo = _states[^1]; 538ImmutableArray<TableEntry> finalStates; 606public bool Matches(TableEntry entry, IEqualityComparer<T> equalityComparer) 635public TableEntry AsCached() 655public TableEntry AsRemovedDueToInputRemoval() => new(_items, s_allRemovedDueToInputRemoval, anyRemoved: true); 671private readonly TableEntry _entry; 674public Enumerator(TableEntry tableEntry) 760public TableEntry ToImmutableAndFree()
SourceGeneration\Nodes\PredicateSyntaxStrategy.cs (1)
83if (state != EntryState.Cached || !_filterTable.TryUseCachedEntries(TimeSpan.Zero, noInputStepsStepInfo, out NodeStateTable<SyntaxNode>.TableEntry entry))
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (1)
SourceGeneration\StateTableTests.cs (1)
87builder.TryUseCachedEntries(TimeSpan.Zero, default, out var cachedEntries); // ((2, EntryState.Cached), (3, EntryState.Cached))