#include "HsVersions.h"
-#ifndef OMIT_NATIVE_CODEGEN
-import AsmCodeGen ( nativeCodeGen )
-#endif
+import AsmCodeGen ( nativeCodeGen )
import LlvmCodeGen ( llvmCodeGen )
import UniqSupply ( mkSplitUniqSupply )
-#ifdef JAVA
-import JavaGen ( javaGen )
-import qualified PrintJava
-import OccurAnal ( occurAnalyseBinds )
-#endif
-
import Finder ( mkStubPaths )
import PprC ( writeCs )
import CmmLint ( cmmLint )
HscAsm -> outputAsm dflags filenm flat_abstractC;
HscC -> outputC dflags filenm flat_abstractC pkg_deps;
HscLlvm -> outputLlvm dflags filenm flat_abstractC;
- HscJava ->
-#ifdef JAVA
- outputJava dflags filenm mod_name tycons core_binds;
-#else
- panic "Java support not compiled into this ghc";
-#endif
HscNothing -> panic "codeOutput: HscNothing"
}
; return stubs_exist
\begin{code}
outputAsm :: DynFlags -> FilePath -> [RawCmm] -> IO ()
-
-#ifndef OMIT_NATIVE_CODEGEN
-
outputAsm dflags filenm flat_absC
+ | cGhcWithNativeCodeGen == "YES"
= do ncg_uniqs <- mkSplitUniqSupply 'n'
{-# SCC "OutputAsm" #-} doOutput filenm $
- \f -> {-# SCC "NativeCodeGen" #-}
- nativeCodeGen dflags f ncg_uniqs flat_absC
- where
-
-#else /* OMIT_NATIVE_CODEGEN */
+ \f -> {-# SCC "NativeCodeGen" #-}
+ nativeCodeGen dflags f ncg_uniqs flat_absC
-outputAsm _ _ _
- = pprPanic "This compiler was built without a native code generator"
- (text "Use -fvia-C instead")
-
-#endif
+ | otherwise
+ = panic "This compiler was built without a native code generator"
\end{code}
%************************************************************************
%* *
-\subsection{Java}
-%* *
-%************************************************************************
-
-\begin{code}
-#ifdef JAVA
-outputJava dflags filenm mod tycons core_binds
- = doOutput filenm (\ f -> printForUser f alwaysQualify pp_java)
- -- User style printing for now to keep indentation
- where
- occ_anal_binds = occurAnalyseBinds core_binds
- -- Make sure we have up to date dead-var information
- java_code = javaGen mod [{- Should be imports-}] tycons occ_anal_binds
- pp_java = PrintJava.compilationUnit java_code
-#endif
-\end{code}
-
-
-%************************************************************************
-%* *
\subsection{Foreign import/export}
%* *
%************************************************************************