[GHC] #13237: Extend TH with addModCStub
GHC
ghc-devs at haskell.org
Fri Feb 10 17:39:03 UTC 2017
#13237: Extend TH with addModCStub
-------------------------------------+-------------------------------------
Reporter: | Owner:
facundo.dominguez | facundo.dominguez
Type: feature request | Status: patch
Priority: normal | Milestone: 8.2.1
Component: Template Haskell | Version: 8.0.1
Resolution: | Keywords: inline-c
Operating System: Unknown/Multiple | Architecture:
| Unknown/Multiple
Type of failure: None/Unknown | Test Case:
Blocked By: | Blocking:
Related Tickets: | Differential Rev(s): Phab:D3106
Wiki Page: |
-------------------------------------+-------------------------------------
Comment (by nh2):
I had an idea in mind on how we might do better for `addModCStub` than we
can for `runIO`, but it depends on what GHC actually does with the C
sources eventually (I don't know what it does):
If GHC invokes a plain `gcc` or `cc` or `CC` or whatever, then all bets
are off and we can't do better.
But if it can separate the C preprocessor invocation and the C compiler
invocation, then we could fully preprocess the C code (which expands all
includes) and hash that into the interface file, allowing us to notice
when included header files change.
This is better than having to write that logic ourselves in TH based on
`addDependentFile`, because one cannot in TH query what C preprocessor and
flags GHC will invoke.
--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/13237#comment:14>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
More information about the ghc-tickets
mailing list