Ejemplo n.º 1
0
        /// <summary>
        /// Sets all variables type to <see cref="TypeRefMask.AnyType"/>.
        /// </summary>
        /// <param name="maybeRef">Whether to set <c>IsRef</c> flag for all variables.</param>
        public void SetAllAnyType(bool maybeRef)
        {
            var tmask = maybeRef
                ? TypeRefMask.AnyType.WithRefFlag
                : TypeRefMask.AnyType;

            foreach (var v in _flowCtx.EnumerateVariables())
            {
                SetVar(v.Key, tmask);
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Sets all variables as initialized at this state and with a <c>mixed</c> type.
        /// </summary>
        public void SetAllUnknown(bool maybeRef)
        {
            var tmask = maybeRef
                ? TypeRefMask.AnyType.WithRefFlag
                : TypeRefMask.AnyType;

            foreach (var v in _flowCtx.EnumerateVariables())
            {
                SetLocalType(v, tmask);
            }

            // all initialized
            _initializedMask = ~0u;
        }