<commit_before>class CodesignRequirement < Requirement
  fatal true

  satisfy(:build_env => false) do
    mktemp do
      FileUtils.cp "/usr/bin/false", "llvm_check"
      quiet_system "/usr/bin/codesign", "-f", "-s", "lldb_codesign", "--dryrun", "llvm_check"
    end
  end

  def message
    <<~EOS
      lldb_codesign identity must be available to build with LLDB.
      See: https://llvm.org/svn/llvm-project/lldb/trunk/docs/code-signing.txt
    EOS
  end
end

class LlvmAT5 < Formula
  desc "Next-gen compiler infrastructure"
  homepage "https://llvm.org/"
  url "https://releases.llvm.org/5.0.2/llvm-5.0.2.src.tar.xz"
  sha256 "d522eda97835a9c75f0b88ddc81437e5edbb87dc2740686cb8647763855c2b3c"

  bottle do
    cellar :any
    sha256 "d76f7ca753dd3464883c0ec21ce6751c7de02b3db9ee4fad19925e5283d902b8" => :high_sierra
    sha256 "a2eb1622d8ff63b6b38f3611ed5c0d9f5a609468d279d90ae10fb583c3388392" => :sierra
    sha256 "d240e166d5116243fce9d518da0167678aaa3b17151be702cdf9d38f57f27e54" => :el_capitan
    sha256 "ce13973ad49693b268f9a06ae99c9a247abef76d146028b693295c799529fc0c" => :x86_64_linux
  end

  pour_bottle? do
    default_prefix = BottleSpecification::DEFAULT_PREFIX
    reason "The bottle needs to be installed into #{default_prefix}."
    satisfy { OS.mac? || HOMEBREW_PREFIX.to_s == default_prefix }
  end

  head do
    url "https://llvm.org/git/llvm.git", :branch => "release_50"

    resource "clang" do
      url "https://llvm.org/git/clang.git", :branch => "release_50"
    end

    resource "clang-extra-tools" do
      url "https://llvm.org/git/clang-tools-extra.git", :branch => "release_50"
    end

    resource "compiler-rt" do
      url "https://llvm.org/git/compiler-rt.git", :branch => "release_50"
    end

    resource "libcxx" do
      url "https://llvm.org/git/libcxx.git", :branch => "release_50"
    end

    resource "libcxxabi" do
      url "http://llvm.org/git/libcxxabi.git", :branch => "release_50"
    end

    resource "libunwind" do
      url "https://llvm.org/git/libunwind.git", :branch => "release_50"
    end

    resource "lld" do
      url "https://llvm.org/git/lld.git", :branch => "release_50"
    end

    resource "lldb" do
      url "https://llvm.org/git/lldb.git", :branch => "release_50"
    end

    resource "openmp" do
      url "https://llvm.org/git/openmp.git", :branch => "release_50"
    end

    resource "polly" do
      url "https://llvm.org/git/polly.git", :branch => "release_50"
    end
  end

  keg_only :versioned_formula

  option "without-compiler-rt", "Do not build Clang runtime support libraries for code sanitizers, builtins, and profiling"
  if OS.mac?
    option "without-libcxx", "Do not build libc++ standard library"
  else
    option "with-libcxx", "Build libc++ standard library"
  end
  option "with-toolchain", "Build with Toolchain to facilitate overriding system compiler"
  option "with-lldb", "Build LLDB debugger"
  option "with-python@2", "Build bindings against Homebrew's Python 2"
  option "with-shared-libs", "Build shared instead of static libraries"
  option "without-libffi", "Do not use libffi to call external functions"

  deprecated_option "with-python" => "with-python@2"

  # https://llvm.org/docs/GettingStarted.html#requirement
  depends_on "libffi" => :recommended

  # for the 'dot' tool (lldb)
  depends_on "graphviz" => :optional

  depends_on "ocaml" => :optional
  if build.with? "ocaml"
    depends_on "opam" => :build
    depends_on "pkg-config" => :build
  end

  unless OS.mac?
    depends_on "gcc" # <atomic> is provided by gcc
    depends_on "glibc" => (OS::Linux::Glibc.system_version.to_f >= 2.19) ? :optional : :recommended<commit_msg>llvm@5: Fix glibc dependency logic<commit_after>class CodesignRequirement < Requirement
  fatal true

  satisfy(:build_env => false) do
    mktemp do
      FileUtils.cp "/usr/bin/false", "llvm_check"
      quiet_system "/usr/bin/codesign", "-f", "-s", "lldb_codesign", "--dryrun", "llvm_check"
    end
  end

  def message
    <<~EOS
      lldb_codesign identity must be available to build with LLDB.
      See: https://llvm.org/svn/llvm-project/lldb/trunk/docs/code-signing.txt
    EOS
  end
