X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=compiler%2FcodeGen%2FCgTailCall.lhs;h=c65ec1c4b5d65a7f404369df262dd21552d79927;hb=a2d78ebe0451484e20ad3dc4d7f662e8c1e9650e;hp=dd7327b745f1d6ad41fb89414b049da1cb25c301;hpb=0065d5ab628975892cea1ec7303f968c3338cbe1;p=ghc-hetmet.git diff --git a/compiler/codeGen/CgTailCall.lhs b/compiler/codeGen/CgTailCall.lhs index dd7327b..c65ec1c 100644 --- a/compiler/codeGen/CgTailCall.lhs +++ b/compiler/codeGen/CgTailCall.lhs @@ -1,13 +1,8 @@ % +% (c) The University of Glasgow 2006 % (c) The GRASP/AQUA Project, Glasgow University, 1992-1998 % -% $Id: CgTailCall.lhs,v 1.43 2005/06/21 10:44:41 simonmar Exp $ -% -%******************************************************** -%* * -\section[CgTailCall]{Tail calls: converting @StgApps@} -%* * -%******************************************************** +% Code generation for tail calls. \begin{code} module CgTailCall ( @@ -24,31 +19,27 @@ module CgTailCall ( #include "HsVersions.h" import CgMonad -import CgBindery ( getArgAmodes, getCgIdInfo, CgIdInfo, maybeLetNoEscape, - idInfoToAmode, cgIdInfoId, cgIdInfoLF, - cgIdInfoArgRep ) -import CgInfoTbls ( entryCode, emitDirectReturnInstr, dataConTagZ, - emitVectoredReturnInstr, closureInfoPtr ) +import CgBindery +import CgInfoTbls import CgCallConv -import CgStackery ( setRealSp, mkStkAmodes, adjustStackHW, - getSpRelOffset ) -import CgHeapery ( setRealHp, getHpRelOffset ) -import CgUtils ( emitSimultaneously ) +import CgStackery +import CgHeapery +import CgUtils import CgTicky import ClosureInfo -import SMRep ( CgRep, isVoidArg, separateByPtrFollowness ) +import SMRep import Cmm import CmmUtils -import CLabel ( CLabel, mkRtsPrimOpLabel, mkSeqInfoLabel ) -import Type ( isUnLiftedType ) -import Id ( Id, idName, idUnique, idType ) -import DataCon ( DataCon, dataConTyCon ) -import StgSyn ( StgArg ) -import TyCon ( TyCon ) -import PrimOp ( PrimOp ) +import CLabel +import Type +import Id +import DataCon +import StgSyn +import TyCon +import PrimOp import Outputable -import Monad ( when ) +import Control.Monad ----------------------------------------------------------------------------- -- Tail Calls @@ -118,9 +109,9 @@ performTailCall fun_info arg_amodes pending_assts opt_node_asst | nodeMustPointToIt lf_info = node_asst | otherwise = noStmts ; EndOfBlockInfo sp _ <- getEndOfBlockInfo - ; hmods <- getHomeModules + ; this_pkg <- getThisPackage - ; case (getCallMethod hmods fun_name lf_info (length arg_amodes)) of + ; case (getCallMethod this_pkg fun_name lf_info (length arg_amodes)) of -- Node must always point to things we enter EnterIt -> do