X-Git-Url: http://git.megacz.com/?p=ghc-hetmet.git;a=blobdiff_plain;f=compiler%2Fcmm%2FCLabel.hs;h=901b13b3422d151d165e2fe5eb97c366074da9a7;hp=c151a263915a46c8658cf57aaa690ad23c140eea;hb=40859045bf3e74efb5443b407bb01978e742e49d;hpb=2c2cb608fa5a088022e9e456b5cbc899063e4e1b diff --git a/compiler/cmm/CLabel.hs b/compiler/cmm/CLabel.hs index c151a26..901b13b 100644 --- a/compiler/cmm/CLabel.hs +++ b/compiler/cmm/CLabel.hs @@ -101,7 +101,7 @@ module CLabel ( hasCAF, infoLblToEntryLbl, entryLblToInfoLbl, cvtToClosureLbl, cvtToSRTLbl, needsCDecl, isAsmTemp, maybeAsmTemp, externallyVisibleCLabel, - isMathFun, + isMathFun, isCas, isCFunctionLabel, isGcPtrLabel, labelDynamic, pprCLabel @@ -590,9 +590,17 @@ maybeAsmTemp (AsmTempLabel uq) = Just uq 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 -- 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. isMathFun :: CLabel -> Bool isMathFun (ForeignLabel fs _ _ _) = fs `elementOfUniqSet` math_funs