Commit f7ecf723 authored by partain's avatar partain
Browse files

[project @ 1996-07-19 18:36:04 by partain]

partain 1.3 changes through 960719
parent 12899612
......@@ -402,9 +402,17 @@ ALLINTS=$(ALLSRCS_LHS:.lhs=.hi) $(ALLSRCS_HS:.hs=.hi)
#endif
#if GhcWithHscOptimised == YES
#define __version_sensitive_flags -O /*-DUSE_ATTACK_PRAGMAS -fshow-pragma-name-errs*/ -fomit-reexported-instances -fshow-import-specs
# if GhcBuilderVersion >= 200
# define __version_sensitive_flags -O -fshow-import-specs
# else
# define __version_sensitive_flags -O -fshow-import-specs -fomit-derived-read -fomit-reexported-instances
# endif
#else
#define __version_sensitive_flags -fomit-reexported-instances
# if GhcBuilderVersion >= 200
# define __version_sensitive_flags /*none*/
# else
# define __version_sensitive_flags -fomit-derived-read -fomit-reexported-instances
# endif
#endif
/* avoid use of AllProjectsHcOpts; then put in HcMaxHeapFlag "by hand" */
......@@ -412,8 +420,7 @@ ALLINTS=$(ALLSRCS_LHS:.lhs=.hi) $(ALLSRCS_HS:.hs=.hi)
#define AllProjectsHcOpts /**/
HC_OPTS = -cpp HcMaxHeapFlag -fhaskell-1.3 -fglasgow-exts -DCOMPILING_GHC \
-fomit-derived-read \
-I. -i$(SUBDIR_LIST) \
-Rghc-timing -I. -i$(SUBDIR_LIST) \
use_DDEBUG __version_sensitive_flags __omit_ncg_maybe __omit_deforester_flag
#undef __version_sensitive_flags
......@@ -502,7 +509,7 @@ HaskellCompileWithExtraFlags_Recursive(module,isuf,o,-c,extra_flags)
rename/ParseIface.hs : rename/ParseIface.y
$(RM) rename/ParseIface.hs rename/ParseIface.hinfo
happy -g -i rename/ParseIface.hinfo rename/ParseIface.y
happy -g rename/ParseIface.y
@chmod 444 rename/ParseIface.hs
compile(absCSyn/AbsCUtils,lhs,)
......@@ -706,7 +713,7 @@ compile(typecheck/TcType,lhs,)
compile(typecheck/TcEnv,lhs,)
compile(typecheck/TcMonoType,lhs,)
compile(typecheck/TcPat,lhs,)
compile(typecheck/TcPragmas,lhs,)
/*compile(typecheck/TcPragmas,lhs,)*/
compile(typecheck/TcSimplify,lhs,)
compile(typecheck/TcTyClsDecls,lhs,)
compile(typecheck/TcTyDecls,lhs,)
......@@ -745,12 +752,10 @@ objs:: $(ALLOBJS)
/* *** parser ************************************************* */
YACC_OPTS = -d
CC_OPTS = -Iparser -I. -I$(COMPINFO_DIR) -DUGEN_DEBUG=1 /*-DHSP_DEBUG=1*/ -g
CC_OPTS = -Iparser -I. -I$(COMPINFO_DIR) /*-DUGEN_DEBUG=1*/ /*-DHSP_DEBUG=1*/
/* add to these on the command line with, e.g., EXTRA_YACC_OPTS=-v */
XCOMM D_DEBUG = -DDEBUG
CPP_DEFINES = $(D_DEBUG)
HSP_SRCS_C = parser/constr.c \
......
......@@ -9,37 +9,3 @@ includes some tests that we use to make sure we're not going
backwards. The subdirs of the test directory "match" the subdirs of
the main source directory; e.g., the desugarer is in subdir deSugar/,
and the tests for the desugarer are in tests/deSugar/.
The main information about how the compiler goes together is in
./Jmakefile. The list of modules under "FRONTSRCS_LHS =",
"TCSRCS_LHS =", etc., should show the basic organization of the (many)
modules.
TO ADD A MODULE TO THE COMPILER:
0. Be familiar with "How to add an optimisation pass..." (in
ghc/docs/add_to_compiler).
1. Create an appropriately-named module in an appropriate subdirectory.
2. Edit the Jmakefile:
* If you created a new subdirectory for the module, add that
directory to the SUBDIR_LIST and DASH_I_SUBDIR_LIST lists.
* Add your module to one of the lists of modules in the compiler;
e.g., TCSRCS_LHS.
3. Re-make the Makefile: "make Makefile"
4. Re-make the automatically-generated dependencies: "make depend".
Your new module is now "wired in" and you may proceed normally...
% make
(see also: day-to-day make-worlding section of developer's guide, near
the end)
5. If you want to set up automagically (re-)runnable tests, follow
the suggests in the file tests/README.
......@@ -66,11 +66,11 @@ import Id ( externallyVisibleId, cmpId_withSpecDataCon,
import Maybes ( maybeToBool )
import PprStyle ( PprStyle(..) )
import PprType ( showTyCon, GenType{-instance Outputable-} )
import Pretty ( prettyToUn, ppPStr{-ToDo:rm-} )
import Pretty ( prettyToUn{-, ppPStr ToDo:rm-} )
import TyCon ( TyCon{-instance Eq-} )
import Unique ( showUnique, pprUnique, Unique{-instance Eq-} )
import Unpretty -- NOTE!! ********************
import Util ( assertPanic, pprTrace{-ToDo:rm-} )
import Util ( assertPanic{-, pprTraceToDo:rm-} )
\end{code}
things we want to find out:
......
......@@ -165,7 +165,6 @@ import PprType ( getTypeString, typeMaybeString, specMaybeTysSuffix,
)
import PprStyle
import Pretty
import SpecEnv ( SpecEnv(..) )
import MatchEnv ( MatchEnv )
import SrcLoc ( mkBuiltinSrcLoc )
import TyCon ( TyCon, mkTupleTyCon, tyConDataCons )
......@@ -1057,7 +1056,7 @@ mkWorkerId u unwrkr ty info
= Id u n ty (WorkerId unwrkr) NoPragmaInfo info
where
unwrkr_name = getName unwrkr
unwrkr_orig = trace "mkWorkerId:origName:" $ origName "mkWorkerId" unwrkr_name
unwrkr_orig = origName "mkWorkerId" unwrkr_name
umod = moduleOf unwrkr_orig
n = mkCompoundName u umod SLIT("wrk") [Left unwrkr_orig] unwrkr_name
......
......@@ -30,7 +30,6 @@ module IdInfo (
mkDemandInfo,
willBeDemanded,
MatchEnv, -- the SpecEnv (why is this exported???)
StrictnessInfo(..), -- non-abstract
Demand(..), -- non-abstract
......@@ -275,7 +274,7 @@ ppIdInfo sty for_this_id specs_please better_id_fn inline_env
else pp_unfolding sty for_this_id inline_env unfold,
if specs_please
then panic "ppSpecs (ToDo)" -- sty (not (isDataCon for_this_id))
then pp_NONE -- ToDo -- sty (not (isDataCon for_this_id))
-- better_id_fn inline_env (mEnvToList specenv)
else pp_NONE,
......
......@@ -4,6 +4,7 @@ __exports__
CoreSyn CoreExpr
CoreUnfold FormSummary (..)
CoreUnfold Unfolding (..)
CoreUnfold SimpleUnfolding (..)
CoreUnfold UnfoldingGuidance (..)
CoreUtils unTagBinders (..)
Id IdEnv
......@@ -19,6 +20,7 @@ MagicUFs MagicUnfoldingFun
MagicUFs mkMagicUnfoldingFun (..)
OccurAnal occurAnalyseGlobalExpr (..)
PprType pprParendGenType (..)
SpecEnv SpecEnv
SpecEnv isNullSpecEnv (..)
SpecEnv nullSpecEnv (..)
WwLib mAX_WORKER_ARGS (..)
......
......@@ -10,12 +10,12 @@ module IdUtils ( primOpNameInfo, primOpId ) where
IMP_Ubiq()
IMPORT_DELOOPER(PrelLoop) -- here for paranoia checking
IMPORT_DELOOPER(IdLoop) (SpecEnv)
import CoreSyn
import CoreUnfold ( UnfoldingGuidance(..), Unfolding )
import Id ( mkImported, mkTemplateLocals )
import IdInfo -- quite a few things
import SpecEnv ( SpecEnv )
import Name ( mkPrimitiveName, OrigName(..) )
import PrelMods ( gHC_BUILTINS )
import PrimOp ( primOpInfo, tagOf_PrimOp, primOp_str,
......
/* this is a standalone Jmakefile; NOT part of ghc "make world" */
LitStuffNeededHere(docs depend)
InfoStuffNeededHere(docs)
HaskellSuffixRules()
/* LIT2LATEX_OPTS=-tbird */
LIT2LATEX_OPTS=-ttgrind
LitDocRootTargetWithNamedOutput(basicTypes,lit,basicTypes-standalone)
......@@ -70,7 +70,7 @@ import SrcLoc ( mkBuiltinSrcLoc, mkUnknownSrcLoc, SrcLoc )
import Unique ( funTyConKey, mkTupleDataConUnique, mkTupleTyConUnique,
pprUnique, Unique
)
import Util ( thenCmp, _CMP_STRING_, nOfThem, panic, assertPanic, pprTrace{-ToDo:rm-} )
import Util ( thenCmp, _CMP_STRING_, nOfThem, panic, assertPanic{-, pprTrace ToDo:rm-} )
#ifdef REALLY_HASKELL_1_3
ord = fromEnum :: Char -> Int
......@@ -376,7 +376,7 @@ changeUnique (Global _ m n p e os) u = Global u m n p e os
nameOrigName msg (Global _ m (Left n) _ _ _) = OrigName m n
nameOrigName msg (Global _ m (Right n) _ _ _) = let str = _CONCAT_ (glue n) in
pprTrace ("nameOrigName:"++msg) (ppPStr str) $
--pprTrace ("nameOrigName:"++msg) (ppPStr str) $
OrigName m str
#ifdef DEBUG
nameOrigName msg (Local _ n _ _) = panic ("nameOrigName:Local:"++msg++":"++ _UNPK_ n)
......@@ -385,7 +385,7 @@ nameOrigName msg (Local _ n _ _) = panic ("nameOrigName:Local:"++msg++":"++
nameOccName (Local _ n _ _) = Unqual n
nameOccName (Global _ m (Left n) _ _ [] ) = Qual m n
nameOccName (Global _ m (Right n) _ _ [] ) = let str = _CONCAT_ (glue n) in
pprTrace "nameOccName:" (ppPStr str) $
--pprTrace "nameOccName:" (ppPStr str) $
Qual m str
nameOccName (Global _ m (Left _) _ _ (o:_)) = o
nameOccName (Global _ m (Right _) _ _ (o:_)) = panic "nameOccName:compound name"
......
\begin{onlystandalone}
\documentstyle[11pt,literate]{article}
\begin{document}
\title{Glasgow Haskell compiler: basicTypes}
\author{The GRASP team}
\date{August 1993}
\maketitle
\begin{rawlatex}
\tableofcontents
\pagebreak
\end{rawlatex}
\end{onlystandalone}
\begin{onlypartofdoc}
\section[basicTypes]{Basic types in GHC (alphabetically)}
\downsection
\end{onlypartofdoc}
\input{CLabelInfo.lhs}
\input{BasicLit.lhs}
\input{Id.lhs}
\input{IdInfo.lhs}
\input{Inst.lhs}
\input{NameTypes.lhs}
\input{ProtoName.lhs}
\input{SrcLoc.lhs}
\input{Unique.lhs}
\upsection
\begin{onlypartofdoc}
\upsection
\end{onlypartofdoc}
\begin{onlystandalone}
\printindex
\end{document}
\end{onlystandalone}
......@@ -91,7 +91,7 @@ import Maybes ( assocMaybe, maybeToBool )
import Name ( isLocallyDefined, nameOf, origName )
import PprStyle ( PprStyle(..) )
import PprType ( getTyDescription, GenType{-instance Outputable-} )
import Pretty--ToDo:rm
--import Pretty--ToDo:rm
import PrelInfo ( maybeCharLikeTyCon, maybeIntLikeTyCon )
import PrimRep ( getPrimRepSize, separateByPtrFollowness )
import SMRep -- all of it
......@@ -1161,8 +1161,8 @@ fun_result_ty arity id
(_, de_foralld_ty) = splitForAllTy (idType id)
(arg_tys, res_ty) = splitFunTyExpandingDictsAndPeeking de_foralld_ty
in
-- ASSERT(arity >= 0 && length arg_tys >= arity)
(if (arity >= 0 && length arg_tys >= arity) then (\x->x) else pprPanic "fun_result_ty:" (ppCat [ppInt arity, ppr PprShowAll id, ppr PprDebug (idType id)])) $
ASSERT(arity >= 0 && length arg_tys >= arity)
-- (if (arity >= 0 && length arg_tys >= arity) then (\x->x) else pprPanic "fun_result_ty:" (ppCat [ppInt arity, ppr PprShowAll id, ppr PprDebug (idType id)])) $
mkFunTys (drop arity arg_tys) res_ty
\end{code}
......@@ -1261,7 +1261,7 @@ fastLabelFromCI (MkClosureInfo id _ _) = mkFastEntryLabel id fun_arity
arity_maybe = arityMaybe (getIdArity id)
fun_arity = case arity_maybe of
Just x -> x
_ -> pprPanic "fastLabelFromCI:no arity:" (ppr PprShowAll id)
_ -> panic "fastLabelFromCI:no arity:" --(ppr PprShowAll id)
\end{code}
\begin{code}
......
/* this is a standalone Jmakefile; NOT part of ghc "make world" */
LitStuffNeededHere(docs depend)
InfoStuffNeededHere(docs)
HaskellSuffixRules()
LitSuffixRule(.lit,/*none*/) /* no language really */
LitSuffixRule(.lhs,.hs) /* Haskell */
LitSuffixRule(.lhc,.hc) /* Haskell assembler (C) */
LitSuffixRule(.lprl,.prl) /* Perl */
LitSuffixRule(.lsh,.sh) /* Bourne shell */
LitSuffixRule(.lc,.c) /* C */
LitSuffixRule(.lh,.h)
LitSuffixRule(.llex,.lex) /* Lex */
LitSuffixRule(.lflex,.flex) /* Flex */
LIT2LATEX_OPTS=-ttgrind
LitDocRootTargetWithNamedOutput(codegen,lit,codegen-standalone)
This diff is collapsed.
......@@ -43,11 +43,10 @@ import CoreUtils ( coreExprType )
import CostCentre ( ccMentionsId )
import Id ( idType, getIdArity, isBottomingId,
SYN_IE(IdSet), GenId{-instances-} )
import PrimOp ( fragilePrimOp, PrimOp(..) )
import PrimOp ( primOpCanTriggerGC, fragilePrimOp, PrimOp(..) )
import IdInfo ( arityMaybe, bottomIsGuaranteed )
import Literal ( isNoRepLit, isLitLitLit )
import Pretty
import PrimOp ( primOpCanTriggerGC, PrimOp(..) )
import TyCon ( tyConFamilySize )
import Type ( getAppDataTyConExpandingDicts )
import UniqSet ( emptyUniqSet, unitUniqSet, mkUniqSet,
......@@ -148,6 +147,7 @@ mkFormSummary expr
where
go n (Lit _) = ASSERT(n==0) ValueForm
go n (Con _ _) = ASSERT(n==0) ValueForm
go n (Prim _ _) = OtherForm
go n (SCC _ e) = go n e
go n (Coerce _ _ e) = go n e
go n (Let _ e) = OtherForm
......
......@@ -31,7 +31,6 @@ import Id ( idType, getIdInfo, getIdStrictness, isTupleCon,
nullIdEnv, SYN_IE(DataCon), GenId{-instances-}
)
import IdInfo ( ppIdInfo, StrictnessInfo(..) )
import IdLoop ( Unfolding ) -- Needed by IdInfo.hi?
import Literal ( Literal{-instances-} )
import Name ( isSymLexeme )
import Outputable -- quite a few things
......
\begin{onlystandalone}
\documentstyle[11pt,literate]{article}
\begin{document}
\title{CoreSyntax}
\author{}
\date{2 February 1994}
\maketitle
\tableofcontents
\end{onlystandalone}
\begin{onlypartofdoc}
\section{Core Syntax}
\downsection
\end{onlypartofdoc}
\input{CoreSyn.lhs}
\input{AnnCoreSyn.lhs}
\input{CoreFuns.lhs}
\input{CoreLint.lhs}
\section{Instances}
\downsection
\input{PlainCore.lhs}
\input{TaggedCore.lhs}
\input{TmplCore.lhs}
\upsection
\section{Utilities}
\downsection
\input{FreeVars.lhs}
\upsection
\begin{onlypartofdoc}
\upsection
\end{onlypartofdoc}
\begin{onlystandalone}
\printindex
\end{document}
\end{onlystandalone}
......@@ -41,11 +41,11 @@ import Type ( mkTyVarTys, mkForAllTys, splitSigmaTy,
tyVarsOfType, tyVarsOfTypes, isDictTy
)
import TyVar ( tyVarSetToList, GenTyVar{-instance Eq-} )
import Util ( isIn, panic, pprTrace{-ToDo:rm-} )
import PprCore--ToDo:rm
import PprType ( GenTyVar ) --ToDo:rm
import Usage--ToDo:rm
import Unique--ToDo:rm
import Util ( isIn, panic{-, pprTrace ToDo:rm-} )
--import PprCore--ToDo:rm
--import PprType ( GenTyVar ) --ToDo:rm
--import Usage--ToDo:rm
--import Unique--ToDo:rm
\end{code}
%************************************************************************
......
......@@ -77,7 +77,7 @@ around; if we get hits, we use the value accordingly.
\begin{code}
dsExpr :: TypecheckedHsExpr -> DsM CoreExpr
dsExpr (HsVar var) = dsApp (HsVar var) []
dsExpr e@(HsVar var) = dsApp e []
\end{code}
%************************************************************************
......@@ -584,20 +584,9 @@ dsApp (TyApp expr tys) args
-- we might should look out for SectionLs, etc., here, but we don't
dsApp (HsVar v) args = mkAppDs (Var v) args
{- No need to do unfolding in desugarer now
= lookupEnvDs v `thenDs` \ maybe_expr ->
case maybe_expr of
Just expr -> mkAppDs expr args
Nothing -> -- we're only saturating constructors and PrimOps
case getIdUnfolding v of
SimpleUnfolding _ the_unfolding EssentialUnfolding
-> do_unfold nullTyVarEnv nullIdEnv (unTagBinders the_unfolding) args
_ -> mkAppDs (Var v) args
-}
dsApp (HsVar v) args
= lookupEnvDs v `thenDs` \ maybe_expr ->
mkAppDs (case maybe_expr of { Nothing -> Var v; Just expr -> expr }) args
dsApp anything_else args
= dsExpr anything_else `thenDs` \ core_expr ->
......
......@@ -43,7 +43,7 @@ import PprStyle ( PprStyle(..) )
import PrelVals ( iRREFUT_PAT_ERROR_ID, voidId )
import Pretty ( ppShow )
import Id ( idType, dataConArgTys, mkTupleCon,
pprId{-ToDo:rm-},
-- pprId{-ToDo:rm-},
SYN_IE(DataCon), SYN_IE(DictVar), SYN_IE(Id), GenId )
import Literal ( Literal(..) )
import TyCon ( mkTupleTyCon, isNewTyCon, tyConDataCons )
......@@ -52,13 +52,13 @@ import Type ( mkTyVarTys, mkRhoTy, mkForAllTys, mkFunTy,
)
import TysPrim ( voidTy )
import UniqSet ( mkUniqSet, minusUniqSet, uniqSetToList, SYN_IE(UniqSet) )
import Util ( panic, assertPanic, pprTrace{-ToDo:rm-} )
import PprCore{-ToDo:rm-}
import Util ( panic, assertPanic{-, pprTrace ToDo:rm-} )
import Usage ( SYN_IE(UVar) )
--import PprCore{-ToDo:rm-}
--import PprType--ToDo:rm
import Pretty--ToDo:rm
import TyVar--ToDo:rm
import Unique--ToDo:rm
import Usage--ToDo:rm
--import Pretty--ToDo:rm
--import TyVar--ToDo:rm
--import Unique--ToDo:rm
\end{code}
%************************************************************************
......
/* this is a standalone Jmakefile; NOT part of ghc "make world" */
LitStuffNeededHere(docs depend)
InfoStuffNeededHere(docs)
HaskellSuffixRules()
/* LIT2LATEX_OPTS=-tbird */
LIT2LATEX_OPTS=-ttgrind
LitDocRootTargetWithNamedOutput(root,lit,root-standalone)
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