コード例 #1
0
        public void Join(ConstantPropagationDomain other)
        {
            if (VarCount != other.VarCount)
            {
                throw new IncompatibleConstantPropagationDomains("Not the same variable set!");
            }

            for (int i = 0; i < varMapping.Keys.Count; i++)
            {
                var v = varMapping.Keys.ElementAt(i);
                if (!other.Contains(v))
                {
                    throw new IncompatibleConstantPropagationDomains("Not the same variable set! " + v.ToString());
                }
                var ncsd = Constants(v).Clone();
                ncsd.Join(other.Constants(v));
                Set(v, ncsd);
            }

            if (FieldCount != other.FieldCount)
            {
                throw new IncompatibleConstantPropagationDomains("Not the same field set!");
            }

            for (int i = 0; i < fieldMapping.Keys.Count; i++)
            {
                var f = fieldMapping.Keys.ElementAt(i);
                if (!other.Contains(f))
                {
                    throw new IncompatibleConstantPropagationDomains("Not the same field set! " + f.ToString());
                }
                var ncsd = Constants(f).Clone();
                ncsd.Join(other.Constants(f));
                Set(f, ncsd);
            }
        }
コード例 #2
0
            private void UpdateStateCopy(ConstantPropagationDomain state, IVariable dest, IFieldReference src)
            {
                var cl = state.Constants(src).Clone();

                state.Set(dest, cl);
            }