Class ScalarReplacement
The scalar replacement of aggregates transform, which tries to decompose local variables of aggregate types, replacing them with other local variables that represent their fields.
Inherited Members
Namespace: Flame.Compiler.Transforms
Assembly: Flame.Compiler.dll
Syntax
public sealed class ScalarReplacement : IntraproceduralOptimization
Constructors
| Edit this page View SourceScalarReplacement(Func<IType, bool>)
Creates a scalar replacement of aggregates pass.
Declaration
public ScalarReplacement(Func<IType, bool> canAccessFields)
Parameters
| Type | Name | Description |
|---|---|---|
| Func<IType, bool> | canAccessFields | A predicate that tells if all fields in a type can be accessed for the purpose of scalar replacement. |
Fields
| Edit this page View SourceInstance
An instance of the scalar replacement transform.
Declaration
public static readonly Optimization Instance
Field Value
| Type | Description |
|---|---|
| Optimization |
Properties
| Edit this page View SourceCanAccessFields
Tells if all fields in a type can be accessed for the purpose of scalar replacement.
Declaration
public Func<IType, bool> CanAccessFields { get; }
Property Value
| Type | Description |
|---|---|
| Func<IType, bool> | A predicate. |
Methods
| Edit this page View SourceApply(FlowGraph)
Applies this intraprocedural optimization to a flow graph.
Declaration
public override FlowGraph Apply(FlowGraph graph)
Parameters
| Type | Name | Description |
|---|---|---|
| FlowGraph | graph | The flow graph to transform. |
Returns
| Type | Description |
|---|---|
| FlowGraph | A transformed flow graph. |