コード例 #1
0
 public StateMachineFinallyCheckRemoverBase(MethodSpecificContext methodContext)
 {
     this.toBeRemoved = new HashSet <InstructionBlock>();
     base();
     this.methodVariables = methodContext.get_Body().get_Variables();
     this.theCFG          = methodContext.get_ControlFlowGraph();
     return;
 }
コード例 #2
0
 public StateControllerRemover(MethodSpecificContext methodContext, FieldDefinition stateField = null)
 {
     this.toBeRemoved = new HashSet <InstructionBlock>();
     base();
     this.methodContext     = methodContext;
     this.theCFG            = methodContext.get_ControlFlowGraph();
     this.stateField        = stateField;
     this.stateToStartBlock = new InstructionBlock[(int)this.theCFG.get_Blocks().Length];
     return;
 }
コード例 #3
0
 public AsyncMoveNextMethodAnalyzer(MethodSpecificContext moveNextMethodContext, FieldDefinition stateField)
 {
     this.variableToFieldMap = new Dictionary <VariableReference, FieldReference>();
     base();
     this.theCFG          = moveNextMethodContext.get_ControlFlowGraph();
     this.methodVariables = moveNextMethodContext.get_Variables();
     this.stateField      = stateField;
     if (this.GetDoFinallyVariable())
     {
         this.set_StateMachineVersion(0);
         return;
     }
     this.GetStateVariable();
     this.set_StateMachineVersion(1);
     return;
 }
コード例 #4
0
 private MethodSpecificContext CloneAndReplaceMethodBody(MethodSpecificContext context, MethodBody methodBody)
 {
     return(new MethodSpecificContext(context.get_AnalysisResults(), context.get_YieldData(), context.get_AsyncData(), context.get_IsMethodBodyChanged(), new Dictionary <string, Statement>(context.get_GotoLabels()), new List <GotoStatement>(context.get_GotoStatements()), context.get_StackData(), context.get_IsBaseConstructorInvokingConstructor(), context.get_EnableEventAnalysis(), methodBody, new Collection <VariableDefinition>(context.get_Variables()), context.get_ControlFlowGraph(), context.get_Expressions(), context.get_LogicalConstructsTree(), context.get_LogicalConstructsContext(), context.get_CtorInvokeExpression(), new Dictionary <Statement, ILogicalConstruct>(context.get_StatementToLogicalConstruct()), new Dictionary <ILogicalConstruct, List <Statement> >(context.get_LogicalConstructToStatements()), new Dictionary <VariableDefinition, string>(context.get_VariableDefinitionToNameMap()), new HashSet <string>(context.get_VariableNamesCollection()), new Dictionary <ParameterDefinition, string>(context.get_ParameterDefinitionToNameMap()), new HashSet <VariableDefinition>(context.get_VariablesToRename()), new Dictionary <FieldDefinition, Expression>(context.get_FieldToExpression()), context.get_LambdaVariablesCount(), new Dictionary <VariableDefinition, AssignmentType>(context.get_VariableAssignmentData()), new List <ParameterDefinition>(context.get_OutParametersToAssign()), context.get_IsDestructor(), context.get_DestructorStatements(), new HashSet <VariableDefinition>(context.get_UndeclaredLinqVariables()), new Dictionary <VariableReference, Dictionary <FieldDefinition, Expression> >(context.get_ClosureVariableToFieldValue()), new HashSet <VariableDefinition>(context.get_VariablesToNotDeclare()), context.get_SwitchByStringData().Clone() as CompilerOptimizedSwitchByStringData));
 }