<commit_before>#!/usr/bin/env python
import re
from waflib.Configure import conf

def configure(ctx):
    ctx.find_program('clang',   var='CLANG',   mandatory=True)
    ctx.find_program('clang++', var='CLANG++', mandatory=True)

@conf
def assert_clang_version(ctx, minVer):
    reg = re.compile(r'.*clang version ([0-9].[0-9]).*',re.M)
    out = ctx.cmd_and_log(ctx.env['CLANG']+['--version'])
    ver_s = reg.findall(out)[0].split('.')
    ver_i = tuple([int(s) for s in ver_s[0:2]])

    msg = 'Checking for Clang version'
    res = '.'.join(map(str,ver_i))

    if (float(res) < minVer):
        ctx.msg(msg, res, color='RED')
        ctx.fatal('clang version is too old')
    else:
        ctx.msg(msg, res, color='GREEN')

    return ver_i

@conf
def set_clang_compiler(ctx):
    # This is because we link cpp against c. Sanitizers require clang++ for
    # linking in that case
    ctx.env['LINK_CC'] = ctx.env['CLANG++']
    ctx.env['COMPILER_CC'] = ctx.env['CC'] = ctx.env['CLANG']
    ctx.env['LINK_CXX'] = ctx.env['COMPILER_CXX'] = ctx.env['CXX'] = ctx.env['CLANG++']
<commit_msg>Fixed up clang tool<commit_after>#!/usr/bin/env python
import re
from waflib.Configure import conf

def configure(ctx):
    ctx.find_program('clang',   var='CLANG',   mandatory=True)
    ctx.find_program('clang++', var='CLANG++', mandatory=True)

@conf
def assert_clang_version(ctx, minVer):
    reg = re.compile(r'.*clang version ([0-9]*.[0-9]*).*',re.M)
    out = ctx.cmd_and_log(ctx.env['CLANG']+['--version'])
    ver_s = reg.findall(out)[0].split('.')
    ver_i = tuple([int(s) for s in ver_s[0:2]])

    msg = 'Checking for Clang version'
    res = '.'.join(map(str,ver_i))

    if (float(res) < minVer):
        ctx.msg(msg, res, color='RED')
        ctx.fatal('clang version is too old')
    else:
        ctx.msg(msg, res, color='GREEN')

    return ver_i

@conf
def set_clang_compiler(ctx):
    # This is because we link cpp against c. Sanitizers require clang++ for
    # linking in that case
    ctx.env['LINK_CC'] = ctx.env['CLANG++']
    ctx.env['COMPILER_CC'] = ctx.env['CC'] = ctx.env['CLANG']
    ctx.env['LINK_CXX'] = ctx.env['COMPILER_CXX'] = ctx.env['CXX'] = ctx.env['CLANG++']

{'fraction_non_alphanumeric': 0.19012797074954296, 'fraction_numerical': 0.006398537477148081, 'mean_word_length': 3.63771186440678, 'pattern_counts': {'":': 0, '<': 5, '<?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': '2454363', 'n_tokens_mistral': 853, 'n_tokens_neox': 837, 'n_words': 175}