summaryrefslogtreecommitdiff
path: root/compiler/deSugar/DsCCall.lhs
Commit message (Collapse)AuthorAgeFilesLines
* Introduce CPR for sum types (Trac #5075)Simon Peyton Jones2013-01-241-2/+43
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The main payload of this patch is to extend CPR so that it detects when a function always returns a result constructed with the *same* constructor, even if the constructor comes from a sum type. This doesn't matter very often, but it does improve some things (results below). Binary sizes increase a little bit, I think because there are more wrappers. This with -split-objs. Without split-ojbs binary sizes increased by 6% even for HelloWorld.hs. It's hard to see exactly why, but I think it was because System.Posix.Types.o got included in the linked binary, whereas it didn't before. Program Size Allocs Runtime Elapsed TotalMem fluid +1.8% -0.3% 0.01 0.01 +0.0% tak +2.2% -0.2% 0.02 0.02 +0.0% ansi +1.7% -0.3% 0.00 0.00 +0.0% cacheprof +1.6% -0.3% +0.6% +0.5% +1.4% parstof +1.4% -4.4% 0.00 0.00 +0.0% reptile +2.0% +0.3% 0.02 0.02 +0.0% ---------------------------------------------------------------------- Min +1.1% -4.4% -4.7% -4.7% -15.0% Max +2.3% +0.3% +8.3% +9.4% +50.0% Geometric Mean +1.9% -0.1% +0.6% +0.7% +0.3% Other things in this commit ~~~~~~~~~~~~~~~~~~~~~~~~~~~ * Got rid of the Lattice class in Demand * Refactored the way that products and newtypes are decomposed (no change in functionality)
* Move tARGET_* out of HaskellConstantsIan Lynagh2012-09-171-6/+9
|
* Move wORD_SIZE into platformConstantsIan Lynagh2012-09-161-7/+7
|
* Pass DynFlags down to showSDocIan Lynagh2012-06-121-4/+6
|
* Change how macros like ASSERT are definedIan Lynagh2012-06-051-0/+1
| | | | | By using Haskell's debugIsOn rather than CPP's "#ifdef DEBUG", we don't need to kludge things to keep the warning checker happy etc.
* Implement "value" imports with the CAPIIan Lynagh2012-02-261-1/+1
| | | | | | This allows us to import values (i.e. non-functions) with the CAPI. This means we can access values even if (on some or all platforms) they are simple #defines.
* GHC gets a new constraint solver. More efficient and smaller in size.Dimitrios Vytiniotis2011-11-161-2/+2
|
* Use -fwarn-tabs when validatingIan Lynagh2011-11-041-0/+7
| | | | | We only use it for "compiler" sources, i.e. not for libraries. Many modules have a -fno-warn-tabs kludge for now.
* Handle newtypes and type functions correctly in FFI types; fixes #3008Ian Lynagh2011-10-011-2/+2
| | | | | | You can now use type functions in FFI types. Newtypes are now only looked through if the constructor is in scope.
* Remove some (probably bit-rotted) .NET casesIan Lynagh2011-09-131-51/+0
|
* Implement -XConstraintKindMax Bolingbroke2011-09-061-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Basically as documented in http://hackage.haskell.org/trac/ghc/wiki/KindFact, this patch adds a new kind Constraint such that: Show :: * -> Constraint (?x::Int) :: Constraint (Int ~ a) :: Constraint And you can write *any* type with kind Constraint to the left of (=>): even if that type is a type synonym, type variable, indexed type or so on. The following (somewhat related) changes are also made: 1. We now box equality evidence. This is required because we want to give (Int ~ a) the *lifted* kind Constraint 2. For similar reasons, implicit parameters can now only be of a lifted kind. (?x::Int#) => ty is now ruled out 3. Implicit parameter constraints are now allowed in superclasses and instance contexts (this just falls out as OK with the new constraint solver) Internally the following major changes were made: 1. There is now no PredTy in the Type data type. Instead GHC checks the kind of a type to figure out if it is a predicate 2. There is now no AClass TyThing: we represent classes as TyThings just as a ATyCon (classes had TyCons anyway) 3. What used to be (~) is now pretty-printed as (~#). The box constructor EqBox :: (a ~# b) -> (a ~ b) 4. The type LCoercion is used internally in the constraint solver and type checker to represent coercions with free variables of type (a ~ b) rather than (a ~# b)
* Add Type.tyConAppTyCon_maybe and tyConAppArgs_maybe, and use themSimon Peyton Jones2011-08-031-5/+5
| | | | | | These turn out to be a useful special case of splitTyConApp_maybe. A refactoring only; no change in behaviour
* This BIG PATCH contains most of the work for the New Coercion RepresentationSimon Peyton Jones2011-04-191-2/+2
| | | | | | | | | | | | | | See the paper "Practical aspects of evidence based compilation in System FC" * Coercion becomes a data type, distinct from Type * Coercions become value-level things, rather than type-level things, (although the value is zero bits wide, like the State token) A consequence is that a coerion abstraction increases the arity by 1 (just like a dictionary abstraction) * There is a new constructor in CoreExpr, namely Coercion, to inject coercions into terms
* Refactor PackageTarget back into StaticTargetBen.Lippmeier@anu.edu.au2010-01-041-1/+1
|
* Remove old 'foreign import dotnet' codeSimon Marlow2009-07-271-16/+9
| | | | It still lives in darcs, if anyone wants to revive it sometime.
* Remove unused importsIan Lynagh2009-07-071-1/+0
|
* Tidy up the treatment of dead binderssimonpj@microsoft.com2008-09-201-8/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch does a lot of tidying up of the way that dead variables are handled in Core. Just the sort of thing to do on an aeroplane. * The tricky "binder-swap" optimisation is moved from the Simplifier to the Occurrence Analyser. See Note [Binder swap] in OccurAnal. This is really a nice change. It should reduce the number of simplifier iteratoins (slightly perhaps). And it means that we can be much less pessimistic about zapping occurrence info on binders in a case expression. * For example: case x of y { (a,b) -> e } Previously, each time around, even if y,a,b were all dead, the Simplifier would pessimistically zap their OccInfo, so that we can't see they are dead any more. As a result virtually no case expression ended up with dead binders. This wasn't Bad in itself, but it always felt wrong. * I added a check to CoreLint to check that a dead binder really isn't used. That showed up a couple of bugs in CSE. (Only in this sense -- they didn't really matter.) * I've changed the PprCore printer to print "_" for a dead variable. (Use -dppr-debug to see it again.) This reduces clutter quite a bit, and of course it's much more useful with the above change. * Another benefit of the binder-swap change is that I could get rid of the Simplifier hack (working, but hacky) in which the InScopeSet was used to map a variable to a *different* variable. That allowed me to remove VarEnv.modifyInScopeSet, and to simplify lookupInScopeSet so that it doesn't look for a fixpoint. This fixes no bugs, but is a useful cleanup. * Roman pointed out that Id.mkWildId is jolly dangerous, because of its fixed unique. So I've - localied it to MkCore, where it is private (not exported) - renamed it to 'mkWildBinder' to stress that you should only use it at binding sites, unless you really know what you are doing - provided a function MkCore.mkWildCase that emodies the most common use of mkWildId, and use that elsewhere So things are much better * A knock-on change is that I found a common pattern of localising a potentially global Id, and made a function for it: Id.localiseId
* Make DsCCall warning-freeIan Lynagh2008-05-041-15/+12
|
* Remove some unnecessary importsIan Lynagh2008-03-291-5/+0
|
* Monadify deSugar/DsCCall: use do, return, applicative, standard monad functionsTwan van Laarhoven2008-01-171-129/+122
|
* Fix CodingStyle#Warnings URLsIan Lynagh2007-09-041-1/+1
|
* Use OPTIONS rather than OPTIONS_GHC for pragmasIan Lynagh2007-09-031-2/+2
| | | | | | | Older GHCs can't parse OPTIONS_GHC. This also changes the URL referenced for the -w options from WorkingConventions#Warnings to CodingStyle#Warnings for the compiler modules.
* Add {-# OPTIONS_GHC -w #-} and some blurb to all compiler modulesIan Lynagh2007-09-011-0/+7
|
* Tidy up the treatment of newtypes, refactor, and fix Trac #736simonpj@microsoft.com2007-08-091-42/+48
| | | | | | | | | I've forgotten the precise details already, but this patch significantly refactors the way newtypes are handled, fixes the foreign-export problem Trac #736 (which concerned newtypes), and gets rid of a bogus unsafeCoerce in the foreign export desugaring.
* Module header tidyup, phase 1Simon Marlow2006-10-111-43/+22
| | | | | | | | | | | | 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
* Flip direction of newtype coercions, fix some commentsManuel M T Chakravarty2006-09-201-2/+2
| | | | | | | | Mon Sep 18 17:19:19 EDT 2006 Manuel M T Chakravarty <chak@cse.unsw.edu.au> * Flip direction of newtype coercions, fix some comments Sun Aug 6 20:56:23 EDT 2006 Manuel M T Chakravarty <chak@cse.unsw.edu.au> * Flip direction of newtype coercions, fix some comments Thu Aug 3 10:53:37 EDT 2006 kevind@bu.edu
* fix some coercion kind representation things, extend exprIsConApp_maybe to ↵Manuel M T Chakravarty2006-09-201-3/+3
| | | | | | | | | | non-vanilla Mon Sep 18 14:51:33 EDT 2006 Manuel M T Chakravarty <chak@cse.unsw.edu.au> * fix some coercion kind representation things, extend exprIsConApp_maybe to non-vanilla Sat Aug 5 21:48:21 EDT 2006 Manuel M T Chakravarty <chak@cse.unsw.edu.au> * fix some coercion kind representation things, extend exprIsConApp_maybe to non-vanilla Wed Jul 19 08:06:28 EDT 2006 kevind@bu.edu
* Massive patch for the first months work adding System FC to GHC #12Manuel M T Chakravarty2006-08-041-7/+7
| | | | | | | | Broken up massive patch -=chak Original log message: This is (sadly) all done in one patch to avoid Darcs bugs. It's not complete work... more FC stuff to come. A compiler using just this patch will fail dismally.
* Remove InlinePlease and add inline function and RULEsimonpj@microsoft.com2006-06-051-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | For a long time GHC has had some internal mechanism designed to support a call-site inline directive, thus inline f xs makes f be inlined at the call site even if f is big. However, the surface syntax seems to have gone, and in any case it can be done more neatly using a RULE. This commit: * Removes the InlineCall constructor for Note and InlinePlease for SimplCont * Adds a new known-key Id called 'inline', whose definition in GHC.Base is just the identity function * Adds a built-in RULE in PrelRules that rewrites (inline f) to the body of f, if possible * Adds documentation NOTE: I have not tested this (aeroplane work). Give it a try!
* Allow IO to be wrapped in a newtype in foreign import/exportsimonpj@microsoft.com2006-04-111-85/+90
| | | | | | | | | | | | | | | | | | | Up to now, the silent unwrapping of newtypes in foreign import/export has been limited to data values. But it's useful for the IO monad itself: newtype MyIO a = MIO (IO a) foreign import foo :: Int -> MyIO Int This patch allows the IO monad to be wrapped too. This applies to foreign import "dynamic" and "wrapper", thus foreign import "wrapper" foo :: MyIO () -> HisIO (FunPtr (MyIO ())) Warning: I did on the plane, and I'm no longer sure if its 100% complete, so needs more testing. In particular the wrapper/dynamic bit.
* Reorganisation of the source treeSimon Marlow2006-04-071-0/+456
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.