Allow compilation of C/C++/ObjC/ObjC++ files with module from TH
authorFrancesco Mazzoli <f@mazzo.li>
Wed, 8 Mar 2017 04:39:51 +0000 (23:39 -0500)
committerBen Gamari <ben@smart-cactus.org>
Thu, 9 Mar 2017 00:15:54 +0000 (19:15 -0500)
commit0fac488cca04a07224926e35be9c45ee2d0e1631
tree48c5317fa66d9e09ff9bd829daf26539a971abc8
parentde62f587463f6377df1e69e11504578833dfe653
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
25 files changed:
compiler/deSugar/Desugar.hs
compiler/main/CodeOutput.hs
compiler/main/DriverPhases.hs
compiler/main/DriverPipeline.hs
compiler/main/HscMain.hs
compiler/main/HscTypes.hs
compiler/main/PipelineMonad.hs
compiler/main/TidyPgm.hs
compiler/typecheck/TcRnMonad.hs
compiler/typecheck/TcRnTypes.hs
compiler/typecheck/TcSplice.hs
libraries/ghc-boot-th/GHC/ForeignSrcLang/Type.hs [new file with mode: 0644]
libraries/ghc-boot-th/ghc-boot-th.cabal.in
libraries/ghc-boot/GHC/ForeignSrcLang.hs [new file with mode: 0644]
libraries/ghc-boot/ghc-boot.cabal.in
libraries/ghci/GHCi/Message.hs
libraries/ghci/GHCi/TH.hs
libraries/ghci/ghci.cabal.in
libraries/template-haskell/Language/Haskell/TH/Syntax.hs
testsuite/tests/th/T13366.hs [new file with mode: 0644]
testsuite/tests/th/T13366.stdout [new file with mode: 0644]
testsuite/tests/th/TH_addCStub1.hs [deleted file]
testsuite/tests/th/TH_addCStub1.stdout [deleted file]
testsuite/tests/th/TH_addCStub2.hs [deleted file]
testsuite/tests/th/all.T