<commit_before>{-# OPTIONS -fno-warn-unused-binds #-}
-- -----------------------------------------------------------------------------
-- | GHC LLVM Mangler
--
-- This script processes the assembly produced by LLVM, rearranging the code
-- so that an info table appears before its corresponding function.
--
-- On OSX we also use it to fix up the stack alignment, which needs to be 16
-- byte aligned but always ends up off by word bytes because GHC sets it to
-- the 'wrong' starting value in the RTS.
--

module LlvmMangler ( llvmFixupAsm ) where

#include "HsVersions.h"

import LlvmCodeGen.Ppr ( infoSection )

import Control.Exception
import Control.Monad ( when )
import qualified Data.ByteString.Char8 as B
import Data.Char
import System.IO

import Data.List ( sortBy )
import Data.Function ( on )

-- Magic Strings
secStmt, infoSec, newLine, spInst, jmpInst, textStmt, dataStmt :: B.ByteString
secStmt    = B.pack "\t.section\t"
infoSec    = B.pack infoSection
newLine    = B.pack "\n"
jmpInst    = B.pack "\n\tjmp"
textStmt   = B.pack "\t.text"
dataStmt   = B.pack "\t.data"
syntaxUnified = B.pack "\t.syntax unified"

infoLen, labelStart, spFix :: Int
infoLen    = B.length infoSec
labelStart = B.length jmpInst

#if x86_64_TARGET_ARCH
spInst     = B.pack ", %rsp\n"
spFix      = 8
#else
spInst     = B.pack ", %esp\n"
spFix      = 4
#endif
<commit_msg>Warning police<commit_after>{-# OPTIONS -fno-warn-unused-binds #-}
-- -----------------------------------------------------------------------------
-- | GHC LLVM Mangler
--
-- This script processes the assembly produced by LLVM, rearranging the code
-- so that an info table appears before its corresponding function.
--
-- On OSX we also use it to fix up the stack alignment, which needs to be 16
-- byte aligned but always ends up off by word bytes because GHC sets it to
-- the 'wrong' starting value in the RTS.
--

module LlvmMangler ( llvmFixupAsm ) where

#include "HsVersions.h"

import LlvmCodeGen.Ppr ( infoSection )

import Control.Exception
import Control.Monad ( when )
import qualified Data.ByteString.Char8 as B
import Data.Char
import System.IO

import Data.List ( sortBy )
import Data.Function ( on )

-- Magic Strings
secStmt, infoSec, newLine, spInst, jmpInst, textStmt, dataStmt, syntaxUnified :: B.ByteString
secStmt    = B.pack "\t.section\t"
infoSec    = B.pack infoSection
newLine    = B.pack "\n"
jmpInst    = B.pack "\n\tjmp"
textStmt   = B.pack "\t.text"
dataStmt   = B.pack "\t.data"
syntaxUnified = B.pack "\t.syntax unified"

infoLen, labelStart, spFix :: Int
infoLen    = B.length infoSec
labelStart = B.length jmpInst

#if x86_64_TARGET_ARCH
spInst     = B.pack ", %rsp\n"
spFix      = 8
#else
spInst     = B.pack ", %esp\n"
spFix      = 4
#endif

{'fraction_non_alphanumeric': 0.15791393143690738, 'fraction_numerical': 0.006564551422319475, 'mean_word_length': 2.595019659239843, 'pattern_counts': {'":': 0, '<': 3, '<?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': '6936162', 'n_tokens_mistral': 910, 'n_tokens_neox': 895, 'n_words': 304}