Exemplo n.º 1
0
        internal static BoundStatement AnalyzeMethodBody(MethodBodyCompiler methodCompiler, MethodSymbol method, BoundBlock body, DiagnosticBag diagnostics)
        {
            Debug.Assert(diagnostics != null);

            body = FlowAnalysisPass.Rewrite(method, body, diagnostics);
            var analyzedBody = (BoundBlock)RewritePass.Rewrite(methodCompiler, method.ContainingType, body);

            return(RewritePass.InsertPrologueSequencePoint(analyzedBody, method));
        }
Exemplo n.º 2
0
        internal BoundStatement AnalyzeMethodBody(MethodSymbol method, BoundBlock block, bool generateDebugInfo, DiagnosticBag diagnostics)
        {
            var diagnostics2 = DiagnosticBag.GetInstance();
            var analyzed1    = FlowAnalysisPass.Rewrite(method, block, diagnostics2);

            if (diagnostics != null)
            {
                diagnostics.Add(diagnostics2);
            }
            diagnostics2.Free();
            return(RewritePass.Rewrite(analyzed1, generateDebugInfo));
        }
Exemplo n.º 3
0
        internal static BoundStatementList AnalyzeFieldInitializers(MethodBodyCompiler methodCompiler, MethodSymbol constructor, ReadOnlyArray <BoundInitializer> boundInitializers)
        {
            if (boundInitializers.IsNull)
            {
                return(null);
            }

            // The lowered tree might be reused in multiple constructors. Therefore, unless there is just a single constructor
            // (e.g. in interactive submission), the lowered code should not refer to it.
            var initializerStatements = InitializerRewriter.Rewrite(boundInitializers, constructor.IsInteractiveSubmissionConstructor ? constructor : null);

            return((BoundStatementList)RewritePass.Rewrite(methodCompiler, constructor.ContainingType, initializerStatements));
        }