Beispiel #1
0
        private static void ExportMethod(string code, TextWriter writer, string functionName)
        {
            (var method, var semanticModel) = TestHelper.Compile(code).GetMethod(functionName);
            var exporterMetrics = new MlirExporterMetrics();
            var exporter        = new MlirExporter(writer, semanticModel, exporterMetrics, false);

            exporter.ExportFunction(method);
        }
Beispiel #2
0
        private static void ExportAllMethods(string code, TextWriter writer, bool withLoc)
        {
            (var ast, var semanticModel) = TestHelper.Compile(code);
            var exporterMetrics = new MlirExporterMetrics();
            var exporter        = new MlirExporter(writer, semanticModel, exporterMetrics, withLoc);

            foreach (var method in ast.GetRoot().DescendantNodes().OfType <MethodDeclarationSyntax>())
            {
                exporter.ExportFunction(method);
            }
        }