예제 #1
0
        private void CheckMoveFunctLiteral(Core.InstructionMoveLiteralFunct inst)
        {
            var destType = TypeResolver.GetDataAccessType(this.session, this.funct, inst.destination);
            var srcType  = this.session.GetFunct(inst.functIndex).MakeFunctType();

            CheckMove(inst.destination, srcType, inst.span);
        }
예제 #2
0
        private void ApplyRuleForMoveFunctLiteral(ref bool appliedRule, Core.InstructionMoveLiteralFunct inst)
        {
            var destType = TypeResolver.GetDataAccessType(session, funct, inst.destination);
            var srcType  = (Core.Type) this.session.GetFunct(inst.functIndex).MakeFunctType();

            var inferredDest = TypeInferencer.Try(session, srcType, ref destType);

            if (inferredDest)
            {
                appliedRule = ApplyToDataAccess(inst.destination, destType);
            }

            /*if (inst.destination.fieldAccesses.Count > 0)
             *  throw new InternalException("not implemented");
             *
             * if (inst.potentialFuncts.Count > 0)
             * {
             *  for (var i = inst.potentialFuncts.Count - 1; i >= 0; i--)
             *  {
             *      var functType = new TypeFunct(inst.potentialFuncts[i]);
             *      if (!functType.IsMatch(this.routine.registers[inst.destination.registerIndex].type))
             *      {
             *          inst.potentialFuncts.RemoveAt(i);
             *          this.appliedAnyRule = true;
             *      }
             *  }
             * }
             *
             * if (inst.potentialFuncts.Count == 1)
             * {
             *  if (TryInference(this.session,
             *      new TypeFunct(inst.potentialFuncts[0]),
             *      ref routine.registers[inst.destination.registerIndex].type))
             *      this.appliedAnyRule = true;
             * }*/
        }
예제 #3
0
 private void CheckMoveFunctLiteral(List <InitStatus> statusList, Core.InstructionMoveLiteralFunct inst)
 {
     CheckAndInitDestination(statusList, inst.destination);
 }