-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathOperationBodySyntax.cs
More file actions
39 lines (35 loc) · 1.44 KB
/
OperationBodySyntax.cs
File metadata and controls
39 lines (35 loc) · 1.44 KB
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
namespace MLIR.Syntax;
/// <summary>
/// Represents the body of an MLIR operation.
/// </summary>
public abstract class OperationBodySyntax
{
/// <summary>
/// Attempts to project this body into the generic MLIR operation-body shape.
/// </summary>
/// <param name="genericBody">
/// When this method returns, contains the generic projection of the body when the
/// projection succeeded; otherwise, <see langword="null"/>.
/// </param>
/// <returns><see langword="true"/> when a generic projection is available; otherwise, <see langword="false"/>.</returns>
public abstract bool TryGetGenericBody(out GenericOperationBodySyntax? genericBody);
/// <summary>
/// Gets the generic MLIR operation-body projection for this body.
/// </summary>
/// <returns>The generic body projection.</returns>
/// <exception cref="System.InvalidOperationException">
/// Thrown when the body does not provide a generic projection.
/// </exception>
public GenericOperationBodySyntax GetGenericBody()
{
if (TryGetGenericBody(out var genericBody))
{
return genericBody!;
}
throw new System.InvalidOperationException("This operation body does not provide a generic MLIR body projection.");
}
/// <summary>
/// Writes the operation body to the supplied syntax writer.
/// </summary>
public abstract void WriteTo(Text.SyntaxWriter writer, int indentLevel);
}