summaryrefslogtreecommitdiff
path: root/compiler/codeGen
Commit message (Collapse)AuthorAgeFilesLines
* Misc Hpc improvement to dynamic tracer outputandy@galois.com2006-12-131-1/+5
| | | | | | | - Added HPCRIX support for passing tracer filename. - Added thread tracing support. - Cleaned up use of HsFFI.h
* Adding tracing supportandy@galois.com2006-12-092-6/+32
|
* Layout and comments onlysimonpj@microsoft.com2006-11-071-4/+1
|
* fixing type error inside Hpc inc; we had a 32 bit '1'.andy@galois.com2006-10-251-1/+1
|
* Haskell Program Coverageandy@galois.com2006-10-243-16/+119
| | | | | | | | | | | | | | | | | | | | This large checkin is the new ghc version of Haskell Program Coverage, an expression-level coverage tool for Haskell. Parts: - Hpc.[ch] - small runtime support for Hpc; reading/writing *.tix files. - Coverage.lhs - Annotates the HsSyn with coverage tickboxes. - New Note's in Core, - TickBox -- ticked on entry to sub-expression - BinaryTickBox -- ticked on exit to sub-expression, depending -- on the boolean result. - New Stg level TickBox (no BinaryTickBoxes, though) You can run the coverage tool with -fhpc at compile time. Main must be compiled with -fhpc.
* Add the primitive type Any, and use it for Dynamicssimonpj@microsoft.com2006-10-181-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | GHC's code generator can only enter a closure if it's guaranteed not to be a function. In the Dynamic module, we were using the type (forall a.a) as the type to which the dynamic type was unsafely cast: type Obj = forall a.a Gut alas this polytype was sometimes instantiated to (), something like this (it only bit when profiling was enabled) let y::() = dyn () in (y `cast` ..) p q As a result, an ASSERT in ClosureInfo fired (hooray). I've tided this up by making a new, primitive, lifted type Any, and arranging that Dynamic uses Any, thus: type Obj = ANy While I was at it, I also arranged that when the type checker instantiates un-constrained type variables, it now instantiates them to Any, not () e.g. length Any [] [There remains a Horrible Hack when we want Any-like things at arbitrary kinds. This essentially never happens, but see comments with TysPrim.mkAnyPrimTyCon.] Anyway, this fixes Trac #905
* Comments onlsimonpj@microsoft.com2006-10-181-3/+4
|
* Rejig TABLES_NEXT_TO_CODE: the -unreg flag was broken by earlier changesSimon Marlow2006-10-172-17/+7
| | | | | | | | A GHC binary can generally build either registerised or unregisterised code, unless it is unregisterised only. The previous changes broke this, but I think I've now restored it.
* Partially fix GHCi when unregisterisedIan Lynagh2006-10-121-1/+1
| | | | | | | | We were constructing info tables designed for TABLES_NEXT_TO_CODE, but were building without TABLES_NEXT_TO_CODE. This patch also fixes a bug when we are unregisterised on amd64 and have code with an address above 2^32.
* Module header tidyup, phase 1Simon Marlow2006-10-1122-453/+360
| | | | | | | | | | | | This patch is a start on removing import lists and generally tidying up the top of each module. In addition to removing import lists: - Change DATA.IOREF -> Data.IORef etc. - Change List -> Data.List etc. - Remove $Id$ - Update copyrights - Re-order imports to put non-GHC imports last - Remove some unused and duplicate imports
* Interface file optimisation and removal of nameParentSimon Marlow2006-10-111-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This large commit combines several interrelated changes: - IfaceSyn now contains actual Names rather than the special IfaceExtName type. The binary interface file contains a symbol table of Names, where each entry is a (package, ModuleName, OccName) triple. Names in the IfaceSyn point to entries in the symbol table. This reduces the size of interface files, which should hopefully improve performance (not measured yet). The toIfaceXXX functions now do not need to pass around a function from Name -> IfaceExtName, which makes that code simpler. - Names now do not point directly to their parents, and the nameParent operation has gone away. It turned out to be hard to keep this information consistent in practice, and the parent info was only valid in some Names. Instead we made the following changes: * ImportAvails contains a new field imp_parent :: NameEnv AvailInfo which gives the family info for any Name in scope, and is used by the renamer when renaming export lists, amongst other things. This info is thrown away after renaming. * The mi_ver_fn field of ModIface now maps to (OccName,Version) instead of just Version, where the OccName is the parent name. This mapping is used when constructing the usage info for dependent modules. There may be entries in mi_ver_fn for things that are not in scope, whereas imp_parent only deals with in-scope things. * The md_exports field of ModDetails now contains [AvailInfo] rather than NameSet. This gives us family info for the exported names of a module. Also: - ifaceDeclSubBinders moved to IfaceSyn (seems like the right place for it). - heavily refactored renaming of import/export lists. - Unfortunately external core is now broken, as it relied on IfaceSyn. It requires some attention.
* GADT selector bugfix, bits of cleanupManuel M T Chakravarty2006-09-201-2/+2
| | | | | | | | Mon Sep 18 16:48:32 EDT 2006 Manuel M T Chakravarty <chak@cse.unsw.edu.au> * GADT selector bugfix, bits of cleanup Sun Aug 6 19:43:47 EDT 2006 Manuel M T Chakravarty <chak@cse.unsw.edu.au> * GADT selector bugfix, bits of cleanup Thu Jul 27 08:10:58 EDT 2006 kevind@bu.edu
* fix some GADT record selector bugs (still some remaining)Manuel M T Chakravarty2006-09-201-1/+1
| | | | | | | | Mon Sep 18 16:47:22 EDT 2006 Manuel M T Chakravarty <chak@cse.unsw.edu.au> * fix some GADT record selector bugs (still some remaining) Sun Aug 6 19:42:50 EDT 2006 Manuel M T Chakravarty <chak@cse.unsw.edu.au> * fix some GADT record selector bugs (still some remaining) Thu Jul 27 07:04:29 EDT 2006 kevind@bu.edu
* Load the target of a dynamic foreign call into a temporarySimon Marlow2006-08-251-5/+15
| | | | | Fixes ffi011(opt) on x86_64. I don't know why this has only just appeared today, it's apparently been broken for some time.
* Don't include the package name in a cost centre's module nameSimon Marlow2006-08-031-2/+6
| | | | | | This is mainly to restore the old behaviour, but also we shouldn't normally need the package name in a cost centre because only the "main" package normally has cost centres.
* .hi-boot-5 is obsolete; the earliest GHC we support uses .hi-boot-6Simon Marlow2006-07-284-17/+0
|
* Generalise Package SupportSimon Marlow2006-07-2512-107/+101
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch pushes through one fundamental change: a module is now identified by the pair of its package and module name, whereas previously it was identified by its module name alone. This means that now a program can contain multiple modules with the same name, as long as they belong to different packages. This is a language change - the Haskell report says nothing about packages, but it is now necessary to understand packages in order to understand GHC's module system. For example, a type T from module M in package P is different from a type T from module M in package Q. Previously this wasn't an issue because there could only be a single module M in the program. The "module restriction" on combining packages has therefore been lifted, and a program can contain multiple versions of the same package. Note that none of the proposed syntax changes have yet been implemented, but the architecture is geared towards supporting import declarations qualified by package name, and that is probably the next step. It is now necessary to specify the package name when compiling a package, using the -package-name flag (which has been un-deprecated). Fortunately Cabal still uses -package-name. Certain packages are "wired in". Currently the wired-in packages are: base, haskell98, template-haskell and rts, and are always referred to by these versionless names. Other packages are referred to with full package IDs (eg. "network-1.0"). This is because the compiler needs to refer to entities in the wired-in packages, and we didn't want to bake the version of these packages into the comiler. It's conceivable that someone might want to upgrade the base package independently of GHC. Internal changes: - There are two module-related types: ModuleName just a FastString, the name of a module Module a pair of a PackageId and ModuleName A mapping from ModuleName can be a UniqFM, but a mapping from Module must be a FiniteMap (we provide it as ModuleEnv). - The "HomeModules" type that was passed around the compiler is now gone, replaced in most cases by the current package name which is contained in DynFlags. We can tell whether a Module comes from the current package by comparing its package name against the current package. - While I was here, I changed PrintUnqual to be a little more useful: it now returns the ModuleName that the identifier should be qualified with according to the current scope, rather than its original module. Also, PrintUnqual tells whether to qualify module names with package names (currently unused). Docs to follow.
* unused importSimon Marlow2006-07-061-1/+0
|
* unused importSimon Marlow2006-07-061-1/+0
|
* unused importsSimon Marlow2006-07-041-2/+2
|
* Comments and import trimmingsimonpj@microsoft.com2006-07-121-4/+4
|
* x86-64: fix a problem exposed by negative offsets in vector tablesSimon Marlow2006-06-291-1/+8
| | | | | | | | | | | static relative offsets (eg .long l1-l2) are restricted to 32 bits on x86-64 due to lack of support in the linker. The codegen, NCG and runtime work around this, using 32-bit offsets instead of 64. However, we were missing a workaround for vector tables, and it happened to work by accident because the offsets were always positive and resolved by the assembler. The bug was exposed by using the NCG to compile the RTS, where the offsets became negative, again by accident.
* flattenCgStmts: fix a case of empty code blocks being generatedSimon Marlow2006-06-201-1/+1
|
* Reorganisation of the source treeSimon Marlow2006-04-0733-0/+10447
Most of the other users of the fptools build system have migrated to Cabal, and with the move to darcs we can now flatten the source tree without losing history, so here goes. The main change is that the ghc/ subdir is gone, and most of what it contained is now at the top level. The build system now makes no pretense at being multi-project, it is just the GHC build system. No doubt this will break many things, and there will be a period of instability while we fix the dependencies. A straightforward build should work, but I haven't yet fixed binary/source distributions. Changes to the Building Guide will follow, too.