end

class LlvmAT5 < Formula
  desc "Next-gen compiler infrastructure"
  homepage "https://llvm.org/"
  url "https://releases.llvm.org/5.0.2/llvm-5.0.2.src.tar.xz"
  sha256 "d522eda97835a9c75f0b88ddc81437e5edbb87dc2740686cb8647763855c2b3c"

  bottle do
    cellar :any
    sha256 "d76f7ca753dd3464883c0ec21ce6751c7de02b3db9ee4fad19925e5283d902b8" => :high_sierra
    sha256 "a2eb1622d8ff63b6b38f3611ed5c0d9f5a609468d279d90ae10fb583c3388392" => :sierra
    sha256 "d240e166d5116243fce9d518da0167678aaa3b17151be702cdf9d38f57f27e54" => :el_capitan
    sha256 "ce13973ad49693b268f9a06ae99c9a247abef76d146028b693295c799529fc0c" => :x86_64_linux
  end

  pour_bottle? do
    default_prefix = BottleSpecification::DEFAULT_PREFIX
    reason "The bottle needs to be installed into #{default_prefix}."
    satisfy { OS.mac? || HOMEBREW_PREFIX.to_s == default_prefix }
  end

  head do
    url "https://llvm.org/git/llvm.git", :branch => "release_50"

    resource "clang" do
      url "https://llvm.org/git/clang.git", :branch => "release_50"
    end

    resource "clang-extra-tools" do
      url "https://llvm.org/git/clang-tools-extra.git", :branch => "release_50"
    end

    resource "compiler-rt" do
      url "https://llvm.org/git/compiler-rt.git", :branch => "release_50"
    end

    resource "libcxx" do
      url "https://llvm.org/git/libcxx.git", :branch => "release_50"
    end

    resource "libcxxabi" do
      url "http://llvm.org/git/libcxxabi.git", :branch => "release_50"
    end

    resource "libunwind" do
      url "https://llvm.org/git/libunwind.git", :branch => "release_50"
    end

    resource "lld" do
      url "https://llvm.org/git/lld.git", :branch => "release_50"
    end

    resource "lldb" do
      url "https://llvm.org/git/lldb.git", :branch => "release_50"
    end

    resource "openmp" do
      url "https://llvm.org/git/openmp.git", :branch => "release_50"
    end

    resource "polly" do
      url "https://llvm.org/git/polly.git", :branch => "release_50"
    end
  end

  keg_only :versioned_formula

  option "without-compiler-rt", "Do not build Clang runtime support libraries for code sanitizers, builtins, and profiling"
  if OS.mac?
    option "without-libcxx", "Do not build libc++ standard library"
  else
    option "with-libcxx", "Build libc++ standard library"
  end
  option "with-toolchain", "Build with Toolchain to facilitate overriding system compiler"
  option "with-lldb", "Build LLDB debugger"
  option "with-python@2", "Build bindings against Homebrew's Python 2"
  option "with-shared-libs", "Build shared instead of static libraries"
  option "without-libffi", "Do not use libffi to call external functions"

  deprecated_option "with-python" => "with-python@2"

  # https://llvm.org/docs/GettingStarted.html#requirement
  depends_on "libffi" => :recommended

  # for the 'dot' tool (lldb)
  depends_on "graphviz" => :optional

  depends_on "ocaml" => :optional
  if build.with? "ocaml"
    depends_on "opam" => :build
    depends_on "pkg-config" => :build
  end

  unless OS.mac?
    depends_on "gcc" # <atomic> is provided by gcc
    depends_on "glibc" => (Formula["glibc"].installed? || OS::Linux::Glibc.system_version < Formula["glibc"].version) ? :recommended : :optional
{'fraction_non_alphanumeric': 0.1264554562686163, 'fraction_numerical': 0.07040346601678851, 'mean_word_length': 3.585350713842334, 'pattern_counts': {'":': 0, '<': 14, '<?xml version=': 0, '>': 52, 'https://': 28, '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': '573886', 'n_tokens_mistral': 3045, 'n_tokens_neox': 2707, 'n_words': 590}