System.Xml.Xsl.IlGen.XmlILOptimizerVisitor.VisitQilExpression C# (CSharp) Method

VisitQilExpression() protected method

protected VisitQilExpression ( QilExpression local0 ) : QilNode
local0 System.Xml.Xsl.Qil.QilExpression
return QilNode
        protected override QilNode VisitQilExpression(QilExpression local0) {
            QilNode local1 = local0[0];
            if (this[XmlILOptimization.EliminateUnusedFunctions]) {
                if (AllowReplace(XmlILOptimization.EliminateUnusedFunctions, local0)) {
                    
    IList<QilNode> funcList = local0.FunctionList;
    for (int i = funcList.Count - 1; i >= 0; i--) {
        if (XmlILConstructInfo.Write(funcList[i]).CallersInfo.Count == 0)
            funcList.RemoveAt(i);
    }
}
            }
            if (this[XmlILOptimization.AnnotateConstruction]) {
                if (AllowReplace(XmlILOptimization.AnnotateConstruction, local0)) {
                    
    foreach (QilFunction ndFunc in local0.FunctionList) {
        // Functions that construct Xml trees should stream output to writer; otherwise, results should
        // be cached and returned.
        if (IsConstructedExpression(ndFunc.Definition)) {
            // Perform state analysis on function's content
            ndFunc.Definition = this.contentAnalyzer.Analyze(ndFunc, ndFunc.Definition);
        }
    }

    // Perform state analysis on the root expression
    local0.Root = this.contentAnalyzer.Analyze(null, local0.Root);

    // Make sure that root expression is pushed to writer
    XmlILConstructInfo.Write(local0.Root).PushToWriterLast = true;
}
            }
            return NoReplace(local0);
        }
        
XmlILOptimizerVisitor