<commit_before>-- Copyright 2021 Google LLC
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
--      http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-- See the License for the specific language governing permissions and
-- limitations under the License.

import Data.Char
import Data.List
import Data.Maybe

import System.Directory
import System.FilePath

import Distribution.ModuleName hiding (main)
import Distribution.Simple
import Distribution.Simple.Setup
import Distribution.Simple.Program
import Distribution.Types.BuildInfo.Lens
import Distribution.Types.Library.Lens
import Distribution.Types.TestSuite.Lens
import Distribution.Types.GenericPackageDescription
import Distribution.Types.CondTree

import Control.Monad
import Control.Lens.Setter
import Control.Lens.Operators ((&))

llvmVersion :: Version
llvmVersion = mkVersion [13]

llvmConfigProgram :: Program
llvmConfigProgram = (simpleProgram "llvm-config")
  { programFindVersion =
      findProgramVersion "--version" (takeWhile (\c -> isDigit c || c == '.'))
  }

getLLVMConfig :: ConfigFlags -> IO ([String] -> IO String)
getLLVMConfig confFlags = do
  (program, _, _) <- requireProgramVersion
                       verbosity
                       llvmConfigProgram
                       (withinVersion llvmVersion)
                       (configPrograms confFlags)
  return $ getProgramOutput verbosity program
  where verbosity = fromFlag $ configVerbosity confFlags

ccProgram = simpleProgram "c++"

getCC :: ConfigFlags -> IO ([String] -> IO ())
getCC confFlags = do
  (program, _) <- requireProgram verbosity ccProgram (configPrograms confFlags)
  return $ runProgram verbosity program
  where verbosity = fromFlag $ configVerbosity confFlags

isIncludeDir :: String -> Bool<commit_msg>Update llvm-config version to 14<commit_after>-- Copyright 2021 Google LLC
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
--      http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-- See the License for the specific language governing permissions and
-- limitations under the License.

import Data.Char
import Data.List
import Data.Maybe

import System.Directory
import System.FilePath

import Distribution.ModuleName hiding (main)
import Distribution.Simple
import Distribution.Simple.Setup
import Distribution.Simple.Program
import Distribution.Types.BuildInfo.Lens
import Distribution.Types.Library.Lens
import Distribution.Types.TestSuite.Lens
import Distribution.Types.GenericPackageDescription
import Distribution.Types.CondTree

import Control.Monad
import Control.Lens.Setter
import Control.Lens.Operators ((&))

llvmVersion :: Version
llvmVersion = mkVersion [14]

llvmConfigProgram :: Program
llvmConfigProgram = (simpleProgram "llvm-config")
  { programFindVersion =
      findProgramVersion "--version" (takeWhile (\c -> isDigit c || c == '.'))
  }

getLLVMConfig :: ConfigFlags -> IO ([String] -> IO String)
getLLVMConfig confFlags = do
  (program, _, _) <- requireProgramVersion
                       verbosity
                       llvmConfigProgram
                       (withinVersion llvmVersion)
                       (configPrograms confFlags)
  return $ getProgramOutput verbosity program
  where verbosity = fromFlag $ configVerbosity confFlags

ccProgram = simpleProgram "c++"

getCC :: ConfigFlags -> IO ([String] -> IO ())
getCC confFlags = do
  (program, _) <- requireProgram verbosity ccProgram (configPrograms confFlags)
  return $ runProgram verbosity program
  where verbosity = fromFlag $ configVerbosity confFlags

isIncludeDir :: String -> Bool
{'fraction_non_alphanumeric': 0.08464984673426079, 'fraction_numerical': 0.005187455788729073, 'mean_word_length': 3.7133333333333334, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 15, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '2413409', 'n_tokens_mistral': 1091, 'n_tokens_neox': 1057, 'n_words': 387}