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
System.Object.ToString()
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
Namespace: Flame.Compiler.Transforms
Assembly: Flame.Compiler.dll
Syntax
public sealed class ScalarReplacement : IntraproceduralOptimization
Constructors
| Improve this Doc View SourceScalarReplacement(Func<IType, Boolean>)
Creates a scalar replacement of aggregates pass.
Declaration
public ScalarReplacement(Func<IType, bool> canAccessFields)
Parameters
Type | Name | Description |
---|---|---|
System.Func<IType, System.Boolean> | canAccessFields | A predicate that tells if all fields in a type can be accessed for the purpose of scalar replacement. |
Fields
| Improve this Doc View SourceInstance
An instance of the scalar replacement transform.
Declaration
public static readonly Optimization Instance
Field Value
Type | Description |
---|---|
Optimization |
Properties
| Improve this Doc 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 |
---|---|
System.Func<IType, System.Boolean> | A predicate. |
Methods
| Improve this Doc 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. |