summaryrefslogtreecommitdiff
path: root/compiler
Commit message (Collapse)AuthorAgeFilesLines
* InstEnv: Ensure that instance visibility check is lazywip/lazy-instance-matchingBen Gamari2016-07-192-34/+71
| | | | | | | | Previously instIsVisible had completely broken the laziness of lookupInstEnv' since it would examine is_dfun_name to check the name of the defining module (to know whether it is an interactive module). This resulted in the visibility check drawing in an interface file unnecessarily.
* TcInteract: Add braces to matchClassInst trace outputBen Gamari2016-07-191-2/+2
| | | | This allows you to easily move to the result in a well-equipped editor.
* Make okConIdOcc recognize unboxed tuplesRyan Scott2016-07-181-8/+13
| | | | | | | | | | | | | | | | | | | | | | Summary: `okConIdOcc`, which validates that a type or constructor name is valid for splicing using Template Haskell, has a special case for tuples, but neglects to look for unboxed tuples, causing some sensible Template Haskell code involving unboxed tuples to be rejected. Fixes #12407. Test Plan: make test TEST=T12407 Reviewers: austin, bgamari, hvr, goldfire Reviewed By: goldfire Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D2410 GHC Trac Issues: #12407
* Fix Template Haskell reification of unboxed tuple typesRyan Scott2016-07-181-1/+3
| | | | | | | | | | | | | | | | | | | | Summary: Previously, Template Haskell reified unboxed tuple types as boxed tuples with twice the appropriate arity. Fixes #12403. Test Plan: make test TEST=T12403 Reviewers: hvr, goldfire, austin, bgamari Reviewed By: goldfire Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D2405 GHC Trac Issues: #12403
* Make DeriveFunctor work with unboxed tuplesRyan Scott2016-07-181-2/+6
| | | | | | | | | | | | | | | | | | | | | | | | Summary: Unboxed tuples have `RuntimeRep` arguments which `-XDeriveFunctor` was mistaking for actual data constructor arguments. As a result, a derived `Functor` instance for a datatype that contained an unboxed tuple would generate twice as many arguments as it needed for an unboxed tuple pattern match or expression. The solution is to simply put `dropRuntimeRepArgs` in the right place. Fixes #12399. Test Plan: ./validate Reviewers: austin, hvr, bgamari Reviewed By: bgamari Subscribers: thomie, osa1 Differential Revision: https://phabricator.haskell.org/D2404 GHC Trac Issues: #12399
* Fix misspellings of the word "instance" in commentsRyan Scott2016-07-185-6/+6
| | | | [ci skip]
* Pretty: remove a harmful $! (#12227)Thomas Miedema2016-07-171-1/+44
| | | | | | | | | | | | | | | | | This is backport of [1] for GHC's copy of Pretty. See Note [Differences between libraries/pretty and compiler/utils/Pretty.hs]. [1] http://git.haskell.org/packages/pretty.git/commit/bbe9270c5f849a5bb74c9166a5f4202cfb0dba22 https://github.com/haskell/pretty/issues/32 https://github.com/haskell/pretty/pull/35 Reviewers: bgamari, austin Reviewed By: austin Differential Revision: https://phabricator.haskell.org/D2397 GHC Trac Issues: #12227
* CodeGen: Way to dump cmm only once (#11717)Vladimir Trubilov2016-07-174-28/+38
| | | | | | | | | | | | | | | | | | | | | | | | | The `-ddump-cmm` put all stages of Cmm processing into one output. This patch changes its behavior and adds two more options to make Cmm dumping flexible. - `-ddump-cmm-from-stg` dumps only initial version of Cmm right after STG->Cmm codegen - `-ddump-cmm` dumps the final result of the Cmm pipeline processing - `-ddump-cmm-verbose` dumps intermediate output of each Cmm pipeline step - `-ddump-cmm-proc` and `-ddump-cmm-caf` seems were lost. Now enabled Test Plan: ./validate Reviewers: thomie, simonmar, austin, bgamari Reviewed By: thomie, simonmar Subscribers: simonpj, thomie Differential Revision: https://phabricator.haskell.org/D2393 GHC Trac Issues: #11717
* Binary: Use ByteString's copy in getBSBen Gamari2016-07-161-19/+12
| | | | | | | | | | | | | | It's unclear how much of an effect on runtime this will have, but if nothing else the code generation may be a tad better since the system's `memcpy` will be used. Test Plan: Validate Reviewers: simonmar, austin Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D2401
* IfaceEnv: Only check for built-in OccNames if mod is GHC.TypesBen Gamari2016-07-162-32/+63
| | | | | | | | | | | | This check is not entirely cheap and will not succeed unless we are looking for something in the module where built-in syntax lives, GHC.Types. Reviewers: simonpj, austin Subscribers: simonpj, thomie, osa1 Differential Revision: https://phabricator.haskell.org/D2400
* Log heap profiler samples to event logBen Gamari2016-07-162-2/+3
| | | | | | | | | | | | Test Plan: Try it Reviewers: hvr, simonmar, austin, erikd Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D1722 GHC Trac Issues: #11094
* Bring comments in TcGenGenerics up to dateRyan Scott2016-07-151-2/+4
| | | | [ci skip]
* tidyOccNames: Rename variables fairlyJoachim Breitner2016-07-142-8/+61
| | | | | | | | | | | So that > :t (id,id,id) produces (id,id,id) :: (a3 -> a3, a2 -> a2, a1 -> a1) instead of (id,id,id) :: (a2 -> a2, a1 -> a1, a -> a) Differential Revision: https://phabricator.haskell.org/D2402
* tidyType: Rename variables of nested forall at onceJoachim Breitner2016-07-132-8/+32
| | | | | this refactoring commit prepares for fixing #12382, which can now be implemented soley in tidyTyCoVarBndrs.
* Demand analyser: Implement LetUp rule (#12370)Joachim Breitner2016-07-121-21/+79
| | | | | | | | | | | | | This makes the implementation match the description in the paper more closely: There, a let binding that is not a function has first its body analised, and then the binding’s RHS. This way, the demand on the bound variable by the body can be fed into the RHS, yielding more precise results. Performance measurements do unfortunately not show significant improvements or regessions. Differential Revision: https://phabricator.haskell.org/D2395
* Pretty: delete really old changelogThomas Miedema2016-07-111-154/+20
| | | | | | | This changelog is very incomplete, and basically useless. I'm removing it, because it made it harder to compare this copy of `Pretty.hs` with the copy in `libraries/pretty` (from which a similar changelog was deleted some time ago).
* TysWiredIn: Use UniqFM lookup for built-in OccNamesBen Gamari2016-07-101-27/+25
| | | | | | | | | | | | | | | | | | | | | Previously we would unpack the OccName into a String, then pattern match against this string. Due to the implementation of `unpackFS`, this actually unpacks the entire contents, even though we often only need to look at the first few characters. Here we take another approach: build a UniqFM with the known built-in OccNames, allowing us to use `FastString`'s hash-based comparison instead. Reviewers: simonpj, austin, simonmar Reviewed By: simonmar Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D2385 GHC Trac Issues: #12357
* DsExpr: Remove usage of concatFS in fingerprintNameBen Gamari2016-07-081-7/+5
| | | | | | | | | | | | | | | | | This was the only user of concatFS and really just wants the `String` anyways. Stumbled upon while looking at #12357. Test Plan: Validate Reviewers: austin Reviewed By: austin Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D2386
* Kill eltsUFM in classifyTyConsBartosz Nitka2016-07-081-2/+2
| | | | GHC Trac: #4012
* OccName: Avoid re-encoding derived OccNamesBen Gamari2016-07-081-14/+28
| | | | | | | | | | | | | | | | | | | | Previously we would form derived OccNames by first decoding the name being derived from, manipulating it in [Char] form, and then re-encoding. This is all very wasteful as we essentially always just want to concatenate. Instead we now take care to form the final name with only one concatFS. Test Plan: Validate, examing compiler allocations Reviewers: simonpj, austin Reviewed By: simonpj Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D2387 GHC Trac Issues: #12357
* OccName: Implement startsWithUnderscore in terms of headFSBen Gamari2016-07-081-3/+1
| | | | | | | | | | | | | This avoids decoding the entire string just to look at the first character. Test Plan: Validate Reviewers: austin Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D2388
* FastString: Supply mconcat implementationBen Gamari2016-07-081-0/+1
| | | | | | | | | | Test Plan: Validate Reviewers: austin Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D2389
* FastString: Add IsString instanceBen Gamari2016-07-081-0/+3
|
* FastString: Reduce allocations of concatFSBen Gamari2016-07-081-1/+1
| | | | | Instead of unpacking and then repacking we simply concatenate all of the individual ByteStrings.
* Use UniqDFM for InstEnvBartosz Nitka2016-07-081-9/+24
| | | | | | | Rationale in the comment. Also updates submodule array with test output changes. GHC Trac: #4012
* Utils: Fix `lengthIs` and `lengthExceeds` for negative argsÖmer Sinan Ağacan2016-07-071-6/+15
| | | | Credits goes to SPJ for finding this.
* Add Note [FamInstEnv determinism]Bartosz Nitka2016-07-071-0/+14
| | | | | | I'm just turning previous commit message into a Note GHC Trac: #4012
* Correct the message displayed for syntax error (#12146)Aditya2016-07-071-2/+2
|
* Use deterministic maps for FamInstEnvBartosz Nitka2016-07-071-10/+10
| | | | | | | | | | | | | | We turn FamInstEnvs into lists in some places which don't directly affect the ABI. That happens in family consistency checks and when producing output for `:info`. Unfortunately that nondeterminism is nonlocal and it's hard to tell locally what it affects. Furthermore the envs should be relatively small, so it should be free to use deterministic maps here. Testing with nofib and ./validate detected no difference between UniqFM and UniqDFM. GHC Trac: #4012
* Document some codegen nondeterminismBartosz Nitka2016-07-0711-31/+50
| | | | | | | | | Bit-for-bit reproducible binaries are not a goal for now, so this is just marking places that could be a problem. Doing this will allow eltsUFM to be removed and will leave only nonDetEltsUFM. GHC Trac: #4012
* Style changes for UniqFMBartosz Nitka2016-07-071-148/+145
| | | | | | | | | | | | | | | | | | | This file used the old style with type signatures separated from the code. As far as I understand the idea was to generate PostScript files from the source. I think the idea was abandoned and this more modern style is more common in the codebase. Test Plan: it still compiles Reviewers: austin, simonmar, bgamari Reviewed By: simonmar, bgamari Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D2383
* Switch to LLVM version 3.8Erik de Castro Lopo2016-07-072-1/+9
| | | | | | | | | | | | | | LLVM 3.8 was released a couple of months ago. Test Plan: Build and test on x86_64/linux (perf-llvm) and armhf/linux. Reviewers: austin, hvr, rwbarton, bgamari Reviewed By: bgamari Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D2382
* Have addModFinalizer expose the local type environment.Facundo Domínguez2016-07-0612-46/+354
| | | | | | | | | | | | | | | | | | | | | | Summary: This annotates the splice point with 'HsSpliced ref e' where 'e' is the result of the splice. 'ref' is a reference that the typechecker will fill with the local type environment. The finalizer then reads the ref and uses the local type environment, which causes 'reify' to find local variables when run in the finalizer. Test Plan: ./validate Reviewers: simonpj, simonmar, bgamari, austin, goldfire Reviewed By: goldfire Subscribers: simonmar, thomie, mboes Differential Revision: https://phabricator.haskell.org/D2286 GHC Trac Issues: #11832
* Adds x86_64-apple-darwin14 target.Moritz Angermann2016-07-051-7/+10
| | | | | | | | | | | | | | | | | | x86_64-apple-darwin14, is the target for the 64bit simulator. Ideally, we'd have (i386|armv7|arm64|x64_86)-apple-ios, yet, many #ifdefs depend on `darwin`, notably libffi. Hence, this only adds x86_64-apple-darwin14 as a target. This also updates the comment to add the `-S` flag, and dump the output to stdout; and adjusts the `datalayout` and `triple` values, as obtained through the method mentioned in the comment. Reviewers: hvr, erikd, austin, bgamari, simonmar Reviewed By: simonmar Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D2378
* Remove varEnvEltsBartosz Nitka2016-07-051-3/+1
| | | | | | | | | | varEnvElts can introduce unnecessary nondeterminism and we can finally remove it, so that no one will use it by accident. If someone wants to use varEnvElts they should either use DVarEnv or use nonDetEltsUFM and document why it doesn't introduce nondeterminism. GHC Trac: #4012
* Kill varEnvElts in zonkEnvIdsBartosz Nitka2016-07-053-6/+14
| | | | | | | | | | | | | | | This localizes the nondeterminism that varEnvElts could have introduced, so that it's obvious that it's benign. Test Plan: ./validate Reviewers: simonpj, austin, bgamari Subscribers: thomie, simonmar Differential Revision: https://phabricator.haskell.org/D2390 GHC Trac Issues: #4012
* Document codegen nondeterminismBartosz Nitka2016-07-051-1/+5
| | | | | | | We don't care about bit-for-bit reproducibility, so I'm just documenting this as a possible source. GHC Trac: #4012
* White space onlySimon Peyton Jones2016-07-051-2/+2
|
* Tidy up tidyingSimon Peyton Jones2016-07-051-8/+2
| | | | | This is a tiny refactor, replacing an ad-hoc local function (TidyPgm.loookup_aux_id) with a solid global one (tidyVarOcc).
* Make unique auxiliary function names in derivingSimon Peyton Jones2016-07-054-142/+155
| | | | | | | | | In deriving for Data, we make some auxiliary functions, but they didn't always get distinct names (Trac #12245). This patch fixes it by using the same mechanism as for dictionary functions, namely chooseUniqueOccTc. Some assocated refactoring came along for the ride.
* Delete out-of-date commentSimon Peyton Jones2016-07-051-3/+0
|
* Use DVarEnv for vectInfoVarBartosz Nitka2016-07-057-33/+40
| | | | | | | | | This makes sure that we don't introduce unnecessary nondeterminism from vectorization. Also updates dph submodule to reflect the change in types. GHC Trac: #4012
* Extra ASSERTs for nameModuleSimon Peyton Jones2016-07-052-2/+3
|
* Check generic-default method for ambiguitySimon Peyton Jones2016-07-057-39/+74
| | | | | | | | | | Fixes Trac #7497 and #12151. In some earlier upheaval I introduced a bug in the ambiguity check for genreric-default method. This patch fixes it. But in fixing it I realised that the sourc-location of any such error message was bogus, so I fixed that too, which involved a slightly wider change; see the comments with TcMethInfo.
* Kill some varEnvEltsBartosz Nitka2016-07-051-7/+21
| | | | | | | I was able to hide the nondeterminism in some specialized function, which I believe will be useful in other places. GHC Trac: #4012
* CallArity: Use not . null instead of length > 0Ben Gamari2016-07-041-1/+1
| | | | | | | | | | Test Plan: Validate Reviewers: austin Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D2381
* Treat duplicate pattern synonym signatures as an errorSeraphime Kirkovski2016-07-041-0/+2
| | | | | | | | | | | | | | | | | | | | | | | Fixes issue T12165 by banning duplicate pattern synonyms signatures. This seems to me the best solution because: 1) it is coherent with the way we treat other duplicate signatures 2) the typechecker currently doesn't try to apply a second signature to a pattern to see if it matches, probably because it assumes there is no more than one signature per object. Test Plan: ./validate Reviewers: goldfire, austin, mpickering, bgamari Reviewed By: mpickering, bgamari Subscribers: mpickering, thomie Differential Revision: https://phabricator.haskell.org/D2361 GHC Trac Issues: #12165
* MkCore: Fix some note namesÖmer Sinan Ağacan2016-07-041-7/+7
|
* Kill varEnvElts in seqDmdEnvBartosz Nitka2016-07-012-3/+8
| | | | GHC Trac: #4012
* Document some benign nondeterminismBartosz Nitka2016-07-011-2/+8
|