<commit_before>%
% (c) The GRASP/AQUA Project, Glasgow University, 1993-1998
%
\section{Code output phase}

\begin{code}
module CodeOutput( codeOutput, outputForeignStubs ) where

#include "HsVersions.h"

#ifndef OMIT_NATIVE_CODEGEN
import UniqSupply	( mkSplitUniqSupply )
import AsmCodeGen	( nativeCodeGen )
#endif

#ifdef ILX
import IlxGen		( ilxGen )
#endif

#ifdef JAVA
import JavaGen		( javaGen )
import qualified PrintJava
import OccurAnal	( occurAnalyseBinds )
#endif

import Finder		( mkStubPaths )
import PprC		( writeCs )
import CmmLint		( cmmLint )
import Packages
import Util
import FastString	( unpackFS )
import Cmm		( Cmm )
import HscTypes
import DynFlags
import ErrUtils		( dumpIfSet_dyn, showPass, ghcExit )
import Outputable
import Pretty		( Mode(..), printDoc )
import Module		( Module, ModLocation(..) )
import List		( nub )
import Maybes		( firstJust )

import Distribution.Package	( showPackageId )
import Directory	( doesFileExist )
import Monad		( when )
import IO
\end{code}

%************************************************************************
%*									*
\subsection{Steering}
%*									*
%************************************************************************

\begin{code}
codeOutput :: DynFlags
	   -> Module
	   -> ModLocation
	   -> ForeignStubs
	   -> [PackageId]
	   -> [Cmm]			-- Compiled C--
	   -> IO (Bool{-stub_h_exists-}, Bool{-stub_c_exists-})

codeOutput dflags this_mod location foreign_stubs pkg_deps flat_abstractC
  = 
    -- You can have C (c_output) or assembly-language (ncg_output),
    -- but not both.  [Allowing for both gives a space leak on
    -- flat_abstractC.  WDP 94/10]

    -- Dunno if the above comment is still meaningful now.  JRS 001024.

    do	{ when (dopt Opt_DoCmmLinting dflags) $ do<commit_msg>Don't generate stub files when -fno-code is given.<commit_after>%
% (c) The GRASP/AQUA Project, Glasgow University, 1993-1998
%
\section{Code output phase}

\begin{code}
module CodeOutput( codeOutput, outputForeignStubs ) where

#include "HsVersions.h"

#ifndef OMIT_NATIVE_CODEGEN
import UniqSupply	( mkSplitUniqSupply )
import AsmCodeGen	( nativeCodeGen )
#endif

#ifdef ILX
import IlxGen		( ilxGen )
#endif

#ifdef JAVA
import JavaGen		( javaGen )
import qualified PrintJava
import OccurAnal	( occurAnalyseBinds )
#endif

import Finder		( mkStubPaths )
import PprC		( writeCs )
import CmmLint		( cmmLint )
import Packages
import Util
import FastString	( unpackFS )
import Cmm		( Cmm )
import HscTypes
import DynFlags
import ErrUtils		( dumpIfSet_dyn, showPass, ghcExit )
import Outputable
import Pretty		( Mode(..), printDoc )
import Module		( Module, ModLocation(..) )
import List		( nub )
import Maybes		( firstJust )

import Distribution.Package	( showPackageId )
import Directory	( doesFileExist )
import Monad		( when )
import IO
\end{code}

%************************************************************************
%*									*
\subsection{Steering}
%*									*
%************************************************************************

\begin{code}
codeOutput :: DynFlags
	   -> Module
	   -> ModLocation
	   -> ForeignStubs
	   -> [PackageId]
	   -> [Cmm]			-- Compiled C--
	   -> IO (Bool{-stub_h_exists-}, Bool{-stub_c_exists-})

codeOutput dflags this_mod location foreign_stubs pkg_deps flat_abstractC
    | HscNothing <- hscTarget dflags
      -- We aren't interested in any code when HscNothing is our target.
    = return (False, False)
    | otherwise
    =
    -- You can have C (c_output) or assembly-language (ncg_output),
    -- but not both.  [Allowing for both gives a space leak on
    -- flat_abstractC.  WDP 94/10]

    -- Dunno if the above comment is still meaningful now.  JRS 001024.

    do	{ when (dopt Opt_DoCmmLinting dflags) $ do
{'fraction_non_alphanumeric': 0.16461785141635488, 'fraction_numerical': 0.009620523784072688, 'mean_word_length': 3.89281045751634, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 15, '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': '2953970', 'n_tokens_mistral': 1318, 'n_tokens_neox': 1209, 'n_words': 348}