summaryrefslogtreecommitdiff
path: root/compiler/main/CodeOutput.lhs
Commit message (Collapse)AuthorAgeFilesLines
* compiler: de-lhs main/Austin Seipp2014-12-031-255/+0
| | | | Signed-off-by: Austin Seipp <austin@well-typed.com>
* UNREG: fix PackageKey emission into .hc filesSergei Trofimovich2014-08-181-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Fixes ./configure --unable-unregisterised build failure: HC [stage 1] (one of the first calls) ... <command line>: unknown package: transformers-0.4.1.0 The reason of bug is how UNREG build stores package information in .hc files: compiler/main/CodeOutput.lhs generates first line as /* GHC_PACKAGES pkg-name-ver1 pkg-name-ver2 ... while DriverPipeline.hs (getHCFilePackages) expects /* GHC_PACKAGES pkg-key1 pkg-key2 ... Fix it by emitting ghc's PackageKey in CodeOutput Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org> Test Plan: build-tested on ./configure --enable-unregistersied Reviewers: simonmar, ezyang, austin Reviewed By: ezyang, austin Subscribers: simonmar, ezyang, carter Differential Revision: https://phabricator.haskell.org/D164
* Make PackageState an abstract type.Edward Z. Yang2014-08-051-2/+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
* Rename PackageId to PackageKey, distinguishing it from Cabal's PackageId.Edward Z. Yang2014-07-211-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Don't use showPass in the backend (#8973)Simon Marlow2014-06-081-1/+0
|
* Fix compilation of cmm files with -outputdir (Trac #9050)Yuras Shumovich2014-06-051-5/+2
|
* Add LANGUAGE pragmas to compiler/ source filesHerbert Valerio Riedel2014-05-151-0/+2
| | | | | | | | | | | | | | | | | | 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.
* Major Llvm refactoringPeter Wortmann2013-06-271-5/+1
| | | | | | | | | | | | | | | | | | | | | | This combined patch reworks the LLVM backend in a number of ways: 1. Most prominently, we introduce a LlvmM monad carrying the contents of the old LlvmEnv around. This patch completely removes LlvmEnv and refactors towards standard library monad combinators wherever possible. 2. Support for streaming - we can now generate chunks of Llvm for Cmm as it comes in. This might improve our speed. 3. To allow streaming, we need a more flexible way to handle forward references. The solution (getGlobalPtr) unifies LlvmCodeGen.Data and getHsFunc as well. 4. Skip alloca-allocation for registers that are actually never written. LLVM will automatically eliminate these, but output is smaller and friendlier to human eyes this way. 5. We use LlvmM to collect references for llvm.used. This allows places other than cmmProcLlvmGens to generate entries.
* Make the current module available to labelDynamicIan Lynagh2013-05-131-4/+4
| | | | It doesn't actually use it yet
* Remove DynFlags's hscOutName fieldIan Lynagh2013-04-261-2/+2
| | | | We now just pass the output filename as an argument instead
* Simplify away some old -dynamic-too stuff from the previous approachIan Lynagh2013-03-091-13/+5
|
* Make codeOutput and friends return the filename that they have createdIan Lynagh2013-03-021-2/+3
|
* Make codeOutput panic if hscTarget is HscInterpretedIan Lynagh2013-03-021-1/+1
| | | | | Doesn't look like it causes any failures in the full test suite, so presumably it's fine!
* Some -dynamic-too fixesIan Lynagh2013-02-211-6/+8
|
* Implement the -dynamic-too optimised path for the NCGIan Lynagh2012-12-111-3/+11
| | | | | | | | We don't yet have the slow path, for when we have to fall back to separate compilation. We also only currently handle the case qhere we're compiling Haskell code with the NCG.
* Make nativeCodeGen return the rest of its UniqSupplyIan Lynagh2012-12-061-2/+3
|
* Remove OldCmm, convert backends to consume new CmmSimon Marlow2012-11-121-2/+2
| | | | | | | | | | | | | | | | | | This removes the OldCmm data type and the CmmCvt pass that converts new Cmm to OldCmm. The backends (NCGs, LLVM and C) have all been converted to consume new Cmm. The main difference between the two data types is that conditional branches in new Cmm have both true/false successors, whereas in OldCmm the false case was a fallthrough. To generate slightly better code we occasionally need to invert a conditional to ensure that the branch-not-taken becomes a fallthrough; this was previously done in CmmCvt, and it is now done in CmmContFlowOpt. We could go further and use the Hoopl Block representation for native code, which would mean that we could use Hoopl's postorderDfs and analyses for native code, but for now I've left it as is, using the old ListGraph representation for native code.
* Some alpha renamingIan Lynagh2012-10-161-1/+1
| | | | | Mostly d -> g (matching DynFlag -> GeneralFlag). Also renamed if* to when*, matching the Haskell if/when names
* Pass DynFlags down to bWordIan Lynagh2012-09-121-1/+1
| | | | | | I've switched to passing DynFlags rather than Platform, as (a) it's simpler to not have to extract targetPlatform in so many places, and (b) it may be useful to have DynFlags around in future.
* Remove "fuel", adapt to Hoopl changes, fix warningsSimon Marlow2012-07-051-13/+12
|
* Fix merge-related problemsSimon Marlow2012-07-041-2/+0
|
* Merge remote-tracking branch 'origin/master' into newcgSimon Marlow2012-07-041-7/+6
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * origin/master: (756 commits) don't crash if argv[0] == NULL (#7037) -package P was loading all versions of P in GHCi (#7030) Add a Note, copying text from #2437 improve the --help docs a bit (#7008) Copy Data.HashTable's hashString into our Util module Build fix Build fixes Parse error: suggest brackets and indentation. Don't build the ghc DLL on Windows; works around trac #5987 On Windows, detect if DLLs have too many symbols; trac #5987 Add some more Integer rules; fixes #6111 Fix PA dfun construction with silent superclass args Add silent superclass parameters to the vectoriser Add silent superclass parameters (again) Mention Generic1 in the user's guide Make the GHC API a little more powerful. tweak llvm version warning message New version of the patch for #5461. Fix Word64ToInteger conversion rule. Implemented feature request on reconfigurable pretty-printing in GHCi (#5461) ... Conflicts: compiler/basicTypes/UniqSupply.lhs compiler/cmm/CmmBuildInfoTables.hs compiler/cmm/CmmLint.hs compiler/cmm/CmmOpt.hs compiler/cmm/CmmPipeline.hs compiler/cmm/CmmStackLayout.hs compiler/cmm/MkGraph.hs compiler/cmm/OldPprCmm.hs compiler/codeGen/CodeGen.lhs compiler/codeGen/StgCmm.hs compiler/codeGen/StgCmmBind.hs compiler/codeGen/StgCmmLayout.hs compiler/codeGen/StgCmmUtils.hs compiler/main/CodeOutput.lhs compiler/main/HscMain.hs compiler/nativeGen/AsmCodeGen.lhs compiler/simplStg/SimplStg.lhs
| * Remove lots of commented out 'in' keywordsIan Lynagh2012-06-131-1/+0
| |
| * Pass DynFlags down to showSDocIan Lynagh2012-06-121-2/+2
| |
| * Pass DynFlags to the LogActionIan Lynagh2012-06-111-1/+1
| | | | | | | | | | | | | | A side-effect is that we can no longer use the LogAction in defaultErrorHandler, as we don't have DynFlags at that point. But all that defaultErrorHandler did is to print Strings as SevFatal, so now it takes a 'FatalMessager' instead.
| * Replace printDump with a new SeverityIan Lynagh2012-05-291-2/+3
| | | | | | | | | | | | We now use log_action with severity SevDump, rather than calling printDump. This means that what happens to dumped info is now under the control of the GHC API user, rather than always going to stdout.
| * Replace createDirectoryHierarchy with createDirectoryIfMissing TrueTakano Akio2012-02-271-2/+1
| | | | | | | | | | | | createDirectoryHierarchy consisted of an existence test followed by createDirectory, which failed if that directory was creted just after the test. createDirectoryifMissing does not have this problem.
* | Merge remote-tracking branch 'origin/master' into newcgSimon Marlow2012-02-131-60/+53
|\ \ | |/ | | | | | | | | | | | | Conflicts: compiler/cmm/CmmLint.hs compiler/cmm/OldCmm.hs compiler/codeGen/CgMonad.lhs compiler/main/CodeOutput.lhs
| * Tabs -> SpacesDavid Terei2012-01-161-87/+74
| |
* | Run the complete backend (Stg -> .S) incrementally on each StgBindingSimon Marlow2012-01-261-25/+37
| | | | | | | | | | | | | | | | | | This is so that we can process the Stg code in constant space. Before we were generating all the C-- up front, leading to a large space leak. I haven't converted the LLVM or C back ends to the incremental scheme, but it's not hard to do.
* | More codegen refactoring with simonpjSimon Marlow2011-12-191-1/+1
|/
* Add SCC for LLVM code outputDavid Terei2011-12-031-1/+3
|
* 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.
* Renaming onlySimon Peyton Jones2011-08-251-5/+5
| | | | | CmmTop -> CmmDecl CmmPgm -> CmmGroup
* Snapshot of codegen refactoring to share with simonpjSimon Marlow2011-08-251-5/+5
|
* More work towards cross-compilationIan Lynagh2011-07-151-1/+1
| | | | | | | | | | | | There's now a variant of the Outputable class that knows what platform we're targetting: class PlatformOutputable a where pprPlatform :: Platform -> a -> SDoc pprPlatformPrec :: Platform -> Rational -> a -> SDoc and various instances have had to be converted to use that class, and we pass Platform around accordingly.
* Remove very dead Java backend code.David Terei2011-05-311-32/+0
|
* Ignore requests to use backends that aren't available; fixes #5145Ian Lynagh2011-05-011-2/+1
| | | | | Now if you try to use "-fasm" with an unreg compiler, for example, you just get a warning saying it's being ignored.
* Remove the OMIT_NATIVE_CODEGEN ifdefIan Lynagh2011-05-011-15/+6
| | | | | | We now test cGhcWithNativeCodeGen == "YES" instead.
* bugfix for stub generation: create the directory for the _stub.h file,Simon Marlow2011-04-081-1/+1
| | | | | not the _stub.c file, because the latter is now created as a temporary file.
* Merge _stub.o files into the main .o file (Fixes #3687 and #706)Simon Marlow2011-04-051-13/+17
| | | | | | | | | | | | | | Now GHC still generates the _stub.c files, but the object file is automatically merged into the main .o file for a module. This means that build systems (including GHC's own) no longer need to worry about looking for _stub.o files and including them when linking. I had to do lots of refactoring in DriverPipeline to make this work; now there's a monad to carry around all the information, and everything is a lot tidier. The _stub.c is now created as a temporary file and removed after compilation (unless the -keep-tmp-files flag is on).
* Merge in new code generator branch.Simon Marlow2011-01-241-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | This changes the new code generator to make use of the Hoopl package for dataflow analysis. Hoopl is a new boot package, and is maintained in a separate upstream git repository (as usual, GHC has its own lagging darcs mirror in http://darcs.haskell.org/packages/hoopl). During this merge I squashed recent history into one patch. I tried to rebase, but the history had some internal conflicts of its own which made rebase extremely confusing, so I gave up. The history I squashed was: - Update new codegen to work with latest Hoopl - Add some notes on new code gen to cmm-notes - Enable Hoopl lag package. - Add SPJ note to cmm-notes - Improve GC calls on new code generator. Work in this branch was done by: - Milan Straka <fox@ucw.cz> - John Dias <dias@cs.tufts.edu> - David Terei <davidterei@gmail.com> Edward Z. Yang <ezyang@mit.edu> merged in further changes from GHC HEAD and fixed a few bugs.
* Some refactoring and simplification in TcInteract.occurChecksimonpj@microsoft.com2010-10-071-2/+2
|
* Add support of TNTC to llvm backendDavid Terei2010-06-181-14/+2
| | | | | | | We do this through a gnu as feature called subsections, where you can put data/code into a numbered subsection and those subsections will be joined together in descending order by gas at compile time.
* Add new LLVM code generator to GHC. (Version 2)David Terei2010-06-151-1/+30
| | | | | | | | | | | | | | | | | | This was done as part of an honours thesis at UNSW, the paper describing the work and results can be found at: http://www.cse.unsw.edu.au/~pls/thesis/davidt-thesis.pdf A Homepage for the backend can be found at: http://hackage.haskell.org/trac/ghc/wiki/Commentary/Compiler/Backends/LLVM Quick summary of performance is that for the 'nofib' benchmark suite, runtimes are within 5% slower than the NCG and generally better than the C code generator. For some code though, such as the DPH projects benchmark, the LLVM code generator outperforms the NCG and C code generator by about a 25% reduction in run times.
* fix return type cast in f.i.wrapper when using libffi (#3516)Simon Marlow2010-03-291-0/+6
| | | | | | | | | Original fix submitted by Sergei Trofimovich <slyfox@community.haskell.org> modified by me: - exclude 64-bit types - compare uniques, not strings - #include "ffi.h" is conditional
* Follow changes in Cabal: package -> sourcePackageIdSimon Marlow2009-08-241-1/+1
|
* Remove GHC's haskell98 dependencyIan Lynagh2009-07-241-3/+4
|
* Remove unused importsIan Lynagh2009-07-071-1/+0
|
* Fix the unregisterised buildIan Lynagh2009-05-201-1/+2
|