<commit_before>namespace Cxxi.Passes
{
    public class CleanUnitPass : TranslationUnitPass
    {
        public DriverOptions Options;
        public PassBuilder Passes;

        public CleanUnitPass(DriverOptions options)
        {
            Options = options;
        }

        public override bool VisitTranslationUnit(TranslationUnit unit)
        {
            // Try to get an include path that works from the original include
            // directories paths.

            unit.IncludePath = GetIncludePath(unit.FilePath);
            return true;
        }

        string GetIncludePath(string filePath)
        {
            var includePath = filePath;
            var shortestIncludePath = filePath;

            foreach (var path in Options.IncludeDirs)
            {
                int idx = filePath.IndexOf(path, System.StringComparison.Ordinal);
                if (idx == -1) continue;

                string inc = filePath.Substring(path.Length);

                if (inc.Length < includePath.Length && inc.Length < shortestIncludePath.Length)
                    shortestIncludePath = inc;
            }

            return Options.IncludePrefix + shortestIncludePath.TrimStart(new char[] { '\\', '/' });
        }
    }

    public static class CleanUnitPassExtensions
    {
        public static void CleanUnit(this PassBuilder builder, DriverOptions options)
        {
            var pass = new CleanUnitPass(options);
            builder.AddPass(pass);
        }
    }
}<commit_msg>Use a different name for driver options in CleanUnitPass so it does not hide an inherited name.<commit_after>namespace Cxxi.Passes
{
    public class CleanUnitPass : TranslationUnitPass
    {
        public DriverOptions DriverOptions;
        public PassBuilder Passes;

        public CleanUnitPass(DriverOptions options)
        {
            DriverOptions = options;
        }

        public override bool VisitTranslationUnit(TranslationUnit unit)
        {
            // Try to get an include path that works from the original include
            // directories paths.

            unit.IncludePath = GetIncludePath(unit.FilePath);
            return true;
        }

        string GetIncludePath(string filePath)
        {
            var includePath = filePath;
            var shortestIncludePath = filePath;

            foreach (var path in DriverOptions.IncludeDirs)
            {
                int idx = filePath.IndexOf(path, System.StringComparison.Ordinal);
                if (idx == -1) continue;

                string inc = filePath.Substring(path.Length);

                if (inc.Length < includePath.Length && inc.Length < shortestIncludePath.Length)
                    shortestIncludePath = inc;
            }

            return DriverOptions.IncludePrefix
                + shortestIncludePath.TrimStart(new char[] { '\\', '/' });
        }
    }

    public static class CleanUnitPassExtensions
    {
        public static void CleanUnit(this PassBuilder builder, DriverOptions options)
        {
            var pass = new CleanUnitPass(options);
            builder.AddPass(pass);
        }
    }
}
{'fraction_non_alphanumeric': 0.0708836617927527, 'fraction_numerical': 0.0006357279084551812, 'mean_word_length': 1.835135135135135, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 3, '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': '4723634', 'n_tokens_mistral': 770, 'n_tokens_neox': 725, 'n_words': 202}