Пример #1
0
        protected RegionPlace regionPlace; // tells whether we are analyzing the region before, during, or after the region

        protected RegionAnalysisWalker(Compilation compilation, SyntaxTree tree, MethodSymbol method, BoundStatement block, TextSpan region, ThisSymbolCache thisSymbolCache, HashSet<Symbol> unassignedVariables = null, bool trackUnassignmentsInLoops = false)
            : base(compilation, tree, method, block, thisSymbolCache, unassignedVariables, trackUnassignmentsInLoops)
        {
            this.region = region;

            // assign slots to the parameters
            foreach (var parameter in method.Parameters)
            {
                MakeSlot(parameter);
            }
        }
Пример #2
0
        protected FlowAnalysisWalker(
            Compilation compilation,
            SyntaxTree tree,
            MethodSymbol method,
            BoundStatement block,
            ThisSymbolCache thisSymbolCache             = null,
            HashSet <Symbol> initiallyAssignedVariables = null,
            bool trackUnassignmentsInLoops = false)
        {
            this.compilation                = compilation;
            this.tree                       = tree;
            this.method                     = method;
            this.block                      = block;
            this.thisSymbolCache            = thisSymbolCache ?? new ThisSymbolCache();
            this.initiallyAssignedVariables = initiallyAssignedVariables;
            this.loopHeadState              = trackUnassignmentsInLoops ? new Dictionary <BoundLoopStatement, FlowAnalysisLocalState>() : null;

            // TODO: mark "this" as not assigned in a struct constructor (unless it has no fields)
            // TODO: accommodate instance variables of a local variable of struct type.
        }
Пример #3
0
        protected RegionPlace regionPlace; // tells whether we are analyzing the region before, during, or after the region

        protected RegionAnalysisWalker(Compilation compilation, SyntaxTree tree, MethodSymbol method, BoundStatement block, TextSpan region, ThisSymbolCache thisSymbolCache, HashSet <Symbol> unassignedVariables = null, bool trackUnassignmentsInLoops = false)
            : base(compilation, tree, method, block, thisSymbolCache, unassignedVariables, trackUnassignmentsInLoops)
        {
            this.region = region;

            // assign slots to the parameters
            foreach (var parameter in method.Parameters)
            {
                MakeSlot(parameter);
            }
        }
Пример #4
0
        protected FlowAnalysisWalker(
            Compilation compilation,
            SyntaxTree tree,
            MethodSymbol method,
            BoundStatement block,
            ThisSymbolCache thisSymbolCache = null,
            HashSet<Symbol> initiallyAssignedVariables = null,
            bool trackUnassignmentsInLoops = false)
        {
            this.compilation = compilation;
            this.tree = tree;
            this.method = method;
            this.block = block;
            this.thisSymbolCache = thisSymbolCache ?? new ThisSymbolCache();
            this.initiallyAssignedVariables = initiallyAssignedVariables;
            this.loopHeadState = trackUnassignmentsInLoops ? new Dictionary<BoundLoopStatement, FlowAnalysisLocalState>() : null;

            // TODO: mark "this" as not assigned in a struct constructor (unless it has no fields)
            // TODO: accommodate instance variables of a local variable of struct type.
        }