diff options
| author | simonpj <unknown> | 2001-05-24 13:59:12 +0000 |
|---|---|---|
| committer | simonpj <unknown> | 2001-05-24 13:59:12 +0000 |
| commit | cbdeae8fc8a1c72d20d89241acae8a313214b51c (patch) | |
| tree | 2bde25b0907554080b9ee1e92446f575f87e04eb /ghc/compiler/nativeGen/StixPrim.lhs | |
| parent | f70aaa982380a9d210ca136983eb62e7b35062c7 (diff) | |
| download | haskell-cbdeae8fc8a1c72d20d89241acae8a313214b51c.tar.gz | |
[project @ 2001-05-24 13:59:09 by simonpj]
------------------------------------------------------
More stuff towards generalising 'foreign' declarations
------------------------------------------------------
This is the second step towards generalising 'foreign' declarations to
handle langauges other than C. Now I can handle
foreign import dotnet type T
foreign import dotnet "void Foo.Baz.f( T )" f :: T -> IO ()
** WARNING **
I believe that all the foreign stuff for C should
work exactly as before, but I have not tested it
thoroughly. Sven, Manuel, Marcin: please give it a
whirl and compare old with new output.
Lots of fiddling around with data types. The main changes are
* HsDecls.lhs
The ForeignDecl type and its friends
Note also the ForeignType constructor to TyClDecl
* ForeignCall.lhs
Here's where the stuff that survives right through
compilation lives
* TcForeign.lhs DsForeign.lhs
Substantial changes driven by the new data types
* Parser.y ParseIface.y RnSource
Just what you'd expect
Diffstat (limited to 'ghc/compiler/nativeGen/StixPrim.lhs')
| -rw-r--r-- | ghc/compiler/nativeGen/StixPrim.lhs | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/ghc/compiler/nativeGen/StixPrim.lhs b/ghc/compiler/nativeGen/StixPrim.lhs index 2ccd9ec6cb..a035b831ce 100644 --- a/ghc/compiler/nativeGen/StixPrim.lhs +++ b/ghc/compiler/nativeGen/StixPrim.lhs @@ -70,7 +70,6 @@ calling. \begin{code} foreignCallCode lhs (CCall (CCallSpec (StaticTarget fn) cconv safety is_asm)) rhs - | is_asm = error "ERROR: Native code generator can't handle casm" | not (playSafe safety) = returnUs (\xs -> ccall : xs) | otherwise @@ -101,14 +100,13 @@ foreignCallCode lhs (CCall (CCallSpec (StaticTarget fn) cconv safety is_asm)) rh ccall = case lhs of [] -> StCall fn cconv VoidRep args - [lhs] -> - let lhs' = amodeToStix lhs - pk = case getAmodeRep lhs of + [lhs] -> StAssign pk lhs' (StCall fn cconv pk args) + where + lhs' = amodeToStix lhs + pk = case getAmodeRep lhs of FloatRep -> FloatRep DoubleRep -> DoubleRep other -> IntRep - in - StAssign pk lhs' (StCall fn cconv pk args) foreignCallCode lhs call rhs = pprPanic "Native code generator can't handle foreign call" (ppr call) |
