summaryrefslogtreecommitdiff
path: root/compiler/main/TidyPgm.hs
diff options
context:
space:
mode:
authorFrancesco Mazzoli <f@mazzo.li>2017-03-07 23:39:51 -0500
committerBen Gamari <ben@smart-cactus.org>2017-03-08 19:15:54 -0500
commit0fac488cca04a07224926e35be9c45ee2d0e1631 (patch)
tree48c5317fa66d9e09ff9bd829daf26539a971abc8 /compiler/main/TidyPgm.hs
parentde62f587463f6377df1e69e11504578833dfe653 (diff)
downloadhaskell-0fac488cca04a07224926e35be9c45ee2d0e1631.tar.gz
Allow compilation of C/C++/ObjC/ObjC++ files with module from TH
The main goal is to easily allow the inline-c project (and similar projects such as inline-java) to emit C/C++ files to be compiled and linked with the current module. Moreover, `addCStub` is removed, since it's quite fragile. Most notably, the C stubs end up in the file generated by `CodeOutput.outputForeignStubs`, which is tuned towards generating a file for stubs coming from `capi` and Haskell-to-C exports. Reviewers: simonmar, austin, goldfire, facundominguez, dfeuer, bgamari Reviewed By: dfeuer, bgamari Subscribers: snowleopard, rwbarton, dfeuer, thomie, duncan, mboes Differential Revision: https://phabricator.haskell.org/D3280
Diffstat (limited to 'compiler/main/TidyPgm.hs')
-rw-r--r--compiler/main/TidyPgm.hs2
1 files changed, 2 insertions, 0 deletions
diff --git a/compiler/main/TidyPgm.hs b/compiler/main/TidyPgm.hs
index 2e603a64e4..26cee48f18 100644
--- a/compiler/main/TidyPgm.hs
+++ b/compiler/main/TidyPgm.hs
@@ -322,6 +322,7 @@ tidyProgram hsc_env (ModGuts { mg_module = mod
, mg_complete_sigs = complete_sigs
, mg_deps = deps
, mg_foreign = foreign_stubs
+ , mg_foreign_files = foreign_files
, mg_hpc_info = hpc_info
, mg_modBreaks = modBreaks
})
@@ -427,6 +428,7 @@ tidyProgram hsc_env (ModGuts { mg_module = mod
cg_tycons = alg_tycons,
cg_binds = all_tidy_binds,
cg_foreign = add_spt_init_code foreign_stubs,
+ cg_foreign_files = foreign_files,
cg_dep_pkgs = map fst $ dep_pkgs deps,
cg_hpc_info = hpc_info,
cg_modBreaks = modBreaks,