private void VisitParameters(ReadOnlyCollection <ParameterAst> parameters)
 {
     foreach (ParameterAst ast in parameters)
     {
         VariablePath variablePath = ast.Name.VariablePath;
         if (variablePath.IsAnyLocal())
         {
             VariableAnalysisDetails details;
             string unaliasedVariableName = VariableAnalysis.GetUnaliasedVariableName(variablePath);
             if (this._variables.TryGetValue(unaliasedVariableName, out details))
             {
                 object obj2;
                 details.Type = ast.StaticType;
                 if (!Compiler.TryGetDefaultParameterValue(ast.StaticType, out obj2))
                 {
                     details.LocalTupleIndex = -2;
                 }
             }
             else
             {
                 this.NoteVariable(unaliasedVariableName, -1, ast.StaticType, false, false);
             }
         }
     }
 }
        public override AstVisitAction VisitVariableExpression(VariableExpressionAst variableExpressionAst)
        {
            VariablePath variablePath = variableExpressionAst.VariablePath;

            if (variablePath.IsAnyLocal())
            {
                if (variablePath.IsPrivate)
                {
                    this._disableOptimizations = true;
                }
                this.NoteVariable(VariableAnalysis.GetUnaliasedVariableName(variablePath), -1, null, false, false);
            }
            return(AstVisitAction.Continue);
        }
Beispiel #3
0
 internal LoopGotoTargets(string label, VariableAnalysis.Block breakTarget, VariableAnalysis.Block continueTarget)
 {
     this.Label = label;
     this.BreakTarget = breakTarget;
     this.ContinueTarget = continueTarget;
 }
Beispiel #4
0
 private static void VisitDepthFirstOrder(VariableAnalysis.Block block, List<VariableAnalysis.Block> visitData)
 {
     if (!object.ReferenceEquals(block._visitData, visitData))
     {
         block._visitData = visitData;
         foreach (VariableAnalysis.Block block2 in block._successors)
         {
             VisitDepthFirstOrder(block2, visitData);
         }
         visitData.Add(block);
     }
 }
Beispiel #5
0
 internal static List<VariableAnalysis.Block> GenerateReverseDepthFirstOrder(VariableAnalysis.Block block)
 {
     List<VariableAnalysis.Block> visitData = new List<VariableAnalysis.Block>();
     VisitDepthFirstOrder(block, visitData);
     visitData.Reverse();
     visitData.ForEach(delegate (VariableAnalysis.Block b) {
         b._visitData = null;
     });
     return visitData;
 }
Beispiel #6
0
 internal void FlowsTo(VariableAnalysis.Block next)
 {
     if (this._successors.IndexOf(next) < 0)
     {
         this._successors.Add(next);
         next._predecessors.Add(this);
     }
 }