llvm_profparser 0.8.3

Parsing and interpretation of llvm coverage profiles and generated data
Documentation
use std::{env, process::Command};

fn main() {
    for i in 11..21 {
        println!("cargo::rustc-check-cfg=cfg(llvm_{})", i)
    }
    let rustc = env::var("RUSTC").unwrap();

    let output = Command::new(rustc).arg("-vV").output().unwrap();

    let version_info = String::from_utf8_lossy(&output.stdout);

    if let Some(major) = version_info
        .lines()
        .find_map(|x| x.strip_prefix("LLVM version: "))
        .and_then(|x| x.split('.').next())
    {
        println!("cargo:rustc-cfg=llvm_{}", major);
    }
}