summaryrefslogtreecommitdiff
path: root/compiler/GHC/Driver/CodeOutput.hs
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/GHC/Driver/CodeOutput.hs')
-rw-r--r--compiler/GHC/Driver/CodeOutput.hs10
1 files changed, 4 insertions, 6 deletions
diff --git a/compiler/GHC/Driver/CodeOutput.hs b/compiler/GHC/Driver/CodeOutput.hs
index 5b3f614d8e..df8637b8a7 100644
--- a/compiler/GHC/Driver/CodeOutput.hs
+++ b/compiler/GHC/Driver/CodeOutput.hs
@@ -253,19 +253,17 @@ outputForeignStubs logger tmpfs dflags unit_state mod location stubs
ForeignStubs (CHeader h_code) (CStub c_code _ _) -> do
let
- stub_c_output_d = pprCode CStyle c_code
- stub_c_output_w = showSDoc dflags stub_c_output_d
+ stub_c_output_w = showSDoc dflags $ pprCode CStyle c_code
-- Header file protos for "foreign export"ed functions.
- stub_h_output_d = pprCode CStyle h_code
- stub_h_output_w = showSDoc dflags stub_h_output_d
+ stub_h_output_w = showSDoc dflags $ pprCode CStyle h_code
createDirectoryIfMissing True (takeDirectory stub_h)
putDumpFileMaybe logger Opt_D_dump_foreign
"Foreign export header file"
FormatC
- stub_h_output_d
+ h_code
-- we need the #includes from the rts package for the stub files
let rts_includes =
@@ -288,7 +286,7 @@ outputForeignStubs logger tmpfs dflags unit_state mod location stubs
("#include <HsFFI.h>\n" ++ cplusplus_hdr) cplusplus_ftr
putDumpFileMaybe logger Opt_D_dump_foreign
- "Foreign export stubs" FormatC stub_c_output_d
+ "Foreign export stubs" FormatC c_code
stub_c_file_exists
<- outputForeignStubs_help stub_c stub_c_output_w