X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=ghc%2Fcompiler%2Ftypecheck%2FTcForeign.lhs;h=d18fe5f4839e2e90617d263d7d898dfb0115109d;hb=423d477bfecd490de1449c59325c8776f91d7aac;hp=d13b4bbf9bb0b729eb4cd4664a6cb7d0a199a009;hpb=553e90d9a32ee1b1809430f260c401cc4169c6c7;p=ghc-hetmet.git diff --git a/ghc/compiler/typecheck/TcForeign.lhs b/ghc/compiler/typecheck/TcForeign.lhs index d13b4bb..d18fe5f 100644 --- a/ghc/compiler/typecheck/TcForeign.lhs +++ b/ghc/compiler/typecheck/TcForeign.lhs @@ -17,7 +17,7 @@ module TcForeign , tcForeignExports ) where -#include "config.h" +#include "../includes/ghcconfig.h" #include "HsVersions.h" import HsSyn @@ -43,8 +43,9 @@ import TcType ( Type, tcSplitFunTys, tcSplitTyConApp_maybe, toDNType ) import ForeignCall ( CExportSpec(..), CCallTarget(..), + CLabelString, isCLabelString, isDynamicTarget, withDNTypes, DNKind(..), DNCallSpec(..) ) -import CStrings ( CLabelString, isCLabelString ) +import MachOp ( machRepByteWidth ) import PrelNames ( hasKey, ioTyConKey ) import CmdLineOpts ( dopt_HscLang, HscLang(..) ) import Outputable @@ -177,11 +178,11 @@ The check is needed for both via-C and native-code routes #include "nativeGen/NCG.h" #if alpha_TARGET_ARCH checkFEDArgs arg_tys - = check (integral_args <= 4) err + = check (integral_args <= 32) err where - integral_args = sum (map getPrimRepSize $ - filter (not . isFloatingRep) $ - map typePrimRep arg_tys) + 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") #else checkFEDArgs arg_tys = returnM ()