Fixes to via-C prototype generation (FIX BUILD on Windows)
authorSimon Marlow <simonmar@microsoft.com>
Mon, 12 May 2008 11:06:43 +0000 (11:06 +0000)
committerSimon Marlow <simonmar@microsoft.com>
Mon, 12 May 2008 11:06:43 +0000 (11:06 +0000)
commitb779271a1f1420c0894e721a75afece2c5e75147
treeedd84f531aef304f116bad7cb240b321ff45d5a2
parent6f12fb754620f1f342bdbfd3b470584bf6d5daa3
Fixes to via-C prototype generation (FIX BUILD on Windows)

Previously we declared all external labels with type StgWord[],
because the same label might be used at different types in the same
file, e.g. if there are multiple foreign import declarations for the
same function.  However, we have to declare called functions with the
right type on Windows, because this is the only way to make the
compiler add the appropriate '@n' suffix for stdcall functions.

Related to this is the reason we were getting mangler complaints
(epilogue mangling) when compiling the RTS with -fvia-C.  The function
barf() doesn't return, but we had lost that information by declaring
our own prototypes, and so gcc was generating extra code after the
call to barf().

For more details see
http://hackage.haskell.org/trac/ghc/wiki/Commentary/Compiler/Backends/PprC
compiler/cmm/PprC.hs