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)
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


No differences found