-
Notifications
You must be signed in to change notification settings - Fork 4
/
IFlowGraphAnalysis.cs
44 lines (42 loc) · 1.43 KB
/
IFlowGraphAnalysis.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
using System.Collections.Generic;
namespace Flame.Compiler.Analysis
{
/// <summary>
/// An analysis on a flow graph.
/// </summary>
/// <typeparam name="T">
/// The type of the analysis' result.
/// </typeparam>
public interface IFlowGraphAnalysis<T>
{
/// <summary>
/// Analyzes a flow graph from scratch.
/// </summary>
/// <param name="graph">The flow graph to analyze.</param>
/// <returns>The analysis' output.</returns>
T Analyze(FlowGraph graph);
/// <summary>
/// Analyzes a flow graph based on the flow graph, the
/// previous result, and a list of updates that were
/// applied to the graph since the previous result.
/// </summary>
/// <param name="graph">
/// The current version of the flow graph to analyze.
/// </param>
/// <param name="previousResult">
/// A previous result produced by this analysis.
/// </param>
/// <param name="updates">
/// A list of updates that were applied to the flow graph
/// since the previous result was computed.
/// </param>
/// <returns>
/// The analysis' output, which must be equal to a call to
/// <c>Analyze</c>.
/// </returns>
T AnalyzeWithUpdates(
FlowGraph graph,
T previousResult,
IReadOnlyList<FlowGraphUpdate> updates);
}
}