Desugaring for "foreign import prim"
authorDuncan Coutts <duncan@well-typed.com>
Tue, 9 Jun 2009 10:59:45 +0000 (10:59 +0000)
committerDuncan Coutts <duncan@well-typed.com>
Tue, 9 Jun 2009 10:59:45 +0000 (10:59 +0000)
commit5b7e2a875b089f31cd8dedb52d47ef9a93f276be
tree35b3fd54bd396584f44074bde8f1b314fa67d465
parent2da37f4f15790377900fa6c38ff8fdcd394dfaa2
Desugaring for "foreign import prim"
Unlike normal foreign imports which desugar into a separate worker and
wrapper, we use just a single wrapper decleration. The representation
in Core of the call is currently as a foreign call. This means the
args are all treated as fully strict. This is ok at the moment because
we restrict the types for foreign import prim to be of unboxed types,
however in future we may want to make prim imports be the normal cmm
calling convention for Haskell functions, in which case we would not
be able to assume all args are strict. At that point it may make more
sense to represent cmm/prim calls distinct from foreign calls, and
more like the we the existing PrimOp calls are handled.
compiler/deSugar/DsForeign.lhs