コード例 #1
0
        public static bool findLargestVersion(
            Block b,
            PassiveRelationGen relationGen,
            IDictionary <Variable, int> versionMap,
            int maxVersionPred,
            out int maxVersion)
        {
            maxVersion = maxVersionPred;
            var updates = relationGen.GenerateVariableRelUpdatesFromPassive(b, out _);

            foreach (var update in updates)
            {
                if (!update.Item3)
                {
                    //not constant propagation
                    var constrainedVariable = (update.Item2 as IdentifierExpr).Decl;
                    if (versionMap[constrainedVariable] <= maxVersionPred)
                    {
                        return(false);
                    }

                    maxVersion = Math.Max(versionMap[constrainedVariable], maxVersion);
                }
            }

            return(true);
        }
コード例 #2
0
        private void VersionBlock(Block b)
        {
            var updates = _relationGen.GenerateVariableRelUpdatesFromPassive(b, out _);

            foreach (var update in updates)
            {
                if (!update.Item3)
                {
                    //not constant propagation
                    var constrainedVariable = (update.Item2 as IdentifierExpr).Decl;
                    VersionVariable(constrainedVariable);
                }
            }

            _versionedBlocks.Add(b);
        }