summaryrefslogtreecommitdiff
path: root/ghc/Main.hs
Commit message (Collapse)AuthorAgeFilesLines
* Compiling with -S and -fno-code no longer panics (fixes #17143)adithyaov2019-10-161-0/+4
|
* Always enable the external interpreterJohn Ericson2019-10-041-12/+29
| | | | | | You can always just not use or even build `iserv`. I don't think the maintenance cost of the CPP is worth...I can't even tell what the benefit is.
* Refactor iface file generation:Ömer Sinan Ağacan2019-09-301-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit refactors interface file generation to allow information from the later passed (NCG, STG) to be stored in interface files. We achieve this by splitting interface file generation into two parts: * Partial interfaces, built based on the result of the core pipeline * A fully instantiated interface, which also contains the final fingerprints and can optionally contain information produced by the backend. This change is required by !1304 and !1530. -dynamic-too handling is refactored too: previously when generating code we'd branch on -dynamic-too *before* code generation, but now we do it after. (Original code written by @AndreasK in !1530) Performance ~~~~~~~~~~~ Before this patch interface files where created and immediately flushed to disk which made space leaks impossible. With this change we instead use NFData to force all iface related data structures to avoid space leaks. In the process of refactoring it was discovered that the code in the ToIface Module allocated a lot of thunks which were immediately forced when writing/forcing the interface file. So we made this module more strict to avoid creating many of those thunks. Bottom line is that allocations go down by about ~0.1% compared to master. Residency is not meaningfully different after this patch. Runtime was not benchmarked. Co-Authored-By: Andreas Klebinger <klebinger.andreas@gmx.at> Co-Authored-By: Ömer Sinan Ağacan <omer@well-typed.com>
* Use lazyness for FastString's z-encoding memoizationDaniel Gröber2019-09-091-1/+1
| | | | | | | | | | | | | | | | | | | Having an IORef in FastString to memoize the z-encoded version is unecessary because there is this amazing thing Haskell can do natively, it's called "lazyness" :) We simply remove the UNPACK and strictness annotations from the constructor field corresponding to the z-encoding, making it lazy, and store the (pure) z-encoded string there. The only complication here is 'hasZEncoding' which allows cheking if a z-encoding was computed for a given string. Since this is only used for compiler performance statistics though it's not actually necessary to have the current per-string granularity. Instead I add a global IORef counter to the FastStringTable and use unsafePerformIO to increment the counter whenever a lazy z-encoding is forced.
* Fix stage 1 warningsÖmer Sinan Ağacan2019-07-021-1/+4
|
* Refine the GHCI macro into HAVE[_{INTERNAL, EXTERNAL}]_INTERPRETERAlp Mestanogullari2019-06-111-6/+6
| | | | | | | | | | | | | | | | | As discussed in #16331, the GHCI macro, defined through 'ghci' flags in ghc.cabal.in, ghc-bin.cabal.in and ghci.cabal.in, is supposed to indicate whether GHC is built with support for an internal interpreter, that runs in the same process. It is however overloaded in a few places to mean "there is an interpreter available", regardless of whether it's an internal or external interpreter. For the sake of clarity and with the hope of more easily being able to build stage 1 GHCs with external interpreter support, this patch splits the previous GHCI macro into 3 different ones: - HAVE_INTERNAL_INTERPRETER: GHC is built with an internal interpreter - HAVE_EXTERNAL_INTERPRETER: GHC is built with support for external interpreters - HAVE_INTERPRETER: HAVE_INTERNAL_INTERPRETER || HAVE_EXTERNAL_INTERPRETER
* Update Trac ticket URLs to point to GitLabRyan Scott2019-03-151-1/+1
| | | | | This moves all URL references to Trac tickets to their corresponding GitLab counterparts.
* Remove unused importsSebastian Graf2019-02-021-2/+1
|
* Load plugins in interactive sessionChristiaan Baaij2018-11-221-5/+12
| | | | | | | | | | | | Reviewers: bgamari, tdammers Reviewed By: tdammers Subscribers: monoidal, rwbarton, carter GHC Trac Issues: #15633 Differential Revision: https://phabricator.haskell.org/D5348
* Rewrite FastString table in concurrent hashtableZejun Wu2018-10-281-19/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Reimplement global FastString table using a concurrent hashatable with fixed size segments and dynamically growing buckets instead of fixed size buckets. This addresses the problem that `mkFastString` was not linear when the total number of entries was large. Test Plan: ./validate ``` inplace/bin/ghc-stage2 --interactive -dfaststring-stats < /dev/null GHCi, version 8.7.20181005: http://www.haskell.org/ghc/ :? for help Prelude> Leaving GHCi. FastString stats: segments: 256 buckets: 16384 entries: 7117 largest segment: 64 smallest segment: 64 longest bucket: 5 has z-encoding: 0% ``` Also comapre the two implementation using {P187} The new implementation is on a par with the old version with different conbination of parameters and perform better when the number of FastString's are large. {P188} Reviewers: simonmar, bgamari, niteria Reviewed By: simonmar, bgamari Subscribers: rwbarton, carter GHC Trac Issues: #14854 Differential Revision: https://phabricator.haskell.org/D5211
* GHC doesn't handle ./ prefixed paths correctly (#12674)roland2018-07-301-3/+17
| | | | | | | | | | | | | | | | Summary: If a filename starts with a hypen, GHC keeps the prefixed "./" path. Test Plan: make test TEST=T12674 Reviewers: Phyx, nomeata, bgamari, erikd Reviewed By: Phyx Subscribers: rwbarton, thomie, carter GHC Trac Issues: #12674 Differential Revision: https://phabricator.haskell.org/D5009
* Modifications to support loading GHC into GHCiMichael Sloan2018-07-271-0/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This change was previously part of [D4904](https://phabricator.haskell.org/D4904), but is being split off to aid in getting this reviewed and merged. * The compiler code is built with `NoImplicitPrelude`, but GHCi's modules are incompatible with it. So, this adds the pragma to all GHCi modules that didn't have it, and adds imports of Prelude. * In order to run GHC within itself, a `call of 'initGCStatistics` needed to be skipped. This uses CPP to skip it when `-DGHC_LOADED_INTO_GHCI` is set. * There is an environment variable workaround suggested by Ben Gamari [1], where `_GHC_TOP_DIR` can be used to specify GHC's top dir if `-B` isn't provided. This can be used to solve a problem where the GHC being run within GHCi attempts to look in `inplace/lib/lib/` instead of `inplace/lib/`. [1]: https://phabricator.haskell.org/D4904#135438 Reviewers: goldfire, bgamari, erikd, alpmestan Reviewed By: alpmestan Subscribers: alpmestan, lelf, rwbarton, thomie, carter Differential Revision: https://phabricator.haskell.org/D4986
* ghc-pkg: Configure handle encodingsBen Gamari2018-05-131-12/+2
| | | | | | | | | | | | | | | | | | This fixes #15021 using a the same approach as was used to fix the issue in ghc (#10762). Test Plan: Validate on Windows as user whose username contains non-ASCII characters Reviewers: simonmar Reviewed By: simonmar Subscribers: lehins, thomie, carter GHC Trac Issues: #15021 Differential Revision: https://phabricator.haskell.org/D4642
* Allow users to ignore optimization changesDavid Feuer2017-12-111-3/+9
| | | | | | | | | | | | | | | | | | | | * Add a new flag, `-fignore-optim-changes`, allowing them to avoid recompilation if the only changes are to the `-O` level or to flags controlling optimizations. * When `-fignore-optim-changes` is *off*, recompile when optimization flags (e.g., `-fno-full-laziness`) change. Previously, we ignored these unconditionally when deciding whether to recompile a module. Reviewers: austin, bgamari, simonmar Reviewed By: simonmar Subscribers: duog, carter, simonmar, rwbarton, thomie GHC Trac Issues: #13604 Differential Revision: https://phabricator.haskell.org/D4123
* Catch a few more typos in commentsGabor Greif2017-10-301-1/+1
|
* Reexport Semigroup's <> operator from Prelude (#14191)Herbert Valerio Riedel2017-09-221-1/+1
| | | | | | | This completes the 2nd phase of the Semigroup=>Monoid Proposal (SMP) initiated in 8ae263ceb3566a7c82336400b09cb8f381217405. This updates a couple submodules to address <> naming clashes.
* Make -w less aggressive (Trac #12056)Sean Gillespie2017-06-121-4/+4
| | | | | | | | | | | | | | | Previously -w combined with -Wunrecognised-warning-flags would not report unrecognized flags. Reviewers: austin, bgamari, dfeuer Reviewed By: bgamari Subscribers: dfeuer, rwbarton, thomie GHC Trac Issues: #12056 Differential Revision: https://phabricator.haskell.org/D3581
* Pass -ffrontend-opt arguments to frontend plugin in the correct orderdoug2017-05-041-1/+2
| | | | | | | | | | | | | | | | | | | Previously they were passed in the reverse order that they're specified on the command line. Add a haddock to frontendPluginOpts in DynFlags.hs. Modify test frontend01 to cover the case of multiple -ffrontend-opt. Reviewers: austin, bgamari Reviewed By: bgamari Subscribers: rwbarton, thomie GHC Trac Issues: #13632 Differential Revision: https://phabricator.haskell.org/D3520
* Prefer #if defined to #ifdefBen Gamari2017-04-281-6/+6
| | | | Our new CPP linter enforces this.
* Have --backpack complain if multiple files are passed.Edward Z. Yang2017-02-231-6/+6
| | | | | | | | | | | | | | | Summary: At the moment it silently swallows the actual arguments; not good! Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu> Test Plan: validate Reviewers: rwbarton, bgamari, austin Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D3173
* Ditch static flagsSylvain Henry2017-02-021-19/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | This patch converts the 4 lasting static flags (read from the command line and unsafely stored in immutable global variables) into dynamic flags. Most use cases have been converted into reading them from a DynFlags. In cases for which we don't have easy access to a DynFlags, we read from 'unsafeGlobalDynFlags' that is set at the beginning of each 'runGhc'. It's not perfect (not thread-safe) but it is still better as we can set/unset these 4 flags before each run when using GHC API. Updates haddock submodule. Rebased and finished by: bgamari Test Plan: validate Reviewers: goldfire, erikd, hvr, austin, simonmar, bgamari Reviewed By: simonmar Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D2839 GHC Trac Issues: #8440
* Improve suggestion for misspelled flag including '=' (fixes #11789)Daishi Nakajima2017-01-181-1/+10
| | | | | | | | | | | | | | | | | | | | | Test Plan: Added 2 test cases, verified that ghc can suggest in the following cases: - for misspelled flag containing '=', ghc suggests flags that doesn't contain '=' - for misspelled flag containing '=', ghc suggests flags that contains '=' Reviewers: austin, dfeuer, bgamari Reviewed By: dfeuer, bgamari Subscribers: dfeuer, mpickering, thomie Differential Revision: https://phabricator.haskell.org/D2978 GHC Trac Issues: #11789
* ghc/Main.hs: Add import list to DynamicLoadingÖmer Sinan Ağacan2016-10-181-1/+1
|
* Clean up handling of known-key Names in interface filesBen Gamari2016-10-131-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously BinIface had some dedicated logic for handling tuple names in the symbol table. As it turns out, this logic was essentially dead code as it was superceded by the special handling of known-key things. Here we cull the tuple code-path and use the known-key codepath for all tuple-ish things. This had a surprising number of knock-on effects, * constraint tuple datacons had to be made known-key (previously they were not) * IfaceTopBndr was changed from being a synonym of OccName to a synonym of Name (since we now need to be able to deserialize Names directly from interface files) * the change to IfaceTopBndr complicated fingerprinting, since we need to ensure that we don't go looking for the fingerprint of the thing we are currently fingerprinting in the fingerprint environment (see notes in MkIface). Handling this required distinguishing between binding and non-binding Name occurrences in the Binary serializers. * the original name cache logic which previously lived in IfaceEnv has been moved to a new NameCache module * I ripped tuples and sums out of knownKeyNames since they introduce a very large number of entries. During interface file deserialization we use static functions (defined in the new KnownUniques module) to map from a Unique to a known-key Name (the Unique better correspond to a known-key name!) When we need to do an original name cache lookup we rely on the parser implemented in isBuiltInOcc_maybe. * HscMain.allKnownKeyNames was folded into PrelInfo.knownKeyNames. * Lots of comments were sprinkled about describing the new scheme. Updates haddock submodule. Test Plan: Validate Reviewers: niteria, simonpj, austin, hvr Reviewed By: simonpj Subscribers: simonmar, niteria, thomie Differential Revision: https://phabricator.haskell.org/D2467 GHC Trac Issues: #12532, #12415
* Distinguish between UnitId and InstalledUnitId.Edward Z. Yang2016-10-081-2/+2
| | | | Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu>
* The Backpack patch.Edward Z. Yang2016-10-081-5/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This patch implements Backpack for GHC. It's a big patch but I've tried quite hard to keep things, by-in-large, self-contained. The user facing specification for Backpack can be found at: https://github.com/ezyang/ghc-proposals/blob/backpack/proposals/0000-backpack.rst A guide to the implementation can be found at: https://github.com/ezyang/ghc-proposals/blob/backpack-impl/proposals/0000-backpack-impl.rst Has a submodule update for Cabal, as well as a submodule update for filepath to handle more strict checking of cabal-version. Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu> Test Plan: validate Reviewers: simonpj, austin, simonmar, bgamari, goldfire Subscribers: thomie, mpickering Differential Revision: https://phabricator.haskell.org/D1482
* Annotate initIfaceCheck with usage information.Edward Z. Yang2016-08-211-1/+1
| | | | Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu>
* Driver: `ghc ../Test` (without file extension) should workThomas Miedema2016-06-181-2/+2
| | | | | | | | Reviewed by: bgamari Differential Revision: https://phabricator.haskell.org/D2331 GHC Trac Issues: #12192
* Abort the build when a Core plugin pass is specified in stage1 compilerÖmer Sinan Ağacan2016-06-171-2/+3
| | | | | | | | | | | | | | | | | | | This also makes the behavior the same with frontend plugin errors -- frontend was failing with an exception (`CmdLineError`) while the simplifier was just ignoring plugins. Now we abort with `CmdLineError` in both cases with a slightly improved error message. Test Plan: - add tests (will add tests once #12197 is implemented) - validate (done) Reviewers: austin, bgamari Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D2334 GHC Trac Issues: #11690
* compiler: Do not suggest nor complete deprecated flags fix trac issue #11454Nikita Kartashov2016-02-111-1/+1
| | | | | | | | | | | | | | Previously, all flags were present in user suggest and completion. This commit removes the deprecated ones from there. It is done by saving deprecation info at the moment of flag definition. Reviewers: rwbarton, austin, bgamari Reviewed By: bgamari Subscribers: rwbarton, thomie Differential Revision: https://phabricator.haskell.org/D1883
* Export some useful GHC API functions.Edward Z. Yang2015-12-291-7/+1
| | | | | | | | | | | | | | | | | | Working on some code using the GHC API, I found these functions were useful and wished they were exported. This commit exports them. Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu> Test Plan: validate Reviewers: austin, bgamari Reviewed By: bgamari Subscribers: hvr, thomie Differential Revision: https://phabricator.haskell.org/D1710
* ghc/Main: Update list of --print modesBen Gamari2015-12-291-2/+2
| | | | | | | | | | | | | | Test Plan: Validate Reviewers: austin, hvr Reviewed By: hvr Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D1712 GHC Trac Issues: #9614
* Rename GHCi's UI modules into GHCi.UI(.*)Herbert Valerio Riedel2015-12-211-1/+1
| | | | | | | | | | | | Further work refactoring and enhancing GHCi will make it desirable to split up GHCi's code-base into multiple modules with specific functions, and rather than have several top-level 'Ghci*' modules, it's nicer to have a common namespace. This commit is provides the basis for that. Note that the remaining GHCi.* namespace belongs to the new `ghci` package. Differential Revision: https://phabricator.haskell.org/D1593
* Remote GHCi, -fexternal-interpreterSimon Marlow2015-12-171-23/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: (Apologies for the size of this patch, I couldn't make a smaller one that was validate-clean and also made sense independently) (Some of this code is derived from GHCJS.) This commit adds support for running interpreted code (for GHCi and TemplateHaskell) in a separate process. The functionality is experimental, so for now it is off by default and enabled by the flag -fexternal-interpreter. Reaosns we want this: * compiling Template Haskell code with -prof does not require building the code without -prof first * when GHC itself is profiled, it can interpret unprofiled code, and the same applies to dynamic linking. We would no longer need to force -dynamic-too with TemplateHaskell, and we can load ordinary objects into a dynamically-linked GHCi (and vice versa). * An unprofiled GHCi can load and run profiled code, which means it can use the stack-trace functionality provided by profiling without taking the performance hit on the compiler that profiling would entail. Amongst other things; see https://ghc.haskell.org/trac/ghc/wiki/RemoteGHCi for more details. Notes on the implementation are in Note [Remote GHCi] in the new module compiler/ghci/GHCi.hs. It probably needs more documenting, feel free to suggest things I could elaborate on. Things that are not currently implemented for -fexternal-interpreter: * The GHCi debugger * :set prog, :set args in GHCi * `recover` in Template Haskell * Redirecting stdin/stdout for the external process These are all doable, I just wanted to get to a working validate-clean patch first. I also haven't done any benchmarking yet. I expect there to be slight hit to link times for byte code and some penalty due to having to serialize/deserialize TH syntax, but I don't expect it to be a serious problem. There's also lots of low-hanging fruit in the byte code generator/linker that we could exploit to speed things up. Test Plan: * validate * I've run parts of the test suite with EXTRA_HC_OPTS=-fexternal-interpreter, notably tests/ghci and tests/th. There are a few failures due to the things not currently implemented (see above). Reviewers: simonpj, goldfire, ezyang, austin, alanz, hvr, niteria, bgamari, gibiansky, luite Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D1562
* Frontend plugins.Edward Z. Yang2015-12-121-0/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Frontend plugins enable users to write plugins to replace GHC major modes. E.g. instead of saying ghc --make A B C a user can now say ghc --frontend GHC.Frontend.Shake A B C which might provide an alternative implementation of a multi-module build. For more details, see the manual entry. Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu> Test Plan: validate Reviewers: simonmar, bgamari, austin, simonpj Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D1598 GHC Trac Issues: #11194
* Revert "Unify hsig and hs-boot; add preliminary "hs-boot" merging."Edward Z. Yang2015-11-161-17/+2
| | | | | | | | | | | | | | | Summary: This reverts commit 06d46b1e4507e09eb2a7a04998a92610c8dc6277. This also has a Haddock submodule update. Test Plan: validate Reviewers: simonpj, austin, bgamari Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D1475
* Make it possible to have different UniqSupply strategiesBartosz Nitka2015-10-271-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | To get reproducible/deterministic builds, the way that the Uniques are assigned shouldn't matter. This allows to test for that. It add 2 new flags: * `-dinitial-unique` * `-dunique-increment` And by varying these you can get interesting effects: * `-dinitial-unique=0 -dunique-increment 1` - current sequential UniqSupply * `-dinitial-unique=16777215 -dunique-increment -1` - UniqSupply that generates in decreasing order * `-dinitial-unique=1 -dunique-increment PRIME` - where PRIME big enough to overflow often - nonsequential order I haven't proven the usefullness of the last one yet and it's the reason why we have to mask the bits with `0xFFFFFF` in `genSym`, so I can remove it if it becomes contentious. Test Plan: validate on harbormaster Reviewers: simonmar, austin, ezyang, bgamari Reviewed By: austin, bgamari Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D1360 GHC Trac Issues: #4012
* Driver: `ghci -e` should behave like `ghc -e` (#9360)Thomas Miedema2015-10-191-0/+13
| | | | | | | | Patch by lukyanov. Reviewed by: bgamari Differential Revision: https://phabricator.haskell.org/D1337
* Rename package key to unit ID, and installed package ID to component ID.Edward Z. Yang2015-10-141-2/+2
| | | | | | Comes with Haddock submodule update. Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu>
* Fix error msg: ghci can't be used with -prof or -static (#10936)Thomas Miedema2015-10-101-1/+1
| | | | | | Reviewed by: austin Differential Revision: https://phabricator.haskell.org/D1314
* Unify hsig and hs-boot; add preliminary "hs-boot" merging.Edward Z. Yang2015-09-211-2/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch drops the file level distinction between hs-boot and hsig; we figure out which one we are compiling based on whether or not there is a corresponding hs file lying around. To make the "import A" syntax continue to work for bare hs-boot files, we also introduce hs-boot merging, which takes an A.hi-boot and converts it to an A.hi when there is no A.hs file in scope. This will be generalized in Backpack to merge multiple A.hi files together; which means we can jettison the "load multiple interface files" functionality. This works automatically for --make, but for one-shot compilation we need a new mode: ghc --merge-requirements A will generate an A.hi/A.o from a local A.hi-boot file; Backpack will extend this mechanism further. Has Haddock submodule update to deal with change in msHsFilePath behavior. - This commit drops support for the hsig extension. Can we support it? It's annoying because the finder code is written with the assumption that where there's an hs-boot file, there's always an hs file too. To support hsig, you'd have to probe two locations. Easier to just not support it. - #10333 affects us, modifying an hs-boot still doesn't trigger recomp. - See compiler/main/Finder.hs: this diff is very skeevy, but it seems to work. - This code cunningly doesn't drop hs-boot files from the "drop hs-boot files" module graph, if they don't have a corresponding hs file. I have no idea if this actually is useful. Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu> Test Plan: validate Reviewers: simonpj, austin, bgamari, spinda Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D1098
* Revert "Revert "Revert "Support for multiple signature files in scope."""Edward Z. Yang2015-09-211-3/+2
| | | | This reverts commit 214596de224afa576a9c295bcf53c6941d6892e0.
* Respect GHC_CHARENC environment variable #10762Michael Snoyman2015-08-291-2/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Only supports UTF-8 as a value right now. I expect some discussion to go on around the naming of this variable and whether it's valid to backport it to GHC 7.10 (which would be my preference). The motivation here is that, when capturing the output of GHC to a file, we often want to ensure that the output is UTF-8, regardless of the actual character encoding of the terminal/console. On the other hand, we don't want to necessary change the terminal/console encoding. The reason being: * On Windows, this requires a global-esque change to the console codepage, which adversely affects other processes in the same console * On all OSes, this can break features like smart quote auto-detection. Test Plan: Set LANG to C, GHC_CHARENC to UTF-8, and compile a Haskell source file with a non-ASCII warning produced. The output who include the UTF-8 sequence instead of replacing it with ?. Reviewers: austin, rwbarton, bgamari Reviewed By: bgamari Subscribers: hsyl20, thomie Differential Revision: https://phabricator.haskell.org/D1167 GHC Trac Issues: #10762
* Transliterate unknown characters at outputMichael Snoyman2015-08-181-0/+3
| | | | | | | | | | | | | | | | | | | This avoids the compiler from crashing when, for example, a warning contains a non-Latin identifier and the LANG variable is set to C. Fixes #6037. Test Plan: Create a Haskell source file containing an identifier with non-Latin characters and no type signature. Compile with `LANG=C ghc -Wall foo.hs`, and it should fail. With this patch, it will succeed. Reviewers: austin, rwbarton, bgamari Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D1153 GHC Trac Issues: #6037, #10762
* Revert "Revert "Support for multiple signature files in scope.""Edward Z. Yang2015-07-201-2/+3
| | | | | | | This reverts commit bac927b9770ff769128b66d13a3e72bf5a9bc514. As it turns out, we need these commits for separate compilation and accurate dependency tracking. So back in they go!
* Revert "Support for multiple signature files in scope."Edward Z. Yang2015-06-111-3/+2
| | | | This reverts commit a7524eaed33324e2155c47d4a705bef1d70a2b5b.
* Support for multiple signature files in scope.Edward Z. Yang2015-04-071-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: A common pattern when programming with signatures is to combine multiple signatures together (signature linking). We achieve this by making it not-an-error to have multiple, distinct interface files for the same module name, as long as they have the same backing implementation. When a user imports a module name, they get ALL matching signatures dumped into their scope. On the way, I refactored the module finder code, which now distinguishes between exact finds (when you had a 'Module') and regular finds (when you had a 'ModuleName'). I also refactored the package finder code to use a Monoid instance on LookupResult to collect together various results. ToDo: At the moment, if a signature is declared in the local package, it completely overrides any remote signatures. Eventually, we'll want to also pull in the remote signatures (or even override the local signature, if the full implementation is available.) There are bunch of ToDos in the code for what to do once this is done. ToDo: At the moment, whenever a module name lookup occurs in GHCi and we would have seen a signature, we instead continue and return the Module for the backing implementation. This is correct for most cases, but there might be some situations where we want something a little more fine-grained (e.g. :browse should only list identifiers which are available through the in-scope signatures, and not ALL of them.) Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu> Test Plan: validate Reviewers: simonpj, hvr, austin Subscribers: carter, thomie Differential Revision: https://phabricator.haskell.org/D790 GHC Trac Issues: #9252
* Change which files --make thinks are 'Haskellish' (#10220)Thomas Miedema2015-04-011-1/+1
| | | | | | | | | | | | | | | | `.hspp` and `.hscpp` are haskell files that have already been preprocessed. Treat `.hspp` and `.hscpp` as Haskellish sources again, as they were before commit a10e1990. This way, ghc --make will load their imports. Make sure that `.cmm` and `.cmmcpp` are still not treated as Haskellish, by moving them out of `haskell_src_suffixes` (but still keeping them in haskellish_suffixes, though I'm not sure what the purpose of that group is). Reviewed By: austin Differential Revision: https://phabricator.haskell.org/D778
* Explicitly check for -C on registerised build (#7563)Thomas Miedema2015-03-311-1/+6
| | | | | | | | Show a more descriptive error message. Reviewed By: austin Differential Revision: https://phabricator.haskell.org/D775
* Rename C(obj)cplusplus to C(obj)cxxThomas Miedema2015-03-281-1/+1
| | | | | | Reviewed By: kgardas Differential Revision: https://phabricator.haskell.org/D763