Inference/src/Semantic/SSAAlgorithm/SSAHelper.cs
/// <summary>
/// To clone the types of all the used IDs detected in the SSA algorithm
/// </summary>
/// <param name="references">The references used in the block.</param>
/// <param name="methodAnalyzed">The method that is being analyzed when the operation is performed.</param>
/// <param name="typeExpressions">The cloned type expressions</param>
To clone the types of all the used IDs detected in the SSA algorithm
To clone the types of all the used IDs detected in the SSA algorithm
public static void CloneTypesOfReferences(IList<SingleIdentifierExpression> references, MethodType methodAnalyzed, IDictionary<SingleIdentifierExpression, TypeExpression> typeExpressions) {
            IDictionary<int, TypeVariable> clonedTypeVariables = new Dictionary<int, TypeVariable>();
            IList<EquivalenceClass> equivalenceClasses = new List<EquivalenceClass>();
            foreach (SingleIdentifierExpression singleId in references)
                if (!typeExpressions.ContainsKey(singleId)) 
                    if (singleId.IdSymbol == null || singleId.IdSymbol.SymbolType == null)
                        typeExpressions[singleId] = null;
                    else
                        typeExpressions[singleId] = singleId.IdSymbol.SymbolType.Clone(clonedTypeVariables, equivalenceClasses, methodAnalyzed);
            CloneEquivalenceClasses(clonedTypeVariables, equivalenceClasses, methodAnalyzed);
        }
public static void CloneTypesOfReferences ( IList < SingleIdentifierExpression > references , MethodType methodAnalyzed , IDictionary < SingleIdentifierExpression , TypeExpression > typeExpressions ) { IDictionary < int , TypeVariable > clonedTypeVariables = new Dictionary < int , TypeVariable > ( ) ; IList < EquivalenceClass > equivalenceClasses = new List < EquivalenceClass > ( ) ; foreach ( SingleIdentifierExpression singleId in references ) if ( ! typeExpressions . ContainsKey ( singleId ) ) if ( singleId . IdSymbol == null || singleId . IdSymbol . SymbolType == null ) typeExpressions [ singleId ] = null ; else typeExpressions [ singleId ] = singleId . IdSymbol . SymbolType . Clone ( clonedTypeVariables , equivalenceClasses , methodAnalyzed ) ; CloneEquivalenceClasses ( clonedTypeVariables , equivalenceClasses , methodAnalyzed ) ; }
To clone the types of all the used IDs detected in the SSA algorithm
To clone the types of all the used IDs detected in the SSA algorithm
// * Clones each type // * Previously cloned // * Clones and updates the equivalence classes
references
IList<SingleIdentifierExpression>
The references used in the block.
The references used in the block .
methodAnalyzed
MethodType
The method that is being analyzed when the operation is performed.
The method that is being analyzed when the operation is performed .
typeExpressions
IDictionary<SingleIdentifierExpression, TypeExpression>
The cloned type expressions
The cloned type expressions