Exemplo n.º 1
0
        /// <summary>
        /// Determines whether [contains] [the specified CTX].
        /// </summary>
        /// <param name="ctx">The context.</param>
        /// <param name="operand">The operand.</param>
        /// <returns>
        /// 	<c>true</c> if [contains] [the specified CTX]; otherwise, <c>false</c>.
        /// </returns>
        public static bool Contains(Context ctx, StackOperand operand)
        {
            PhiData phiData = ctx.Other as PhiData;

            if (phiData == null)
                return false;

            List<Operand> operands = phiData.Operands as List<Operand>;
            return operands.Contains(operand);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Adds the value.
        /// </summary>
        /// <param name="ctx">The context.</param>
        /// <param name="edge">The edge.</param>
        /// <param name="op">The op.</param>
        public static void AddValue(Context ctx, BasicBlock edge, StackOperand op)
        {
            PhiData phiData = ctx.Other as PhiData;

            if (phiData == null) {
                phiData = new PhiData();
                ctx.Other = phiData;
            }

            List<BasicBlock> blocks = phiData.Blocks as List<BasicBlock>;

            Debug.Assert(blocks.Count < 255, @"Maximum number of operands in PHI exceeded.");

            blocks.Add(edge);
            phiData.Operands.Add(op);
        }
Exemplo n.º 3
0
        /// <summary>
        /// Compares with the given operand for equality.
        /// </summary>
        /// <param name="other">The other operand to compare with.</param>
        /// <returns>The return value is true if the operands are equal; false if not.</returns>
        public override bool Equals(Operand other)
        {
            StackOperand sop = other as StackOperand;

            return(null != sop && sop.Type == this.Type && sop.Offset == this.Offset && sop.Base == this.Base && sop.Version == this.Version);
        }
 public void GetStackRequirements(StackOperand stackOperand, out int size, out int alignment)
 {
     // Special treatment for some stack types
     // FIXME: Handle the size and alignment requirements of value types
     this.architecture.GetTypeRequirements(stackOperand.Type, out size, out alignment);
 }