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