private void GenerateStackData()
        {
            StackUsageData stackData = new StackUsageData();

            foreach (KeyValuePair <int, Stack <int> > pair in instructionOffsetToUsedInstructionsMap)
            {
                List <VariableDefinition> usedVariables = new List <VariableDefinition>(pair.Value.Select(offset => instructionOffsetToVariableDefinitionMap[offset]));
                stackData.InstructionOffsetToUsedStackVariablesMap[pair.Key] = usedVariables;

                foreach (VariableDefinition varDef in usedVariables)
                {
                    GetDefineUseInfo(stackData, varDef).UsedAt.Add(pair.Key);
                }
            }

            foreach (KeyValuePair <int, VariableDefinition> pair in instructionOffsetToVariableDefinitionMap)
            {
                if (pair.Key < 0)
                {
                    stackData.ExceptionHandlerStartToExceptionVariableMap.Add(-pair.Key, pair.Value);
                }
                else
                {
                    stackData.InstructionOffsetToAssignedVariableMap.Add(pair.Key, pair.Value);
                    GetDefineUseInfo(stackData, pair.Value).DefinedAt.Add(pair.Key);
                }
            }

            methodContext.StackData = stackData;
        }
		private StackVariableDefineUseInfo GetDefineUseInfo(StackUsageData stackData, VariableDefinition varDef)
		{
			if (!stackData.get_VariableToDefineUseInfo().TryGetValue(varDef, out V_0))
			{
				V_0 = new StackVariableDefineUseInfo();
				stackData.get_VariableToDefineUseInfo().Add(varDef, V_0);
			}
			return V_0;
		}
		private void GenerateStackData()
		{
			V_0 = new StackUsageData();
			V_1 = this.instructionOffsetToUsedInstructionsMap.GetEnumerator();
			try
			{
				while (V_1.MoveNext())
				{
					V_2 = V_1.get_Current();
					V_3 = new List<VariableDefinition>(V_2.get_Value().Select<int, VariableDefinition>(new Func<int, VariableDefinition>(this.u003cGenerateStackDatau003eb__25_0)));
					V_0.get_InstructionOffsetToUsedStackVariablesMap().set_Item(V_2.get_Key(), V_3);
					V_4 = V_3.GetEnumerator();
					try
					{
						while (V_4.MoveNext())
						{
							V_5 = V_4.get_Current();
							this.GetDefineUseInfo(V_0, V_5).get_UsedAt().Add(V_2.get_Key());
						}
					}
					finally
					{
						((IDisposable)V_4).Dispose();
					}
				}
			}
			finally
			{
				((IDisposable)V_1).Dispose();
			}
			V_6 = this.instructionOffsetToVariableDefinitionMap.GetEnumerator();
			try
			{
				while (V_6.MoveNext())
				{
					V_7 = V_6.get_Current();
					if (V_7.get_Key() >= 0)
					{
						V_0.get_InstructionOffsetToAssignedVariableMap().Add(V_7.get_Key(), V_7.get_Value());
						dummyVar0 = this.GetDefineUseInfo(V_0, V_7.get_Value()).get_DefinedAt().Add(V_7.get_Key());
					}
					else
					{
						V_0.get_ExceptionHandlerStartToExceptionVariableMap().Add(-V_7.get_Key(), V_7.get_Value());
					}
				}
			}
			finally
			{
				((IDisposable)V_6).Dispose();
			}
			this.methodContext.set_StackData(V_0);
			return;
		}
        private StackVariableDefineUseInfo GetDefineUseInfo(StackUsageData stackData, VariableDefinition varDef)
        {
            StackVariableDefineUseInfo defineUseInfo;

            if (!stackData.VariableToDefineUseInfo.TryGetValue(varDef, out defineUseInfo))
            {
                defineUseInfo = new StackVariableDefineUseInfo();
                stackData.VariableToDefineUseInfo.Add(varDef, defineUseInfo);
            }

            return(defineUseInfo);
        }
 internal MethodSpecificContext(DecompilationAnalysisResults analysisResults, YieldData yieldData, AsyncData asyncData,
     bool isMethodBodyChanged, Dictionary<string, Statement> gotoLabels, List<GotoStatement> gotoStatements,
     StackUsageData stackData, bool isBaseConstructorInvokingConstructor, bool enableEventAnalysis,
     MethodBody body, Collection<VariableDefinition> variables, ControlFlowGraph controlFlowGraph,
     ExpressionDecompilerData expressions, BlockLogicalConstruct logicalConstructsTree, LogicalFlowBuilderContext logicalConstructsContext,
     MethodInvocationExpression ctorInvokeExpression, Dictionary<Statement, ILogicalConstruct> statementToLogicalConstruct,
     Dictionary<ILogicalConstruct, List<Statement>> logicalConstructToStatements, Dictionary<VariableDefinition, string> variableDefinitionToNameMap,
     HashSet<string> variableNamesCollection, Dictionary<ParameterDefinition, string> parameterDefinitionToNameMap,
     HashSet<VariableDefinition> variablesToRename, Dictionary<FieldDefinition, Expression> fieldToExpression,
     int lambdaVariablesCount, Dictionary<VariableDefinition, AssignmentType> variableAssignmentData, List<ParameterDefinition> outParametersToAssign,
     bool isDestructor, BlockStatement destructorStatements, HashSet<VariableDefinition> undeclaredLinqVariables,
     Dictionary<VariableReference, Dictionary<FieldDefinition, Expression>> closureVariableToFieldValue,
     HashSet<VariableDefinition> variablesToNotDeclare)
 {
     this.AnalysisResults = analysisResults;
     this.YieldData = yieldData;
     this.AsyncData = asyncData;
     this.IsMethodBodyChanged = isMethodBodyChanged;
     this.GotoLabels = gotoLabels;
     this.GotoStatements = gotoStatements;
     this.StackData = stackData;
     this.IsBaseConstructorInvokingConstructor = isBaseConstructorInvokingConstructor;
     this.EnableEventAnalysis = enableEventAnalysis;
     this.Body = body;
     this.Variables = variables;
     this.ControlFlowGraph = controlFlowGraph;
     this.Expressions = expressions;
     this.LogicalConstructsTree = logicalConstructsTree;
     this.LogicalConstructsContext = logicalConstructsContext;
     this.CtorInvokeExpression = ctorInvokeExpression;
     this.StatementToLogicalConstruct = statementToLogicalConstruct;
     this.LogicalConstructToStatements = logicalConstructToStatements;
     this.VariableDefinitionToNameMap = variableDefinitionToNameMap;
     this.VariableNamesCollection = variableNamesCollection;
     this.ParameterDefinitionToNameMap = parameterDefinitionToNameMap;
     this.VariablesToRename = variablesToRename;
     this.FieldToExpression = fieldToExpression;
     this.LambdaVariablesCount = lambdaVariablesCount;
     this.VariableAssignmentData = variableAssignmentData;
     this.OutParametersToAssign = outParametersToAssign;
     this.IsDestructor = isDestructor;
     this.DestructorStatements = destructorStatements;
     this.UndeclaredLinqVariables = undeclaredLinqVariables;
     this.ClosureVariableToFieldValue = closureVariableToFieldValue;
     this.VariablesToNotDeclare = variablesToNotDeclare;
 }
        private StackVariableDefineUseInfo GetDefineUseInfo(StackUsageData stackData, VariableDefinition varDef)
        {
            StackVariableDefineUseInfo defineUseInfo;
            if (!stackData.VariableToDefineUseInfo.TryGetValue(varDef, out defineUseInfo))
            {
                defineUseInfo = new StackVariableDefineUseInfo();
                stackData.VariableToDefineUseInfo.Add(varDef, defineUseInfo);
            }

            return defineUseInfo;
        }
        private void GenerateStackData()
        {
            StackUsageData stackData = new StackUsageData();
            foreach (KeyValuePair<int, Stack<int>> pair in instructionOffsetToUsedInstructionsMap)
            {
                List<VariableDefinition> usedVariables = new List<VariableDefinition>(pair.Value.Select(offset => instructionOffsetToVariableDefinitionMap[offset]));
                stackData.InstructionOffsetToUsedStackVariablesMap[pair.Key] = usedVariables;

                foreach (VariableDefinition varDef in usedVariables)
                {
                    GetDefineUseInfo(stackData, varDef).UsedAt.Add(pair.Key);
                }
            }

            foreach (KeyValuePair<int, VariableDefinition> pair in instructionOffsetToVariableDefinitionMap)
            {
                if (pair.Key < 0)
                {
                    stackData.ExceptionHandlerStartToExceptionVariableMap.Add(-pair.Key, pair.Value);
                }
                else
                {
                    stackData.InstructionOffsetToAssignedVariableMap.Add(pair.Key, pair.Value);
                    GetDefineUseInfo(stackData, pair.Value).DefinedAt.Add(pair.Key);
                }
            }

            methodContext.StackData = stackData;
        }