summaryrefslogtreecommitdiff
path: root/compiler/main/DriverPhases.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/DriverPhases.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/DriverPhases.hs')
-rw-r--r--compiler/main/DriverPhases.hs12
1 files changed, 6 insertions, 6 deletions
diff --git a/compiler/main/DriverPhases.hs b/compiler/main/DriverPhases.hs
index 57b2417100..a59c452788 100644
--- a/compiler/main/DriverPhases.hs
+++ b/compiler/main/DriverPhases.hs
@@ -140,7 +140,7 @@ data Phase
| LlvmMangle -- Fix up TNTC by processing assembly produced by LLVM
| CmmCpp -- pre-process Cmm source
| Cmm -- parse & compile Cmm code
- | MergeStub -- merge in the stub object file
+ | MergeForeign -- merge in the foreign object files
-- The final phase is a pseudo-phase that tells the pipeline to stop.
-- There is no runPhase case for it.
@@ -175,7 +175,7 @@ eqPhase LlvmLlc LlvmLlc = True
eqPhase LlvmMangle LlvmMangle = True
eqPhase CmmCpp CmmCpp = True
eqPhase Cmm Cmm = True
-eqPhase MergeStub MergeStub = True
+eqPhase MergeForeign MergeForeign = True
eqPhase StopLn StopLn = True
eqPhase Ccxx Ccxx = True
eqPhase Cobjcxx Cobjcxx = True
@@ -216,8 +216,8 @@ nextPhase dflags p
LlvmOpt -> LlvmLlc
LlvmLlc -> LlvmMangle
LlvmMangle -> As False
- SplitAs -> MergeStub
- As _ -> MergeStub
+ SplitAs -> MergeForeign
+ As _ -> MergeForeign
Ccxx -> As False
Cc -> As False
Cobjc -> As False
@@ -225,7 +225,7 @@ nextPhase dflags p
CmmCpp -> Cmm
Cmm -> maybeHCc
HCc -> As False
- MergeStub -> StopLn
+ MergeForeign -> StopLn
StopLn -> panic "nextPhase: nothing after StopLn"
where maybeHCc = if platformUnregisterised (targetPlatform dflags)
then HCc
@@ -289,7 +289,7 @@ phaseInputExt LlvmMangle = "lm_s"
phaseInputExt SplitAs = "split_s"
phaseInputExt CmmCpp = "cmm"
phaseInputExt Cmm = "cmmcpp"
-phaseInputExt MergeStub = "o"
+phaseInputExt MergeForeign = "o"
phaseInputExt StopLn = "o"
haskellish_src_suffixes, backpackish_suffixes, haskellish_suffixes, cish_suffixes,