Commit 40859045 authored by Ian Lynagh's avatar Ian Lynagh
Browse files

Don't generate a prototype for cas

I'm not sure if this is the best way to fix this, but it fixes the
unreg build.
parent 2c2cb608
...@@ -101,7 +101,7 @@ module CLabel ( ...@@ -101,7 +101,7 @@ module CLabel (
hasCAF, hasCAF,
infoLblToEntryLbl, entryLblToInfoLbl, cvtToClosureLbl, cvtToSRTLbl, infoLblToEntryLbl, entryLblToInfoLbl, cvtToClosureLbl, cvtToSRTLbl,
needsCDecl, isAsmTemp, maybeAsmTemp, externallyVisibleCLabel, needsCDecl, isAsmTemp, maybeAsmTemp, externallyVisibleCLabel,
isMathFun, isMathFun, isCas,
isCFunctionLabel, isGcPtrLabel, labelDynamic, isCFunctionLabel, isGcPtrLabel, labelDynamic,
pprCLabel pprCLabel
...@@ -590,9 +590,17 @@ maybeAsmTemp (AsmTempLabel uq) = Just uq ...@@ -590,9 +590,17 @@ maybeAsmTemp (AsmTempLabel uq) = Just uq
maybeAsmTemp _ = Nothing maybeAsmTemp _ = Nothing
-- | Check whether a label corresponds to our cas function.
-- We #include the prototype for this, so we need to avoid
-- generating out own C prototypes.
isCas :: CLabel -> Bool
isCas (CmmLabel pkgId fn _) = pkgId == rtsPackageId && fn == fsLit "cas"
isCas _ = False
-- | Check whether a label corresponds to a C function that has -- | Check whether a label corresponds to a C function that has
-- a prototype in a system header somehere, or is built-in -- a prototype in a system header somehere, or is built-in
-- to the C compiler. For these labels we abovoid generating our -- to the C compiler. For these labels we avoid generating our
-- own C prototypes. -- own C prototypes.
isMathFun :: CLabel -> Bool isMathFun :: CLabel -> Bool
isMathFun (ForeignLabel fs _ _ _) = fs `elementOfUniqSet` math_funs isMathFun (ForeignLabel fs _ _ _) = fs `elementOfUniqSet` math_funs
......
...@@ -248,7 +248,7 @@ pprStmt stmt = case stmt of ...@@ -248,7 +248,7 @@ pprStmt stmt = case stmt of
| CmmNeverReturns <- ret -> | CmmNeverReturns <- ret ->
let myCall = pprCall (pprCLabel lbl) cconv results args safety let myCall = pprCall (pprCLabel lbl) cconv results args safety
in (real_fun_proto lbl, myCall) in (real_fun_proto lbl, myCall)
| not (isMathFun lbl) -> | not (isMathFun lbl || isCas lbl) ->
let myCall = braces ( let myCall = braces (
pprCFunType (char '*' <> text "ghcFunPtr") cconv results args <> semi pprCFunType (char '*' <> text "ghcFunPtr") cconv results args <> semi
$$ text "ghcFunPtr" <+> equals <+> cast_fn <> semi $$ text "ghcFunPtr" <+> equals <+> cast_fn <> semi
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment