From f9853a3ec57cc8e788982b1e0d8acaa012bde735 Mon Sep 17 00:00:00 2001 From: simonpj Date: Thu, 20 Feb 2003 13:01:21 +0000 Subject: [PATCH] [project @ 2003-02-20 13:01:20 by simonpj] Eliminate brain-dead outputC pattern-match failure --- ghc/compiler/deSugar/DsForeign.lhs | 2 ++ ghc/compiler/main/CodeOutput.lhs | 6 +++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/ghc/compiler/deSugar/DsForeign.lhs b/ghc/compiler/deSugar/DsForeign.lhs index 4074d04..b2ad06b 100644 --- a/ghc/compiler/deSugar/DsForeign.lhs +++ b/ghc/compiler/deSugar/DsForeign.lhs @@ -66,6 +66,8 @@ type Binding = (Id, CoreExpr) -- No rec/nonrec structure; dsForeigns :: [TypecheckedForeignDecl] -> DsM (ForeignStubs, [Binding]) +dsForeigns [] + = returnDs (NoStubs, []) dsForeigns fos = foldlDs combine (ForeignStubs empty empty [] [], []) fos where diff --git a/ghc/compiler/main/CodeOutput.lhs b/ghc/compiler/main/CodeOutput.lhs index 1a08ded..fcad129 100644 --- a/ghc/compiler/main/CodeOutput.lhs +++ b/ghc/compiler/main/CodeOutput.lhs @@ -104,7 +104,7 @@ doOutput filenm io_action = bracket (openFile filenm WriteMode) hClose io_action \begin{code} outputC dflags filenm flat_absC - (stub_h_exists, _) dependencies (ForeignStubs _ _ ffi_decl_headers _ ) + (stub_h_exists, _) dependencies foreign_stubs = do dumpIfSet_dyn dflags Opt_D_dump_realC "Real C" (dumpRealC flat_absC) -- figure out which header files to #include in the generated .hc file: @@ -120,6 +120,10 @@ outputC dflags filenm flat_absC c_includes <- getPackageCIncludes pkg_configs let cmdline_includes = cmdlineHcIncludes dflags -- -#include options + ffi_decl_headers = case foreign_stubs of + NoStubs -> [] + ForeignStubs _ _ fdhs _ -> fdhs + all_headers = c_includes ++ reverse cmdline_includes ++ reverse (map unpackFS ffi_decl_headers) -- 1.7.10.4