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/main/MkIface.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/main/MkIface.lhs')
-rw-r--r-- | ghc/compiler/main/MkIface.lhs | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/ghc/compiler/main/MkIface.lhs b/ghc/compiler/main/MkIface.lhs index 49c1cb1404..992f0863c9 100644 --- a/ghc/compiler/main/MkIface.lhs +++ b/ghc/compiler/main/MkIface.lhs @@ -46,7 +46,8 @@ import NameEnv import NameSet import OccName ( pprOccName ) import TyCon ( TyCon, getSynTyConDefn, isSynTyCon, isNewTyCon, isAlgTyCon, tyConGenIds, - tyConTheta, tyConTyVars, tyConDataCons, tyConFamilySize, isClassTyCon + tyConTheta, tyConTyVars, tyConDataCons, tyConFamilySize, + isClassTyCon, isForeignTyCon ) import Class ( classExtraBigSig, classTyCon, DefMeth(..) ) import FieldLabel ( fieldLabelType ) @@ -187,6 +188,11 @@ ifaceTyCls (ATyCon tycon) so_far tcdSysNames = map getName (tyConGenIds tycon), tcdLoc = noSrcLoc } + | isForeignTyCon tycon + = ForeignType { tcdName = getName tycon, + tcdFoType = DNType, -- The only case at present + tcdLoc = noSrcLoc } + | otherwise = pprPanic "ifaceTyCls" (ppr tycon) tyvars = tyConTyVars tycon |