public static ConstantParametersData GetInterpreterData(MethodInterpreter interpreter)
        {
            object resultObj;
            var    auxiliaryObjects = interpreter.MidRepresentation.AuxiliaryObjects;

            if (auxiliaryObjects.TryGetValue(Name, out resultObj))
            {
                return((ConstantParametersData)resultObj);
            }
            var result = new ConstantParametersData();

            auxiliaryObjects[Name] = result;
            return(result);
        }
 private void ApplyChangesOnMethod(ConstantParametersData parametersData, CilMethodInterpreter interpreter)
 {
     foreach (var constKind in parametersData.ConstKinds)
     {
         if (constKind.Value != ConstantParametersData.ConstValueKind.AssignedConstant)
         {
             continue;
         }
         var assignedConstant = parametersData.ConstValues[constKind.Key];
         var cilInterpreter   = interpreter;
         cilInterpreter.SwitchAllUsagesWithDefinition(constKind.Key, assignedConstant);
         interpreter.AnalyzeProperties.SetVariableData(constKind.Key, EscapingMode.Unused);
         Result = true;
     }
 }
        private static bool HandleInterpreterInstructions(MethodInterpreter interpreter)
        {
            var useDef        = interpreter.MidRepresentation.UseDef;
            var calls         = useDef.GetOperationsOfKind(OperationKind.Call).ToList();
            var allOps        = useDef.GetLocalOperations();
            var updatedHappen = false;

            foreach (var callOp in calls)
            {
                var op                 = allOps[callOp];
                var methodData         = (MethodData)op.Value;
                var callingInterpreter = methodData.Interpreter;
                if (callingInterpreter.Kind != MethodKind.Default)
                {
                    continue;
                }
                var interpreterData = ConstantParametersData.GetInterpreterData(callingInterpreter);
                updatedHappen |= interpreterData.UpdateTable(methodData);
            }
            return(updatedHappen);
        }