<commit_before>﻿// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.

using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Text;
using Microsoft.Diagnostics.Tracing.Parsers;
using Microsoft.Diagnostics.Tracing.Parsers.Clr;

namespace ReadyToRun.SuperIlc
{
    public class BuildFolderSet
    {
        class FrameworkExclusion
        {
            public readonly string SimpleName;
            public readonly string Reason;
            public readonly bool Crossgen2Only;

            public FrameworkExclusion(string simpleName, string reason, bool crossgen2Only = false)
            {
                SimpleName = simpleName;
                Reason = reason;
                Crossgen2Only = crossgen2Only;
            }
        }

        private static readonly FrameworkExclusion[] s_frameworkExclusions =
        {
            new FrameworkExclusion("CommandLine", "Not a framework assembly"),
            new FrameworkExclusion("R2RDump", "Not a framework assembly"),
            new FrameworkExclusion("System.Runtime.WindowsRuntime", "WinRT is currently not supported"),
            new FrameworkExclusion("xunit.performance.api", "Not a framework assembly"),

            // TODO (DavidWr): IBC-related failures
            new FrameworkExclusion("Microsoft.CodeAnalysis.CSharp", "Ibc TypeToken 6200019a has type token which resolves to a nil token", crossgen2Only: true),
            new FrameworkExclusion("Microsoft.CodeAnalysis", "Ibc TypeToken 620001af unable to find external typedef", crossgen2Only: true),
            new FrameworkExclusion("Microsoft.CodeAnalysis.VisualBasic", "Ibc TypeToken 620002ce unable to find external typedef", crossgen2Only: true),

            // TODO (TRylek): problem related to devirtualization of method without IL - System.Enum.Equals(object)
            new FrameworkExclusion("System.ComponentModel.TypeConverter", "TODO trylek - devirtualization of method without IL", crossgen2Only: true),

            // TODO: additional framework build failures
            new FrameworkExclusion("Microsoft.Diagnostics.Tracing.TraceEvent", "Assert failure in JIT", crossgen2Only: true),
            new FrameworkExclusion("System.Private.CoreLib", "Assert failure in JIT", crossgen2Only: true),
        };

        private readonly IEnumerable<BuildFolder> _buildFolders;

        private readonly IEnumerable<CompilerRunner> _compilerRunners;

        private readonly BuildOptions _options;

        private readonly Buckets _frameworkCompilationFailureBuckets;

        private readonly Buckets _compilationFailureBuckets;

        private readonly Buckets _executionFailureBuckets;

        private readonly Dictionary<string, byte> _cpaotManagedSequentialResults;

        private readonly Dictionary<string, byte> _crossgenManagedSequentialResults;

        private readonly Dictionary<string, byte> _cpaotRequiresMarshalingResults;

        private readonly Dictionary<string, byte> _crossgenRequiresMarshalingResults;

        private readonly Dictionary<string, string> _frameworkExclusions;

        private long _frameworkCompilationMilliseconds;<commit_msg>Remove exclusion of two runtime assemblies from build in SuperILC (#27857)<commit_after>﻿// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.

using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Text;
using Microsoft.Diagnostics.Tracing.Parsers;
using Microsoft.Diagnostics.Tracing.Parsers.Clr;

namespace ReadyToRun.SuperIlc
{
    public class BuildFolderSet
    {
        class FrameworkExclusion
        {
            public readonly string SimpleName;
            public readonly string Reason;
            public readonly bool Crossgen2Only;

            public FrameworkExclusion(string simpleName, string reason, bool crossgen2Only = false)
            {
                SimpleName = simpleName;
                Reason = reason;
                Crossgen2Only = crossgen2Only;
            }
        }

        private static readonly FrameworkExclusion[] s_frameworkExclusions =
        {
            new FrameworkExclusion("CommandLine", "Not a framework assembly"),
            new FrameworkExclusion("R2RDump", "Not a framework assembly"),
            new FrameworkExclusion("System.Runtime.WindowsRuntime", "WinRT is currently not supported"),
            new FrameworkExclusion("xunit.performance.api", "Not a framework assembly"),

            // TODO (DavidWr): IBC-related failures
            new FrameworkExclusion("Microsoft.CodeAnalysis.CSharp", "Ibc TypeToken 6200019a has type token which resolves to a nil token", crossgen2Only: true),
            new FrameworkExclusion("Microsoft.CodeAnalysis", "Ibc TypeToken 620001af unable to find external typedef", crossgen2Only: true),
            new FrameworkExclusion("Microsoft.CodeAnalysis.VisualBasic", "Ibc TypeToken 620002ce unable to find external typedef", crossgen2Only: true),

            // TODO (TRylek): problem related to devirtualization of method without IL - System.Enum.Equals(object)
            new FrameworkExclusion("System.ComponentModel.TypeConverter", "TODO trylek - devirtualization of method without IL", crossgen2Only: true),
        };

        private readonly IEnumerable<BuildFolder> _buildFolders;

        private readonly IEnumerable<CompilerRunner> _compilerRunners;

        private readonly BuildOptions _options;

        private readonly Buckets _frameworkCompilationFailureBuckets;

        private readonly Buckets _compilationFailureBuckets;

        private readonly Buckets _executionFailureBuckets;

        private readonly Dictionary<string, byte> _cpaotManagedSequentialResults;

        private readonly Dictionary<string, byte> _crossgenManagedSequentialResults;

        private readonly Dictionary<string, byte> _cpaotRequiresMarshalingResults;

        private readonly Dictionary<string, byte> _crossgenRequiresMarshalingResults;

        private readonly Dictionary<string, string> _frameworkExclusions;

        private long _frameworkCompilationMilliseconds;
{'fraction_non_alphanumeric': 0.06520733775242793, 'fraction_numerical': 0.009711731154616926, 'mean_word_length': 3.351441985244802, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 17, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3099789', 'n_tokens_mistral': 1612, 'n_tokens_neox': 1504, 'n_words': 496}