3 instantiations of TableEntry
Microsoft.CodeAnalysis (3)
SourceGeneration\Nodes\NodeStateTable.cs (3)
638
return new
TableEntry
(_items, s_allCachedEntries, anyRemoved: false);
654
public TableEntry AsRemovedDueToInputRemoval() =>
new
(_items, s_allRemovedDueToInputRemoval, anyRemoved: true);
767
return new
TableEntry
(_items.ToOneOrManyAndFree(), _states?.ToImmutableAndFree() ?? GetSingleArray(_currentState.Value), anyRemoved: _anyRemoved);
31 references to TableEntry
Microsoft.CodeAnalysis (30)
SourceGeneration\Nodes\NodeStateTable.cs (29)
63
internal static NodeStateTable<T> Empty { get; } = new NodeStateTable<T>(ImmutableArray<
TableEntry
>.Empty, ImmutableArray<IncrementalGeneratorRunStep>.Empty, hasTrackedSteps: true, isCached: false);
65
private readonly ImmutableArray<
TableEntry
> _states;
67
private NodeStateTable(ImmutableArray<
TableEntry
> states, ImmutableArray<IncrementalGeneratorRunStep> steps, bool hasTrackedSteps, bool isCached)
99
private
TableEntry
_inputEntry;
160
var compacted = ArrayBuilder<
TableEntry
>.GetInstance(nonRemovedCount);
161
foreach (
var
entry in _states)
203
foreach (
var
state in _states)
228
private readonly ArrayBuilder<
TableEntry
> _states;
256
_states = ArrayBuilder<
TableEntry
>.GetInstance(tableCapacity ?? previous.GetTotalEntryItemCount());
270
if (!TryGetPreviousEntry(out
var
previousEntry))
278
var
previousEntries = previousEntry.AsRemovedDueToInputRemoval();
298
if (!TryGetPreviousEntry(out
var
previousEntries))
311
internal bool TryUseCachedEntries(TimeSpan elapsedTime, ImmutableArray<(IncrementalGeneratorRunStep InputStep, int OutputIndex)> stepInputs, out
TableEntry
entry)
325
if (!TryGetPreviousEntry(out
var
previousEntry))
353
if (!TryGetPreviousEntry(out
var
previousEntry))
376
var builder = previousEntry.Count == outputs.Length ? null : new
TableEntry
.Builder(capacity: totalBuilderItems);
400
builder = new
TableEntry
.Builder(capacity: totalBuilderItems);
436
public bool TryModifyEntries(ImmutableArray<T> outputs, IEqualityComparer<T> comparer, TimeSpan elapsedTime, ImmutableArray<(IncrementalGeneratorRunStep InputStep, int OutputIndex)> stepInputs, EntryState overallInputState, out
TableEntry
entry)
455
public
TableEntry
AddEntries(ImmutableArray<T> values, EntryState state, TimeSpan elapsedTime, ImmutableArray<(IncrementalGeneratorRunStep InputStep, int OutputIndex)> stepInputs, EntryState overallInputState)
457
var
tableEntry = new TableEntry(OneOrMany.Create(values), state);
464
private bool TryGetPreviousEntry(out
TableEntry
previousEntry)
483
TableEntry
outputInfo = _states[^1];
537
ImmutableArray<
TableEntry
> finalStates;
605
public bool Matches(
TableEntry
entry, IEqualityComparer<T> equalityComparer)
634
public
TableEntry
AsCached()
654
public
TableEntry
AsRemovedDueToInputRemoval() => new(_items, s_allRemovedDueToInputRemoval, anyRemoved: true);
670
private readonly
TableEntry
_entry;
673
public Enumerator(
TableEntry
tableEntry)
759
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)
86
builder.TryUseCachedEntries(TimeSpan.Zero, default, out
var
cachedEntries); // ((2, EntryState.Cached), (3, EntryState.Cached))