summaryrefslogtreecommitdiff
path: root/compiler/ghci
Commit message (Collapse)AuthorAgeFilesLines
* Fix a couple of bugs in the way info tables are generated for 64-bit platformsSimon Marlow2014-11-052-15/+25
| | | | | | | | | | 1. The offset was a full word, but it should actually be a 32-bit offset on 64-bit platforms. 2. The con_desc string was allocated separately, which meant that it might be out of range for a 32-bit offset. These bugs meant that +RTS -Di (interpreter debugging) would sometimes crash on 64-bit.
* Simplify the API for tcInstTyVars, and make it more consistent with other ↵Simon Peyton Jones2014-11-041-5/+5
| | | | similar functions
* Some refactoring around endPass and debug dumpingSimon Peyton Jones2014-11-041-0/+1
| | | | | I forget all the details, but I spent some time trying to understand the current setup, and tried to simplify it a bit
* Convert GHCi sources from .lhs to .hsRodlogic2014-10-297-151/+93
| | | | | | | | | | | | | | Summary: Signed-off-by: Rodlogic <admin@rodlogic.net> Test Plan: Does it compile? Reviewers: hvr, austin Reviewed By: austin Subscribers: thomie, carter, simonmar Differential Revision: https://phabricator.haskell.org/D319
* Revert "Rename _closure to _static_closure, apply naming consistently."Edward Z. Yang2014-10-201-2/+2
| | | | | | | This reverts commit 35672072b4091d6f0031417bc160c568f22d0469. Conflicts: compiler/main/DriverPipeline.hs
* Clean up and remove todo.Joel Burget2014-10-071-20/+23
| | | | | | | | | | | | | | | | Summary: The code is equivalent, just formatted nicely and without the enthusiastic message to clean it up. Test Plan: None Reviewers: austin Reviewed By: austin Subscribers: simonmar, ezyang, carter, thomie Differential Revision: https://phabricator.haskell.org/D307
* Rename _closure to _static_closure, apply naming consistently.Edward Z. Yang2014-10-011-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: In preparation for indirecting all references to closures, we rename _closure to _static_closure to ensure any old code will get an undefined symbol error. In order to reference a closure foobar_closure (which is now undefined), you should instead use STATIC_CLOSURE(foobar). For convenience, a number of these old identifiers are macro'd. Across C-- and C (Windows and otherwise), there were differing conventions on whether or not foobar_closure or &foobar_closure was the address of the closure. Now, all foobar_closure references are addresses, and no & is necessary. CHARLIKE/INTLIKE were not changed, simply alpha-renamed. Part of remove HEAP_ALLOCED patch set (#8199) Depends on D265 Signed-off-by: Edward Z. Yang <ezyang@mit.edu> Test Plan: validate Reviewers: simonmar, austin Subscribers: simonmar, ezyang, carter, thomie Differential Revision: https://phabricator.haskell.org/D267 GHC Trac Issues: #8199
* Extend `Foldable` class with `length` and `null` methodsHerbert Valerio Riedel2014-09-281-1/+1
| | | | | | | | | | | | | This completes the `Foldable` class by two important operations which this way can be optimised for the underlying structure more easily. A minor fix for the `containers` submodule was needed to due name clash Addresses #9621 Reviewed By: ekmett, dfeuer, austin Differential Revision: https://phabricator.haskell.org/D250
* `M-x delete-trailing-whitespace` & `M-x untabify`Herbert Valerio Riedel2014-09-241-1/+1
|
* Export `Monoid(..)`/`Foldable(..)`/`Traversable(..)` from PreludeHerbert Valerio Riedel2014-09-211-0/+2
| | | | | | | | | | | | | | | This finally exposes also the methods of these 3 classes in the Prelude in order to allow to define basic class instances w/o needing imports. This almost completes the primary goal of #9586 NOTE: `fold`, `foldl'`, `foldr'`, and `toList` are not exposed yet, as they require upstream fixes for at least `containers` and `bytestring`, and are not required for defining basic instances. Reviewed By: ekmett, austin Differential Revision: https://phabricator.haskell.org/D236
* Change linker message verbosity to `-v2` (re #7863)Herbert Valerio Riedel2014-09-201-1/+1
| | | | | | | | | | | | | | | | With this change, the linker status logging output such as Loading package ghc-prim ... linking ... done. Loading package integer-gmp ... linking ... done. Loading package base ... linking ... done. is suppressed unless verbosity level is `-v2` or higher. This is done to reduce the compiler message noise when TH is involved, which can reduce the visibiliy of compile warnings. Reviewed By: ekmett, austin Differential Revision: https://phabricator.haskell.org/D232
* Add the ability to :set -l{foo} in ghci, fix #1407.archblob2014-09-161-9/+20
| | | | | | | | | | | | | | | | | | Summary: The dynamic linking code was already there but it was not called on flag changes in ghci. Test Plan: validate Reviewers: hvr, simonmar, austin Reviewed By: austin Subscribers: simonmar, ezyang, carter Differential Revision: https://phabricator.haskell.org/D194 GHC Trac Issues: #1407
* Make Applicative a superclass of MonadAustin Seipp2014-09-092-0/+4
| | | | | | | | | | | | | | | | | | | | | Summary: This includes pretty much all the changes needed to make `Applicative` a superclass of `Monad` finally. There's mostly reshuffling in the interests of avoid orphans and boot files, but luckily we can resolve all of them, pretty much. The only catch was that Alternative/MonadPlus also had to go into Prelude to avoid this. As a result, we must update the hsc2hs and haddock submodules. Signed-off-by: Austin Seipp <austin@well-typed.com> Test Plan: Build things, they might not explode horribly. Reviewers: hvr, simonmar Subscribers: simonmar Differential Revision: https://phabricator.haskell.org/D13
* Fix validation error in Linker arising from package rep changesDuncan Coutts2014-08-291-1/+1
|
* Fix long lines and trailing whitespaceDuncan Coutts2014-08-291-3/+7
| | | | in the previous patches in this series
* Use ghc-local types for packages, rather than Cabal typesDuncan Coutts2014-08-291-5/+3
| | | | | | | | Also start using the new package db file format properly, by using the ghc-specific section. This is the main patch in the series for removing the compiler's dep on the Cabal lib.
* build: require GHC 7.6 for bootstrappingAustin Seipp2014-08-191-4/+0
| | | | | | | | | | | | | | | | | | | | | | Summary: Per the usual standards, a build of GHC is only compileable by the last two releases (e.g. 7.8 only by 7.4 and 7.6). To make sure we don't get suckered into supporting older compilers, let's remove this support now. Signed-off-by: Austin Seipp <austin@well-typed.com> Test Plan: Try to bootstrap with GHC 7.4, watch it fail. Bootstrap with 7.6 or better, and everything works. Reviewers: hvr Reviewed By: hvr Subscribers: simonmar, ezyang, carter Differential Revision: https://phabricator.haskell.org/D167
* Make PackageState an abstract type.Edward Z. Yang2014-08-051-7/+2
| | | | | | | | | | | | Summary: Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu> Test Plan: validate Reviewers: simonpj, simonmar, hvr, austin Subscribers: simonmar, relrod, ezyang, carter Differential Revision: https://phabricator.haskell.org/D107
* Package keys (for linking/type equality) separated from package IDs.Edward Z. Yang2014-08-051-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch set makes us no longer assume that a package key is a human readable string, leaving Cabal free to "do whatever it wants" to allocate keys; we'll look up the PackageId in the database to display to the user. This also means we have a new level of qualifier decisions to make at the package level, and rewriting some Safe Haskell error reporting code to DTRT. Additionally, we adjust the build system to use a new ghc-cabal output Make variable PACKAGE_KEY to determine library names and other things, rather than concatenating PACKAGE/VERSION as before. Adds a new `-this-package-key` flag to subsume the old, erroneously named `-package-name` flag, and `-package-key` to select packages by package key. RFC: The md5 hashes are pretty tough on the eye, as far as the file system is concerned :( ToDo: safePkg01 test had its output updated, but the fix is not really right: the rest of the dependencies are truncated due to the fact the we're only grepping a single line, but ghc-pkg is wrapping its output. ToDo: In a later commit, update all submodules to stop using -package-name and use -this-package-key. For now, we don't do it to avoid submodule explosion. Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu> Test Plan: validate Reviewers: simonpj, simonmar, hvr, austin Subscribers: simonmar, relrod, carter Differential Revision: https://phabricator.haskell.org/D80
* Rename PackageId to PackageKey, distinguishing it from Cabal's PackageId.Edward Z. Yang2014-07-213-16/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Previously, both Cabal and GHC defined the type PackageId, and we expected them to be roughly equivalent (but represented differently). This refactoring separates these two notions. A package ID is a user-visible identifier; it's the thing you write in a Cabal file, e.g. containers-0.9. The components of this ID are semantically meaningful, and decompose into a package name and a package vrsion. A package key is an opaque identifier used by GHC to generate linking symbols. Presently, it just consists of a package name and a package version, but pursuant to #9265 we are planning to extend it to record other information. Within a single executable, it uniquely identifies a package. It is *not* an InstalledPackageId, as the choice of a package key affects the ABI of a package (whereas an InstalledPackageId is computed after compilation.) Cabal computes a package key for the package and passes it to GHC using -package-name (now *extremely* misnamed). As an added bonus, we don't have to worry about shadowing anymore. As a follow on, we should introduce -current-package-key having the same role as -package-name, and deprecate the old flag. This commit is just renaming. The haddock submodule needed to be updated. Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu> Test Plan: validate Reviewers: simonpj, simonmar, hvr, austin Subscribers: simonmar, relrod, carter Differential Revision: https://phabricator.haskell.org/D79 Conflicts: compiler/main/HscTypes.lhs compiler/main/Packages.lhs utils/haddock
* ghci: detabify/unwhitespace ByteCodeInstrAustin Seipp2014-07-201-92/+84
| | | | Signed-off-by: Austin Seipp <austin@well-typed.com>
* ghci: detabify/unwhitespace ByteCodeGenAustin Seipp2014-07-201-15/+8
| | | | Signed-off-by: Austin Seipp <austin@well-typed.com>
* ghci: detabify/dewhitespace RtClosureInspectAustin Seipp2014-07-201-89/+81
| | | | Signed-off-by: Austin Seipp <austin@well-typed.com>
* add support for x86_64-solaris2 platformKarel Gardas2014-07-131-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | Summary: this set of patches adds support for x86_64-solaris2 platform Solaris is multi-lib platform which means it provides 32bit user-land together with 32bit and 64bit libraries. The 32bit libraries are located in <somewhere>/lib directories while 64bit libraries are located in <somewhere>/lib/64 directories. This is why GHCi required the fix since otherwise it'll attempt to load /usr/lib/libgmp.so which is 32bit library into 64bit binary process space (GHCi). This of course fails with wrong ELFCLASS32 error message. Another issue was that by default GNU C distributed with Solaris compiles into 32bit binary. We need to enforce compilation to 64bit binary by adding appropriate -m64 option. Test Plan: already built on x86_64-solaris2 Reviewers: austin Reviewed By: austin Subscribers: phaskell, simonmar, relrod, carter Differential Revision: https://phabricator.haskell.org/D68
* Revert "Fix obscure problem with using the system linker (#8935)"Austin Seipp2014-06-301-49/+23
| | | | | | This reverts commit 2f8b4c9330b455d4cb31c186c747a7db12a69251. Signed-off-by: Austin Seipp <austin@well-typed.com>
* Fix obscure problem with using the system linker (#8935)Simon Marlow2014-06-081-23/+49
| | | | See Note [RTLD_LOCAL] for a summary of the problem and solution, and
* Add LANGUAGE pragmas to compiler/ source filesHerbert Valerio Riedel2014-05-159-10/+25
| | | | | | | | | | | | | | | | | | In some cases, the layout of the LANGUAGE/OPTIONS_GHC lines has been reorganized, while following the convention, to - place `{-# LANGUAGE #-}` pragmas at the top of the source file, before any `{-# OPTIONS_GHC #-}`-lines. - Moreover, if the list of language extensions fit into a single `{-# LANGUAGE ... -#}`-line (shorter than 80 characters), keep it on one line. Otherwise split into `{-# LANGUAGE ... -#}`-lines for each individual language extension. In both cases, try to keep the enumeration alphabetically ordered. (The latter layout is preferable as it's more diff-friendly) While at it, this also replaces obsolete `{-# OPTIONS ... #-}` pragma occurences by `{-# OPTIONS_GHC ... #-}` pragmas.
* Add SmallArray# and SmallMutableArray# typesJohan Tibell2014-03-292-0/+7
| | | | | | | | | | | | | | | These array types are smaller than Array# and MutableArray# and are faster when the array size is small, as they don't have the overhead of a card table. Having no card table reduces the closure size with 2 words in the typical small array case and leads to less work when updating or GC:ing the array. Reduces both the runtime and memory allocation by 8.8% on my insert benchmark for the HashMap type in the unordered-containers package, which makes use of lots of small arrays. With tuned GC settings (i.e. `+RTS -A6M`) the runtime reduction is 15%. Fixes #8923.
* Unify, rather than match, in GND processing (fixes Trac #8865)Simon Peyton Jones2014-03-101-2/+1
| | | | | Yet another small way in which polymorphic kinds needs a bit of care See Note [Unify kinds in deriving] in TcDeriv
* Fix #8770Austin Seipp2014-02-171-1/+10
| | | | | | | | | As usual, Mac OS X is extremely annoying (or the software is, anyway), because not only does it load dynamic libraries with the .dylib extension, but also the .so extension. For whatever reason. At least it's easy to fix. Signed-off-by: Austin Seipp <austin@well-typed.com>
* Re-work the naming story for the GHCi prompt (Trac #8649)Simon Peyton Jones2014-01-092-10/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The basic idea here is simple, and described in Note [The interactive package] in HscTypes, which starts thus: Note [The interactive package] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Type and class declarations at the command prompt are treated as if they were defined in modules interactive:Ghci1 interactive:Ghci2 ...etc... with each bunch of declarations using a new module, all sharing a common package 'interactive' (see Module.interactivePackageId, and PrelNames.mkInteractiveModule). This scheme deals well with shadowing. For example: ghci> data T = A ghci> data T = B ghci> :i A data Ghci1.T = A -- Defined at <interactive>:2:10 Here we must display info about constructor A, but its type T has been shadowed by the second declaration. But it has a respectable qualified name (Ghci1.T), and its source location says where it was defined. So the main invariant continues to hold, that in any session an original name M.T only refers to oe unique thing. (In a previous iteration both the T's above were called :Interactive.T, albeit with different uniques, which gave rise to all sorts of trouble.) This scheme deals nicely with the original problem. It allows us to eliminate a couple of grotseque hacks - Note [Outputable Orig RdrName] in HscTypes - Note [interactive name cache] in IfaceEnv (both these comments have gone, because the hacks they describe are no longer necessary). I was also able to simplify Outputable.QueryQualifyName, so that it takes a Module/OccName as args rather than a Name. However, matters are never simple, and this change took me an unreasonably long time to get right. There are some details in Note [The interactive package] in HscTypes.
* Some popular typos in commentsGabor Greif2013-12-021-1/+1
|
* Fix the deugger (fixing Trac #8557)Simon Peyton Jones2013-11-281-28/+36
| | | | | | | | | | The runtime debugger (which has not received any love from anyone for many years) looks wrong to me; it was failing to instantiate the outer foralls of a variable when called from :force, which calls cvObtainTermFromId, which calls cvObtainTerm I simplified the code too. But I'm flaky on how this debugger stuff is really supposed to work, so I'm partly guessing. Tests pass though.
* Untabify buffer.Austin Seipp2013-11-221-2/+2
| | | | Signed-off-by: Austin Seipp <austin@well-typed.com>
* M-x delete-trailing-whitespaceAustin Seipp2013-11-221-5/+5
| | | | Signed-off-by: Austin Seipp <austin@well-typed.com>
* GHCi: Properly generate jump code for ARM (#8380)Austin Seipp2013-11-221-2/+21
| | | | | | | | | | | | | | | | | | | | This adds code for jumping to given addresses for ARM, written by Ben Gamari. However, when allocating new infotables for bytecode (which is where this jump code occurs), we need to be sure to flush the cache on the execute pointer returned from allocateExec() - on systems like ARM, the processor won't reliably read back code or automatically cache flush, where x86 will. So we add a new flushExec primitive to call out to GCC's __builtin___clear_cache primitive, which will properly generate the correct code (nothing on x86, and a call to libgcc's __clear_cache on ARM) and make sure we use it after writing the code out. Authored-by: Ben Gamari <bgamari.foss@gmail.com> Authored-by: Austin Seipp <austin@well-typed.com> Signed-off-by: Austin Seipp <austin@well-typed.com>
* TyposKrzysztof Gogolewski2013-10-121-1/+1
|
* Use dynamic linking only if the GHC package is compiled with -dynamic (#8376)Simon Marlow2013-10-111-7/+7
|
* Fix the bytecode genreation for tagToEnum# (Trac #8383)Simon Peyton Jones2013-10-041-42/+83
| | | | | | | Reid Barton's diagnosis was right on the mark, though the fix wasn't quite right. See Note [Implementing tagToEnum#]. As usual I did some refactoring.
* Comments onlySimon Peyton Jones2013-10-041-0/+1
|
* Improve pretty-printing of typesunknown2013-10-011-3/+2
| | | | | | | | | | | | | | | * The main change is to suppress printing (in types) of kind for-alls kind applications The new flag -fprint-explicit-kinds prints them as before (by analogy with the existing -fprint-explicit-foralls) * I also took advantage of the fact that SDoc now has access to DynFlags, to tidy up the way in which explicit for-alls are printed. Instead of passing a boolean flag around, we now simply consult the DynFlags. Much neater. I still need to add documentation for the flag
* Globally replace "hackage.haskell.org" with "ghc.haskell.org"Simon Marlow2013-10-013-3/+3
|
* Fix BCO bitmap generation on 32-bit platforms (#8377)Takano Akio2013-09-291-11/+9
| | | | | | | On 32-bit platforms, the bitmap should be an array of 32-bit words, not Word64s. Signed-off-by: Austin Seipp <austin@well-typed.com>
* Implement an unlifted Proxy type, Proxy#Austin Seipp2013-09-271-0/+1
| | | | | | | | | | | | | A value of type 'Proxy# a' can only be created through the new, primitive witness 'proxy# :: Proxy# a' - a Proxy# has no runtime representation and is thus free. This lets us clean up the internals of TypeRep, as well as Adam's future work concerning records (by using a zero-width primitive type.) Authored-by: Edward Kmett <ekmett@gmail.com> Authored-by: Austin Seipp <austin@well-typed.com> Signed-off-by: Austin Seipp <austin@well-typed.com>
* Add support for 512-bit-wide vectors.Geoffrey Mainland2013-09-221-0/+2
|
* Add support for 256-bit-wide vectors.Geoffrey Mainland2013-09-221-0/+2
|
* Restructure compilation pipeline to allow hooksAustin Seipp2013-09-224-7/+3
| | | | | | | | | | | | | | | | This commit exposes GHC's internal compiler pipeline through a `Hooks` module in the GHC API. It currently allows you to hook: * Foreign import/exports declarations * The frontend up to type checking * The one shot compilation mode * Core compilation, and the module iface * Linking and the phases in DriverPhases.hs * Quasiquotation Authored-by: Luite Stegeman <stegeman@gmail.com> Authored-by: Edsko de Vries <edsko@well-typed.com> Signed-off-by: Austin Seipp <austin@well-typed.com>
* Fix AMP warnings.Austin Seipp2013-09-112-0/+16
| | | | | Authored-by: David Luposchainsky <dluposchainsky@gmail.com> Signed-off-by: Austin Seipp <austin@well-typed.com>
* Strings and comments only: 'to to ' fixesGabor Greif2013-08-221-1/+1
| | | | I'd still prefer if a native english speaker would check them.
* Add a better implementation of dropTail, and use itSimon Peyton Jones2013-08-191-1/+1
|