From 1fb91a520756382381833a4637b1dd9e8b24992b Mon Sep 17 00:00:00 2001 From: simonmar Date: Wed, 29 Jun 2005 08:47:21 +0000 Subject: [PATCH] [project @ 2005-06-29 08:47:21 by simonmar] Make it compile on Alpha. --- ghc/compiler/typecheck/TcForeign.lhs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/ghc/compiler/typecheck/TcForeign.lhs b/ghc/compiler/typecheck/TcForeign.lhs index 6b18d07..f8aef7f 100644 --- a/ghc/compiler/typecheck/TcForeign.lhs +++ b/ghc/compiler/typecheck/TcForeign.lhs @@ -29,8 +29,8 @@ import ForeignCall ( CCallConv(..) ) import ErrUtils ( Message ) import Id ( Id, mkLocalId, mkExportedLocalId ) #if alpha_TARGET_ARCH -import PrimRep ( getPrimRepSize, isFloatingRep ) import Type ( typePrimRep ) +import SMRep ( argMachRep, primRepToCgRep, primRepHint ) #endif import OccName ( mkForeignExportOcc ) import Name ( Name, NamedThing(..), mkExternalName ) @@ -52,7 +52,7 @@ import SrcLoc ( Located(..), srcSpanStart ) import Bag ( consBag ) #if alpha_TARGET_ARCH -import MachOp ( machRepByteWidth ) +import MachOp ( machRepByteWidth, MachHint(FloatHint) ) #endif \end{code} @@ -185,10 +185,10 @@ The check is needed for both via-C and native-code routes checkFEDArgs arg_tys = check (integral_args <= 32) err where - integral_args = sum [ machRepByteWidth rep - | (rep,hint) <- map typeMachRepRep arg_tys, - hint /= FloatHint ] - err = ptext SLIT("On Alpha, I can only handle 4 non-floating-point arguments to foreign export dynamic") + integral_args = sum [ (machRepByteWidth . argMachRep . primRepToCgRep) prim_rep + | prim_rep <- map typePrimRep arg_tys, + primRepHint prim_rep /= FloatHint ] + err = ptext SLIT("On Alpha, I can only handle 32 bytes of non-floating-point arguments to foreign export dynamic") #else checkFEDArgs arg_tys = returnM () #endif -- 1.7.10.4