X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=compiler%2Fcmm%2FCLabel.hs;h=a78c22f8ec4d5b167fb433964ccf3aa71ca62aa7;hb=2bb3a439c106935d97fae7f7a0b60c21493d1bef;hp=f95a0fda04400489be297927000accbd1ed3d7b6;hpb=f7ecb11b40e5225ae6fa0284f1a7bbaa5b9edae8;p=ghc-hetmet.git diff --git a/compiler/cmm/CLabel.hs b/compiler/cmm/CLabel.hs index f95a0fd..a78c22f 100644 --- a/compiler/cmm/CLabel.hs +++ b/compiler/cmm/CLabel.hs @@ -90,6 +90,8 @@ module CLabel ( mkRtsApFastLabel, + mkPrimCallLabel, + mkForeignLabel, addLabelSize, foreignLabelStdcallInfo, @@ -133,6 +135,7 @@ import CostCentre import Outputable import FastString import DynFlags +import UniqSet -- ----------------------------------------------------------------------------- -- The CLabel type @@ -374,6 +377,11 @@ mkSelectorEntryLabel upd off = RtsLabel (RtsSelectorEntry upd off) mkApInfoTableLabel upd off = RtsLabel (RtsApInfoTable upd off) mkApEntryLabel upd off = RtsLabel (RtsApEntry upd off) + -- Primitive / cmm call labels + +mkPrimCallLabel :: PrimCall -> CLabel +mkPrimCallLabel (PrimCall str) = ForeignLabel str Nothing False IsFunction + -- Foreign labels mkForeignLabel :: FastString -> Maybe Int -> Bool -> FunctionOrData -> CLabel @@ -522,9 +530,10 @@ maybeAsmTemp _ = Nothing -- they are builtin to the C compiler. For these labels we avoid -- generating our own C prototypes. isMathFun :: CLabel -> Bool -isMathFun (ForeignLabel fs _ _ _) = fs `elem` math_funs - where - math_funs = [ +isMathFun (ForeignLabel fs _ _ _) = fs `elementOfUniqSet` math_funs +isMathFun _ = False + +math_funs = mkUniqSet [ -- _ISOC99_SOURCE (fsLit "acos"), (fsLit "acosf"), (fsLit "acosh"), (fsLit "acoshf"), (fsLit "acoshl"), (fsLit "acosl"), @@ -603,7 +612,6 @@ isMathFun (ForeignLabel fs _ _ _) = fs `elem` math_funs (fsLit "y1"), (fsLit "y1f"), (fsLit "y1l"), (fsLit "yn"), (fsLit "ynf"), (fsLit "ynl") ] -isMathFun _ = False -- ----------------------------------------------------------------------------- -- Is a CLabel visible outside this object file or not? @@ -889,7 +897,7 @@ pprCLbl (RtsLabel (RtsRetFS fs)) = ftext fs <> ptext (sLit "_ret") pprCLbl (RtsLabel (RtsPrimOp primop)) - = ppr primop <> ptext (sLit "_fast") + = ptext (sLit "stg_") <> ppr primop pprCLbl (RtsLabel (RtsSlowTickyCtr pat)) = ptext (sLit "SLOW_CALL_") <> text pat <> ptext (sLit "_ctr") @@ -961,6 +969,10 @@ asmTempLabelPrefix = pprDynamicLinkerAsmLabel :: DynamicLinkerLabelInfo -> CLabel -> SDoc #if x86_64_TARGET_ARCH && darwin_TARGET_OS +pprDynamicLinkerAsmLabel CodeStub lbl + = char 'L' <> pprCLabel lbl <> text "$stub" +pprDynamicLinkerAsmLabel SymbolPtr lbl + = char 'L' <> pprCLabel lbl <> text "$non_lazy_ptr" pprDynamicLinkerAsmLabel GotSymbolPtr lbl = pprCLabel lbl <> text "@GOTPCREL" pprDynamicLinkerAsmLabel GotSymbolOffset lbl