<commit_before>﻿using CSharpLLVM.Helpers;
using Mono.Cecil;
using Swigged.LLVM;
using System;

namespace CSharpLLVM.Compiler
{
    class TypeCompiler
    {
        private Compiler mcompiler;
        private Lookup mlookup;

        /// <summary>
        /// Creates a new TypeCompiler
        /// </summary>
        /// <param name="compiler">The compiler</param>
        /// <param name="lookup">The lookup</param>
        public TypeCompiler(Compiler compiler, Lookup lookup)
        {
            mcompiler = compiler;
            mlookup = lookup;
        }

        /// <summary>
        /// Compiles a type
        /// </summary>
        /// <param name="type">The type</param>
        public void Compile(TypeDefinition type)
        {
            bool isStruct = (!type.IsEnum && type.IsValueType);
            bool isEnum = type.IsEnum;
            bool isClass = (!isStruct && !isStruct);

            ConsoleColor color = isStruct ? ConsoleColor.Cyan : isEnum ? ConsoleColor.DarkGreen : ConsoleColor.DarkCyan;

            // Log
            Console.ForegroundColor = color;
            Console.WriteLine(string.Format("Compiling type {0}", type.FullName));
            Console.ForegroundColor = ConsoleColor.Gray;

            // Enums are treated as 32-bit ints
            if (isEnum)
            {
                mlookup.AddType(type, TypeHelper.Int32);
            }
            // Structs and classes
            else
            {
                // Fields
                foreach (FieldDefinition field in type.Fields)
                {
                    if (field.FullName[0] == '<')
                        continue;

                    if (field.IsStatic)
                    {
                        TypeRef fieldType = TypeHelper.GetTypeRefFromType(field.FieldType);
                        ValueRef val = LLVM.AddGlobal(mcompiler.Module, fieldType, NameHelper.CreateFieldName(field.FullName));
<commit_msg>Change color<commit_after>﻿using CSharpLLVM.Helpers;
using Mono.Cecil;
using Swigged.LLVM;
using System;

namespace CSharpLLVM.Compiler
{
    class TypeCompiler
    {
        private Compiler mcompiler;
        private Lookup mlookup;

        /// <summary>
        /// Creates a new TypeCompiler
        /// </summary>
        /// <param name="compiler">The compiler</param>
        /// <param name="lookup">The lookup</param>
        public TypeCompiler(Compiler compiler, Lookup lookup)
        {
            mcompiler = compiler;
            mlookup = lookup;
        }

        /// <summary>
        /// Compiles a type
        /// </summary>
        /// <param name="type">The type</param>
        public void Compile(TypeDefinition type)
        {
            bool isStruct = (!type.IsEnum && type.IsValueType);
            bool isEnum = type.IsEnum;
            bool isClass = (!isStruct && !isStruct);

            ConsoleColor color = isStruct ? ConsoleColor.DarkCyan : isEnum ? ConsoleColor.DarkGreen : ConsoleColor.Cyan;

            // Log
            Console.ForegroundColor = color;
            Console.WriteLine(string.Format("Compiling type {0}", type.FullName));
            Console.ForegroundColor = ConsoleColor.Gray;

            // Enums are treated as 32-bit ints
            if (isEnum)
            {
                mlookup.AddType(type, TypeHelper.Int32);
            }
            // Structs and classes
            else
            {
                // Fields
                foreach (FieldDefinition field in type.Fields)
                {
                    if (field.FullName[0] == '<')
                        continue;

                    if (field.IsStatic)
                    {
                        TypeRef fieldType = TypeHelper.GetTypeRefFromType(field.FieldType);
                        ValueRef val = LLVM.AddGlobal(mcompiler.Module, fieldType, NameHelper.CreateFieldName(field.FullName));

{'fraction_non_alphanumeric': 0.10069713400464755, 'fraction_numerical': 0.003098373353989156, 'mean_word_length': 1.5353403141361257, 'pattern_counts': {'":': 0, '<': 25, '<?xml version=': 0, '>': 23, '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': '7230089', 'n_tokens_mistral': 1010, 'n_tokens_neox': 969, 'n_words': 223}