コード例 #1
0
            FixUp(AstMethodDefinition source, Dictionary <VariableDefinition,
                                                          VariableDefinition> localVarSubstitution)
            {
                isVariableDefined.Clear();

                this.source = source;
                this.localVarSubstitution = localVarSubstitution;
                if (localVarSubstitution.Count > 0)
                {
                    this.source.CecilBlock = (BlockStatement)Visit(this.source.CecilBlock);
                }
                return(this.source);
            }
コード例 #2
0
            FixUp(AstMethodDefinition source, Dictionary <ParameterDefinition,
                                                          Expression> paramVarSubstitution, Expression thisSubstitution)
            {
                this.source = source;
                this.paramVarSubstitution = paramVarSubstitution;
                this.thisSubstitution     = thisSubstitution;

                exitNumber++;
                this.exitLabel = this.source.CecilBlock.Statements[this.source.Block.Statements.Count - 1] as LabeledStatement;

                if (exitLabel == null)
                {
                    this.exitLabel = new LabeledStatement("@_exit" + exitNumber);
                    this.source.CecilBlock.Statements.Add(exitLabel);
                    this.source.CecilBlock = (BlockStatement)Visit(this.source.CecilBlock);
                }
                else
                {
                    this.source.CecilBlock = (BlockStatement)Visit(this.source.CecilBlock);
                }

                return(this.source);
            }