X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=compiler%2FcoreSyn%2FMkExternalCore.lhs;h=82731597cddb4b8958ec660c4141498b61bbd142;hb=e3cb60d26917d7be1b34030b1e5a579fbef9d067;hp=d0d9dea468fb7b4ace533509c0b5d21ea63cf607;hpb=d95ce839533391e7118257537044f01cbb1d6694;p=ghc-hetmet.git diff --git a/compiler/coreSyn/MkExternalCore.lhs b/compiler/coreSyn/MkExternalCore.lhs index d0d9dea..8273159 100644 --- a/compiler/coreSyn/MkExternalCore.lhs +++ b/compiler/coreSyn/MkExternalCore.lhs @@ -65,16 +65,9 @@ mkExternalCore :: CgGuts -> C.Module -- implicit in the data type declaration itself mkExternalCore (CgGuts {cg_module=this_mod, cg_tycons = tycons, cg_binds = binds}) - -- Note that we flatten binds at the top level: - -- every module is just a single recursive bag of declarations. - -- Rationale: since modules can be mutually recursive, - -- there's not much reason to preserve dependency info within a module. - = C.Module mname tdefs (case flattenBinds binds of - -- check for empty list so we don't create an - -- empty Rec group - [] -> [] - bs -> [(runCoreM (make_vdef True - (Rec bs)) this_mod)]) +{- Note that modules can be mutually recursive, but even so, we + print out dependency information within each module. -} + = C.Module mname tdefs (runCoreM (mapM (make_vdef True) binds) this_mod) where mname = make_mid this_mod tdefs = foldr collect_tdefs [] tycons @@ -136,7 +129,7 @@ make_exp (Var v) = do let vName = Var.varName v isLocal <- isALocal vName return $ - case globalIdVarDetails v of + case idDetails v of FCallId (CCall (CCallSpec (StaticTarget nm) callconv _)) -> C.External (unpackFS nm) (showSDoc (ppr callconv)) (make_ty (varType v)) FCallId (CCall (CCallSpec DynamicTarget callconv _)) @@ -171,6 +164,7 @@ make_exp (Case e v ty alts) = do return $ C.Case scrut (make_vbind v) (make_ty ty) newAlts make_exp (Note (SCC _) e) = make_exp e >>= (return . C.Note "SCC") -- temporary make_exp (Note (CoreNote s) e) = make_exp e >>= (return . C.Note s) -- hdaume: core annotations +make_exp (Note InlineMe e) = make_exp e >>= (return . C.Note "InlineMe") make_exp _ = error "MkExternalCore died: make_exp" make_alt :: CoreAlt -> CoreM C.Alt