<commit_before>extern crate cc;

use std::env;
use std::path::PathBuf;

fn main() {
    cc::Build::new()
        .cpp(true)
        .opt_level(0)
        .include("llvm/headers")
        .flag_if_supported("-pedantic")
        .flag_if_supported("-std=c++11")
        .flag_if_supported("-fno-rtti")
        .flag_if_supported("-Wno-unused-parameter")
        .define("_GLIBCXX_USE_CXX11_ABI", "0")
        .file("llvm/find-external-refs.cpp")
        .file("llvm/internalize.cpp")
        .file("llvm/rename-globals.cpp")
        .file("llvm/helpers/visitors.cpp")
        .compile("librust-ptx-llvm-stuff.a");

    link_rustc_llvm_lib();
}

fn link_rustc_llvm_lib() {
    match find_rustc_llvm_lib() {
        Some(path) => {
            let location = path.as_path().parent().unwrap().to_str().unwrap();
            let name = path.as_path().file_stem().unwrap().to_str().unwrap();

            let libname = match name.starts_with("lib") {
                true => &name[3..],
                false => name,
            };

            println!("cargo:rustc-link-search=native={}", location);
            println!("cargo:rustc-link-lib=dylib={}", libname);
        }

        None => {<commit_msg>Improve variable names in build script<commit_after>extern crate cc;

use std::env;
use std::path::PathBuf;

fn main() {
    cc::Build::new()
        .cpp(true)
        .opt_level(0)
        .include("llvm/headers")
        .flag_if_supported("-pedantic")
        .flag_if_supported("-std=c++11")
        .flag_if_supported("-fno-rtti")
        .flag_if_supported("-Wno-unused-parameter")
        .define("_GLIBCXX_USE_CXX11_ABI", "0")
        .file("llvm/find-external-refs.cpp")
        .file("llvm/internalize.cpp")
        .file("llvm/rename-globals.cpp")
        .file("llvm/helpers/visitors.cpp")
        .compile("librust-ptx-llvm-stuff.a");

    link_rustc_llvm_lib();
}

fn link_rustc_llvm_lib() {
    match find_rustc_llvm_lib() {
        Some(path) => {
            let lib_location = path.as_path().parent().unwrap().to_str().unwrap();
            let lib_file_name = path.as_path().file_stem().unwrap().to_str().unwrap();

            let lib_name = match lib_file_name.starts_with("lib") {
                true => &lib_file_name[3..],
                false => lib_file_name,
            };

            println!("cargo:rustc-link-search=native={}", lib_location);
            println!("cargo:rustc-link-lib=dylib={}", lib_name);
        }

        None => {
{'fraction_non_alphanumeric': 0.17320922703358965, 'fraction_numerical': 0.0056657223796034, 'mean_word_length': 2.3225806451612905, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 11, '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': '1473088', 'n_tokens_mistral': 852, 'n_tokens_neox': 846, 'n_words': 103}