summaryrefslogtreecommitdiff
path: root/ghc/compiler/codeGen
Commit message (Collapse)AuthorAgeFilesLines
...
* [project @ 2001-10-15 16:03:04 by simonpj]simonpj2001-10-152-25/+30
| | | | | | | | | | | | | | | | -------------------------- Tidy up arity propagation (the saga continues) -------------------------- Turns out that it's not as easy as I thought. The code generator was assuming that (not . isLocalName) was enough to identify an imported thing (whose CgInfo should be right), but that's not true. Needs more thought. Meanwhile, I've made the code generator a bit more sensible about how it looks things up. But there's still a problem for GHCi: the unfoldings in the TypeEnv won't have CgIdInfo stuff. Sigh. Thinks.
* [project @ 2001-10-11 14:31:45 by sewardj]sewardj2001-10-111-11/+16
| | | | | | | | Correctly handle unboxed tuples when converting DEFAULT alts to unboxed tuple constructors in case args. (I'm sure this could be worded better). Branch and HEAD have drifted too far apart for easy common commit for this, so is committed seperately for ghc-5-02-branch.
* [project @ 2001-10-03 13:59:22 by simonpj]simonpj2001-10-031-4/+1
| | | | wibbles only
* [project @ 2001-10-03 13:58:13 by simonpj]simonpj2001-10-032-21/+55
| | | | | | | | | | | | | | | | | | | | | | | | | | ---------------------------------------------- Output curried functions for data constructors ---------------------------------------------- (incomplete) The idea here is to output code for the *curried* version of the worker of a data constructor, so that the worker can be treated as a first-class citizen elsewhere in the compiler. In particular, it doesn't need to be a "hasNoBinding" thing, which are the subject of a number of nasty hacks. These changes only do the business for the code gen route via AbstractC. Remaining to do: the byte code generator. Idea: move the byte-code gen to STG code, and inject the curried data-constructor workers at the STG stage. I hope the changes here won't make anything stop working. For now, constructor workers remain "hasNoBinding" things. CgConTbls, CodeGen, CoreTidy, CoreToStg
* [project @ 2001-10-03 13:57:42 by simonmar]simonmar2001-10-031-5/+6
| | | | | | | | | | | | | | | | Tidy up ghc/includes/Constants and related things. Now all the constants that the compiler needs to know, such as header size, update frame size, info table size and so on are generated automatically into a header file, DeriviedConstants.h, by a small C program in the same way as NativeDefs.h. The C code in the RTS is expected to use sizeof() directly (it already does). Also tidied up the constants in MachDeps.h - all the constants representing the sizes of various types are named SIZEOF_<foo>, to match the constants defined in config.h. PrelStorable.lhs now doesn't contain any special knowledge about GHC's conventions as regards the size of certain types, this is all in MachDeps.h.
* [project @ 2001-09-26 15:11:50 by simonpj]simonpj2001-09-269-242/+220
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ------------------------------- Code generation and SRT hygiene ------------------------------- This is a big tidy up commit. I don't think it breaks anything, but it certainly makes the code clearer (to me). I'm not certain that you can use it without sucking in my other big commit... they come from the same tree. Core-to-STG, live variables and Static Reference Tables (SRTs) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ I did a big tidy-up of the live-variable computation in CoreToStg. The key idea is that the live variables consist of two parts: dynamic live vars static live vars (CAFs) These two always travel round together, but they were always treated separately by the code until now. Now it's a new data type: type LiveInfo = (StgLiveVars, -- Dynamic live variables; -- i.e. ones with a nested (non-top-level) binding CafSet) -- Static live variables; -- i.e. top-level variables that are CAFs or refer to them There's lots of documentation in CoreToStg. Code generation ~~~~~~~~~~~~~~~ Arising from this, I found that SRT labels were stored in a LambdaFormInfo during code generation, whereas they *ought* to be in the ClosureInfo (which in turn contains a LambdaFormInfo). This led to lots of changes in ClosureInfo, and I took the opportunity to make it into a labelled record. Similarly, I made the data type in AbstractC a bit more explicit: -- C_SRT is what StgSyn.SRT gets translated to... -- we add a label for the table, and expect only the 'offset/length' form data C_SRT = NoC_SRT | C_SRT CLabel !Int{-offset-} !Int{-length-} (Previously there were bottoms lying around.)
* [project @ 2001-09-22 10:53:03 by ken]ken2001-09-221-2/+0
| | | | wibble
* [project @ 2001-09-20 12:14:31 by simonpj]simonpj2001-09-201-2/+0
| | | | | | | | | | | | | | | | | | | ------------------------------------------------ Make code generation ignore isLocalId/isGlobalId ------------------------------------------------ MERGE WITH STABLE BRANCH CorePrep may introduce some new, top-level LocalIds. This breaks an invariant that the core2stg/code generator passes occasionally used, namely that LocalIds are not top-level bound. This commit fixes that problem. It also removes an assert from CodeGen.cgTopRhs that asks for the CgInfo of such new LocalIds -- but they may (legitimately) not have any, so it was a bad ASSERT. [Showed up in George Russel's system.]
* [project @ 2001-09-12 15:52:40 by sewardj]sewardj2001-09-122-6/+10
| | | | | | | | | | | | | | | | | | | | merge (ghc-5-02-branch --> HEAD): Bugfix: there was an implicit assumption that the list of slots passed to freeStackSlots was already sorted, whereas in fact this wasn't the case for at least one call. Now we explicitly sort the list in freeStackSlots, removing the hidden assumption. The symptoms of this bug include crashes (perhaps the "AsmCodeGen" crash), and a tendency to grow the stack a lot when let-no-escapes are involved (because the bug caused fragmentation of the stack free list, so we weren't re-using free slots properly). 1.17.2.1 +3 -2 fptools/ghc/compiler/codeGen/CgStackery.lhs ASSERT that the list of stack slots we calculate in buildLivenessMask is sorted, because we rely on that property later. 1.38.2.1 +5 -6 fptools/ghc/compiler/codeGen/CgBindery.lhs
* [project @ 2001-09-10 10:07:21 by rje]rje2001-09-101-20/+21
| | | | | | | | | | | | | | Fixed a bug in TICKY_TICKY profiling. Previously, the TICK_ENT_DIRECT event was logged before the heap/stack check was done. As a result, if the check failed, the TICK_ENT_DIRECT event would be logged a second time, causing TICKY_TICKY to give innacurate numbers. This patch shouldn't have any affect on non-ticky compilation. Also changed the modified bit of code to use "do" notation, and so look a bit neater.
* [project @ 2001-08-31 12:39:06 by rje]rje2001-08-314-365/+412
| | | | | | | Reapplied my "FCode as a monad" patch, now that 5.02 has forked into a separate branch. I'm fairly sure that this doesn't change the behaviour of anything.
* [project @ 2001-08-30 09:51:15 by sewardj]sewardj2001-08-304-412/+365
| | | | | | | | | | Back out recent changes to the code generator as too destabilising. Revert files as follows: revert to 1.35 CgBindery.lhs revert to 1.26 CgMonad.lhs revert to 1.15 CgStackery.lhs revert to 1.10 CgUsages.lhs
* [project @ 2001-08-29 19:29:04 by sof]sof2001-08-291-2/+2
| | | | make it compile.
* [project @ 2001-08-29 14:20:14 by rje]rje2001-08-294-365/+412
| | | | | | | | | | | | | | FCode/Code is now a monad, and thus now also a constructed type, rather than a type synonym. This requires quite a lot of changes in quite a lot of files, but none of these changes should have changed the behaviour of anything. Being a Monad allows code that used FCode to be IMHO rather more readable as it can use do notation, and other common Monad idioms. In addition, state has been abstracted away with getter and setter functions, so that functions mess with the innards of FCode as little as possible - making it easier to change FCode in future.
* [project @ 2001-08-21 10:00:22 by simonpj]simonpj2001-08-211-2/+2
| | | | wibbles
* [project @ 2001-08-17 17:18:51 by apt]apt2001-08-171-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | How I spent my summer vacation. Primops ------- The format of the primops.txt.pp file has been enhanced to allow (latex-style) primop descriptions to be included. There is a new flag to genprimopcode that generates documentation including these descriptions. A first cut at descriptions of the more interesting primops has been made, and the file has been reordered a bit. 31-bit words ------------ The front end now can cope with the possibility of 31-bit (or even 30-bit) Int# and Word# types. The only current use of this is to generate external .core files that can be translated into OCAML source files (OCAML uses a one-bit tag to distinguish integers from pointers). The only way to get this right now is by hand-defining the preprocessor symbol WORD_SIZE_IN_BITS, which is normally set automatically from the familiar WORD_SIZE_IN_BYTES. Just in case 31-bit words are used, we now have Int32# and Word32# primitive types and an associated family of operators, paralleling the existing 64-bit stuff. Of course, none of the operators actually need to be implemented in the absence of a 31-bit backend. There has also been some minor re-jigging of the 32 vs. 64 bit stuff. See the description at the top of primops.txt.pp file for more details. Note that, for the first time, the *type* of a primop can now depend on the target word size. Also, the family of primops intToInt8#, intToInt16#, etc. have been renamed narrow8Int#, narrow16Int#, etc., to emphasize that they work on Int#'s and don't actually convert between types. Addresses --------- As another part of coping with the possibility of 31-bit ints, the addr2Int# and int2Addr# primops are now thoroughly deprecated (and not even defined in the 31-bit case) and all uses of them have been removed except from the (deprecated) module hslibs/lang/Addr Addr# should now be treated as a proper abstract type, and has these suitable operators: nullAddr# : Int# -> Addr# (ignores its argument; nullary primops cause problems at various places) plusAddr# : Addr# -> Int# -> Addr# minusAddr : Addr# -> Addr# -> Int# remAddr# : Addr# -> Int# -> Int# Obviously, these don't allow completely arbitrary offsets if 31-bit ints are in use, but they should do for all practical purposes. It is also still possible to generate an address constant, and there is a built-in rule that makes use of this to remove the nullAddr# calls. Misc ---- There is a new compile flag -fno-code that causes GHC to quit after generating .hi files and .core files (if requested) but before generating STG. Z-encoded names for tuples have been rationalized; e.g., Z3H now means an unboxed 3-tuple, rather than an unboxed tuple with 3 commas (i.e., a 4-tuple)! Removed misc. litlits in hslibs/lang Misc. small changes to external core format. The external core description has also been substantially updated, and incorporates the automatically-generated primop documentation; its in the repository at /papers/ext-core/core.tex. A little make-system addition to allow passing CPP options to compiler and library builds.
* [project @ 2001-07-24 05:04:58 by ken]ken2001-07-241-7/+3
| | | | | | | | Removed 32-bit dependencies in the generation and handling of liveness mask bitmaps. We now support both 32-bit and 64-bit machines with identical .hc files. Support for >64-bit machines would be easy to add. Note that old .hc files are incompatible with the changes made to ghc/include/InfoMacros.h!
* [project @ 2001-06-25 14:36:04 by simonpj]simonpj2001-06-253-5/+2
| | | | Import wibbles
* [project @ 2001-05-22 13:43:14 by simonpj]simonpj2001-05-223-38/+34
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ------------------------------------------- Towards generalising 'foreign' declarations ------------------------------------------- This is a first step towards generalising 'foreign' declarations to handle langauges other than C. Quite a lot of files are touched, but nothing has really changed. Everything should work exactly as before. But please be on your guard for ccall-related bugs. Main things Basic data types: ForeignCall.lhs ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * Remove absCSyn/CallConv.lhs * Add prelude/ForeignCall.lhs. This defines the ForeignCall type and its variants * Define ForeignCall.Safety to say whether a call is unsafe or not (was just a boolean). Lots of consequential chuffing. * Remove all CCall stuff from PrimOp, and put it in ForeignCall Take CCallOp out of the PrimOp type (where it was always a glitch) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * Add IdInfo.FCallId variant to the type IdInfo.GlobalIdDetails, along with predicates Id.isFCallId, Id.isFCallId_maybe * Add StgSyn.StgOp, to sum PrimOp with FCallOp, because it *is* useful to sum them together in Stg and AbsC land. If nothing else, it minimises changes. Also generally rename "CCall" stuff to "FCall" where it's generic to all foreign calls.
* [project @ 2001-03-22 03:51:08 by hwloidl]hwloidl2001-03-221-7/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | -*- outline -*- Time-stamp: <Thu Mar 22 2001 03:50:16 Stardate: [-30]6365.79 hwloidl> This commit covers changes in GHC to get GUM (way=mp) and GUM/GdH (way=md) working. It is a merge of my working version of GUM, based on GHC 4.06, with GHC 4.11. Almost all changes are in the RTS (see below). GUM is reasonably stable, we used the 4.06 version in large-ish programs for recent papers. Couple of things I want to change, but nothing urgent. GUM/GdH has just been merged and needs more testing. Hope to do that in the next weeks. It works in our working build but needs tweaking to run. GranSim doesn't work yet (*sigh*). Most of the code should be in, but needs more debugging. ToDo: I still want to make the following minor modifications before the release - Better wrapper skript for parallel execution [ghc/compiler/main] - Update parallel docu: started on it but it's minimal [ghc/docs/users_guide] - Clean up [nofib/parallel]: it's a real mess right now (*sigh*) - Update visualisation tools (minor things only IIRC) [ghc/utils/parallel] - Add a Klingon-English glossary * RTS: Almost all changes are restricted to ghc/rts/parallel and should not interfere with the rest. I only comment on changes outside the parallel dir: - Several changes in Schedule.c (scheduling loop; createThreads etc); should only affect parallel code - Added ghc/rts/hooks/ShutdownEachPEHook.c - ghc/rts/Linker.[ch]: GUM doesn't know about Stable Names (ifdefs)!! - StgMiscClosures.h: END_TSO_QUEUE etc now defined here (from StgMiscClosures.hc) END_ECAF_LIST was missing a leading stg_ - SchedAPI.h: taskStart now defined in here; it's only a wrapper around scheduleThread now, but might use some init, shutdown later - RtsAPI.h: I have nuked the def of rts_evalNothing * Compiler: - ghc/compiler/main/DriverState.hs added PVM-ish flags to the parallel way added new ways for parallel ticky profiling and distributed exec - ghc/compiler/main/DriverPipeline.hs added a fct run_phase_MoveBinary which is called with way=mp after linking; it moves the bin file into a PVM dir and produces a wrapper script for parallel execution maybe cleaner to add a MoveBinary phase in DriverPhases.hs but this way it's less intrusive and MoveBinary makes probably only sense for mp anyway * Nofib: - nofib/spectral/Makefile, nofib/real/Makefile, ghc/tests/programs/Makefile: modified to skip some tests if HWL_NOFIB_HACK is set; only tmp to record which test prgs cause problems in my working build right now
* [project @ 2001-03-13 14:18:47 by simonmar]simonmar2001-03-131-1/+1
| | | | re-instate an ASSERT that was temporarily commented out.
* [project @ 2001-03-13 12:50:29 by simonmar]simonmar2001-03-133-39/+36
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Some rearrangements that Simon & I have been working on recently: - CoreSat is now CorePrep, and is a general "prepare-for-code- generation" pass. It does cloning, saturation of constructors & primops, A-normal form, and a couple of other minor fiddlings. - CoreTidy no longer does cloning, and minor fiddlings. It doesn't need the unique supply any more, so that's removed. - CoreToStg now collects CafInfo and the list of CafRefs for each binding. The SRT pass is much simpler now. - IdInfo now has a CgInfo field for "code generator info". It currently contains arity (the actual code gen arity which affects the calling convention as opposed to the ArityInfo which is a measure of how many arguments the Id can be applied to before it does any work), and CafInfo. Previously we overloaded the ArityInfo field to contain both codegen arity and simplifier arity. Things are cleaner now. - CgInfo is collected by CoreToStg, and passed back into CoreTidy in a loop. The compiler will complain rather than going into a black hole if the CgInfo is pulled on too early. - Worker info in an interface file now comes with arity info attached. Previously the main arity info was overloaded for this purpose, but it lead to a few hacks in the compiler, this tidies things up somewhat. Bottom line: we removed several fragilities, and tidied up a number of things. Code size should be smaller, but we'll see...
* [project @ 2001-03-06 10:13:35 by simonmar]simonmar2001-03-061-4/+4
| | | | import wibbles
* [project @ 2001-02-20 09:38:59 by simonpj]simonpj2001-02-202-20/+11
| | | | | | | | | | | | | | | | | | | | | | | Back end changes [CgExpr, ClosureInfo, CoreSat, CoreUtils, ~~~~~~~~~~~~~~~~ CmdLineOpts, HscMain, CoreToStg, StgSyn] * Move CoreTidy and interface-file dumping *before* CoreSat. In this way interface files are not in A-normal form, so they are less bulky, and a bit easier to use as input to the optimiser. So now CoreSat is regarded as a pre-pass to CoreToStg. Since CoreTidy pins on utterly-final IdInfo, CoreSat has to be very careful not to change the arity of any function. * CoreSat uses OrdList instead of lists to collect floating binds This in turn meant I could simplify the FloatingBind type a bit * Greatly simplfy the StgBinderInfo data type. It was gathering far more information than we needed. * Add a flag -fkeep-stg-types, which keeps type abstractions and applications in STG code, for the benefit of code generators that are typed; notably the .NET ILX code generator.
* [project @ 2000-12-20 10:35:33 by simonmar]simonmar2000-12-201-3/+11
| | | | ASSERT that thunks have the right CafInfo.
* [project @ 2000-12-15 17:07:20 by simonmar]simonmar2000-12-151-2/+5
| | | | | ASSERT that we have the right number of arguments when building a constructor, to avoid repeats of today's extended debugging session.
* [project @ 2000-12-06 13:19:49 by simonmar]simonmar2000-12-067-124/+133
| | | | | | | | | | | | | | | | | | | | | | | | | | Re-engineer the transition from Core to STG syntax. Main changes in this commit: - a new pass, CoreSat, handles saturation of constructors and PrimOps, and puts the syntax into STG-like normal form (applications to atoms only, etc), modulo type applications and Notes. - CoreToStg is now done at the same time as StgVarInfo. Most of the contents of StgVarInfo.lhs have been copied into CoreToStg.lhs and some simplifications made. less major changes: - globalisation of names for the purposes of object splitting is now done by the C code generator (which is the Right Place in principle, but it was a bit fiddly). - CoreTidy now does cloning of local binders and collection of arity info. The IdInfo from CoreTidy is now *almost* the final IdInfo we put in the interface file, except for CafInfo. I'm going to move the CafInfo collection into CoreTidy in due course too. - and some other minor tidyups while I was in cluster-bomb commit mode.
* [project @ 2000-11-24 09:51:38 by simonpj]simonpj2000-11-242-8/+6
| | | | Unused imports and suchlike
* [project @ 2000-11-21 15:41:10 by sewardj]sewardj2000-11-211-0/+5
| | | | Add dummy import dependency to CgExpr so that booting in batch mode works.
* [project @ 2000-11-15 17:07:34 by simonpj]simonpj2000-11-151-9/+7
| | | | | | | | | | I finally got tired of not having splitTyConApp tyConAppTyCon tyConAppArgs (Previously we called splitTyConApp_maybe, but it's a pain in the neck.)
* [project @ 2000-11-15 14:37:08 by simonpj]simonpj2000-11-152-156/+54
| | | | | | | | | | | | | The main thing in this commit is to change StgAlts so that it carries a TyCon, and not a Type. Furthermore, the TyCon is derived from the alternatives, so it should have its constructors etc, even if there's a module loop involved, so that some versions of the TyCon don't have the constructors visible. There's a comment in StgSyn.lhs, with the type decl for StgAlts Also: a start on hscExpr in HscMain.
* [project @ 2000-11-14 17:41:04 by sewardj]sewardj2000-11-141-2/+2
| | | | Fixes to do with CM and module cycles. Also to do with OPTIONS pragmas.
* [project @ 2000-11-14 08:07:11 by simonpj]simonpj2000-11-141-2/+2
| | | | | | | | | Changing the way we know whether something is exported. THIS COMMIT WON'T EVEN COMPILE (I'm doing it to transfer from my laptop.) Wait till later today before updating.
* [project @ 2000-11-10 15:12:50 by simonpj]simonpj2000-11-102-18/+20
| | | | | | | | | | | | | | 1. Outputable.PprStyle now carries a bit more information In particular, the printing style tells whether to print a name in unqualified form. This used to be embedded in a Name, but since Names now outlive a single compilation unit, that's no longer appropriate. So now the print-unqualified predicate is passed in the printing style, not embedded in the Name. 2. I tidied up HscMain a little. Many of the showPass messages have migraged into the repective pass drivers
* [project @ 2000-11-07 15:21:38 by simonmar]simonmar2000-11-071-2/+2
| | | | | | This commit completes the merge of compiler part of the HEAD with the before-ghci-branch to before-ghci-branch-merged.
* [project @ 2000-11-07 13:12:21 by simonpj]simonpj2000-11-073-15/+11
| | | | More small changes
* [project @ 2000-11-06 08:15:20 by simonpj]simonpj2000-11-066-60/+7
| | | | Dealing with instance-decl imports; and removing unnecessary imports
* [project @ 2000-10-31 12:07:43 by simonpj]simonpj2000-10-311-6/+3
| | | | Improve MkIface; get ready for NameEnv.lhs
* [project @ 2000-10-26 07:19:52 by simonpj]simonpj2000-10-261-11/+5
| | | | wibbles
* [project @ 2000-10-25 13:51:50 by simonpj]simonpj2000-10-251-7/+3
| | | | Wibbles
* [project @ 2000-10-24 10:12:16 by sewardj]sewardj2000-10-241-7/+7
| | | | Make the back-end world compile.
* [project @ 2000-10-24 08:40:09 by simonpj]simonpj2000-10-242-16/+17
| | | | Small wibbles
* [project @ 2000-10-24 07:35:00 by simonpj]simonpj2000-10-241-2/+2
| | | | Mainly MkIface
* [project @ 2000-10-18 09:40:17 by simonmar]simonmar2000-10-181-9/+18
| | | | | | | | - Dynamicise another couple of options (-fgenerics & -freport-compile) The rest look awkward to move into DynFlags. - Move opt_UseVanillaRegs & friends to CgRetConv, since they aren't real options.
* [project @ 2000-10-12 15:17:07 by sewardj]sewardj2000-10-121-31/+36
| | | | FastInt fixes
* [project @ 2000-10-03 08:43:00 by simonpj]simonpj2000-10-032-4/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | -------------------------------------- Adding generics SLPJ Oct 2000 -------------------------------------- This big commit adds Hinze/PJ-style generic class definitions, based on work by Andrei Serjantov. For example: class Bin a where toBin :: a -> [Int] fromBin :: [Int] -> (a, [Int]) toBin {| Unit |} Unit = [] toBin {| a :+: b |} (Inl x) = 0 : toBin x toBin {| a :+: b |} (Inr y) = 1 : toBin y toBin {| a :*: b |} (x :*: y) = toBin x ++ toBin y fromBin {| Unit |} bs = (Unit, bs) fromBin {| a :+: b |} (0:bs) = (Inl x, bs') where (x,bs') = fromBin bs fromBin {| a :+: b |} (1:bs) = (Inr y, bs') where (y,bs') = fromBin bs fromBin {| a :*: b |} bs = (x :*: y, bs'') where (x,bs' ) = fromBin bs (y,bs'') = fromBin bs' Now we can say simply instance Bin a => Bin [a] and the compiler will derive the appropriate code automatically. (About 9k lines of diffs. Ha!) Generic related things ~~~~~~~~~~~~~~~~~~~~~~ * basicTypes/BasicTypes: The EP type (embedding-projection pairs) * types/TyCon: An extra field in an algebraic tycon (genInfo) * types/Class, and hsSyn/HsBinds: Each class op (or ClassOpSig) carries information about whether it a) has no default method b) has a polymorphic default method c) has a generic default method There's a new data type for this: Class.DefMeth * types/Generics: A new module containing good chunk of the generic-related code It has a .hi-boot file (alas). * typecheck/TcInstDcls, typecheck/TcClassDcl: Most of the rest of the generics-related code * hsSyn/HsTypes: New infix type form to allow types of the form data a :+: b = Inl a | Inr b * parser/Parser.y, Lex.lhs, rename/ParseIface.y: Deal with the new syntax * prelude/TysPrim, TysWiredIn: Need to generate generic stuff for the wired-in TyCons * rename/RnSource RnBinds: A rather gruesome hack to deal with scoping of type variables from a generic patterns. Details commented in the ClassDecl case of RnSource.rnDecl. Of course, there are many minor renamer consequences of the other changes above. * lib/std/PrelBase.lhs Data type declarations for Unit, :+:, :*: Slightly unrelated housekeeping ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * hsSyn/HsDecls: ClassDecls now carry the Names for their implied declarations (superclass selectors, tycon, etc) in a list, rather than laid out one by one. This simplifies code between the parser and the type checker. * prelude/PrelNames, TysWiredIn: All the RdrNames are now together in PrelNames. * utils/ListSetOps: Add finite mappings based on equality and association lists (Assoc a b) Move stuff from List.lhs that is related
* [project @ 2000-09-07 13:25:28 by simonpj]simonpj2000-09-071-7/+7
| | | | Primitives can return ThreadId# values
* [project @ 2000-09-06 12:21:15 by simonmar]simonmar2000-09-061-6/+7
| | | | | | | | | | | | When compiling code for a case where the scrutinee is a primitve comparison operator, we used to place the tag in a variable whose unique was always the same: `mkPseudoUnique1 1'. This was mostly harmless but confused the Stix inliner in the NCG into generating slightly less efficient code when the variable was used twice in a basic block. This patch fixes the problem by generating a new unique by just changing the "tag" of an existing unique, namely the case binder.
* [project @ 2000-09-06 10:23:52 by simonmar]simonmar2000-09-061-1/+2
| | | | | | | Add new PrimRep, namely PrimPtrRep, as a catch-all for the various boxed primitive types that currently don't have their own PrimReps. Use this for MVar# and MutVar#. This fixes a crash in the code generator when a function returns one of these types.
* [project @ 2000-09-04 14:07:29 by simonmar]simonmar2000-09-041-2/+2
| | | | Use mkAbsCStmts rather than AbsCStmts directly.