This project is mirrored from https://gitlab.haskell.org/ghc/ghc.git. Pull mirroring failed .
Repository mirroring has been paused due to too many failed attempts. It can be resumed by a project maintainer.
Last successful update .
  1. 04 Mar, 2006 3 commits
  2. 02 Mar, 2006 1 commit
    • Simon Marlow's avatar
      Make -split-objs work with --make · ec968a32
      Simon Marlow authored
      This turned out to be a lot easier than I thought.  Just moving a few
      bits of -split-objs support from the build system into the compiler
      was enough.  The only thing that Cabal needs to do in order to support
      -split-objs now is to pass the names of the split objects rather than
      the monolithic ones to 'ar'.
      ec968a32
  3. 24 Feb, 2006 1 commit
  4. 06 Jan, 2006 1 commit
    • simonmar's avatar
      [project @ 2006-01-06 16:30:17 by simonmar] · 9d7da331
      simonmar authored
      Add support for UTF-8 source files
      
      GHC finally has support for full Unicode in source files.  Source
      files are now assumed to be UTF-8 encoded, and the full range of
      Unicode characters can be used, with classifications recognised using
      the implementation from Data.Char.  This incedentally means that only
      the stage2 compiler will recognise Unicode in source files, because I
      was too lazy to port the unicode classifier code into libcompat.
      
      Additionally, the following synonyms for keywords are now recognised:
      
        forall symbol 	(U+2200)	forall
        right arrow   	(U+2192)	->
        left arrow   		(U+2190)	<-
        horizontal ellipsis 	(U+22EF)	..
      
      there are probably more things we could add here.
      
      This will break some source files if Latin-1 characters are being used.
      In most cases this should result in a UTF-8 decoding error.  Later on
      if we want to support more encodings (perhaps with a pragma to specify
      the encoding), I plan to do it by recoding into UTF-8 before parsing.
      
      Internally, there were some pretty big changes:
      
        - FastStrings are now stored in UTF-8
      
        - Z-encoding has been moved right to the back end.  Previously we
          used to Z-encode every identifier on the way in for simplicity,
          and only decode when we needed to show something to the user.
          Instead, we now keep every string in its UTF-8 encoding, and
          Z-encode right before printing it out.  To avoid Z-encoding the
          same string multiple times, the Z-encoding is cached inside the
          FastString the first time it is requested.
      
          This speeds up the compiler - I've measured some definite
          improvement in parsing at least, and I expect compilations overall
          to be faster too.  It also cleans up a lot of cruft from the
          OccName interface.  Z-encoding is nicely hidden inside the
          Outputable instance for Names & OccNames now.
      
        - StringBuffers are UTF-8 too, and are now represented as
          ForeignPtrs.
      
        - I've put together some test cases, not by any means exhaustive,
          but there are some interesting UTF-8 decoding error cases that
          aren't obvious.  Also, take a look at unicode001.hs for a demo.
      9d7da331
  5. 23 Nov, 2005 1 commit
  6. 09 Nov, 2005 1 commit
  7. 08 Nov, 2005 2 commits
    • simonmar's avatar
      [project @ 2005-11-08 12:56:04 by simonmar] · 03341842
      simonmar authored
      gcc's -fstrict-aliasing is biting us when we use the stack to store
      different types of objects.  For example:
      
        *((StgDouble*)((W_)Sp-8)) = *((StgDouble*)((W_)Sp+8));
        Sp[1] = (W_)&s1Cx_info;
      
      gcc feels free to reorder these two lines, because they refer to
      differently typed objects, even though the assignment to Sp[1] clearly
      aliases the read from the same location.
      
      Trying to fix this by accessing locations using union types might be
      possible, but I took the sledgehammer approach of
      -fno-strict-aliasing.  This is justified to a certain extent because
      our generated C code is derived from a very weakly-typed internal
      language (C--).
      03341842
    • simonmar's avatar
      [project @ 2005-11-08 12:31:36 by simonmar] · 27249023
      simonmar authored
      unless I'm mistaken, only x86 needs -ffloat-store.  x86_64 certainly
      doesn't need it, because it uses SSE2 with the correct-sized floating
      point registers and doesn't store temporary results with more
      precision than results in memory.
      27249023
  8. 30 Oct, 2005 1 commit
    • krasimir's avatar
      [project @ 2005-10-30 19:12:31 by krasimir] · 6e64c691
      krasimir authored
      Change the way in which the .exe suffix to the output file is added. The reason
      is that "-o main" will generate main.exe on Windows while the doesFileExists "main"
      in DriverPipeline.link will return False.
      6e64c691
  9. 28 Oct, 2005 2 commits
    • simonmar's avatar
      [project @ 2005-10-28 15:22:39 by simonmar] · f2e730f3
      simonmar authored
      Add -stubdir option to control location of generated stub files.  Also
      do some clean up while I'm here - remove hscStubCOut/hscStubHOut from
      DynFlags, and add
      
        mkStubPaths :: DynFlags -> Module -> ModLocation -> (FilePath,FilePath)
      
      to Finder.  (this seemed better than caching the stub paths in every
      ModLocation, because they are rarely needed and only present in home
      modules, and are easily calculated from other available information).
      
      -stubdir behaves in exactly the same way as -odir and -hidir.
      f2e730f3
    • simonmar's avatar
      [project @ 2005-10-28 11:29:19 by simonmar] · d8afca91
      simonmar authored
      Fix double "Linking ..." message, and mention the name of the
      executable in the message.
      d8afca91
  10. 25 Oct, 2005 1 commit
    • simonmar's avatar
      [project @ 2005-10-25 12:48:35 by simonmar] · 78b72ed1
      simonmar authored
      Two changes from Krasimir Angelov, which were required for Visual
      Haskell:
      
        - messaging cleanup throughout the compiler.  DynFlags has a new
          field:
      
          log_action :: Severity -> SrcSpan -> PprStyle -> Message -> IO ()
      
          this action is invoked for every message generated by the
          compiler.  This means a client of the GHC API can direct messages to
          any destination, or collect them up in an IORef for later
          perusal.
      
          This replaces previous hacks to redirect messages in the GHC API
          (hence some changes to function types in GHC.hs).
      
        - The JustTypecheck mode of GHC now does what it says.  It doesn't
          run any of the compiler passes beyond the typechecker for each module,
          but does generate the ModIface in order that further modules can be
          typechecked.
      
      And one change from me:
      
        - implement the LANGUAGE pragma, finally
      78b72ed1
  11. 23 Sep, 2005 1 commit
  12. 03 Aug, 2005 1 commit
    • simonmar's avatar
      [project @ 2005-08-03 10:42:53 by simonmar] · 34495a28
      simonmar authored
      Fix the location of _stub.o files when compiling with -odir.  The
      comment from the source:
      
      -- The _stub.c file is derived from the haskell source file (but stored
      -- in hscStubCOutName in the dflags for some reason, probably historical).
      -- Consequently, we derive the _stub.o filename from the haskell object
      -- filename.
      --
      -- This isn't necessarily the same as the object filename we
      -- would get if we just compiled the _stub.c file using the pipeline.
      -- For example:
      --
      --    ghc src/A.hs -odir obj
      --
      -- results in obj/A.o, and src/A_stub.c.  If we compile src/A_stub.c with
      -- -odir obj, we would get obj/src/A_stub.o, which is wrong; we want
      -- obj/A_stub.o.
      34495a28
  13. 08 Jul, 2005 1 commit
  14. 24 May, 2005 1 commit
  15. 19 May, 2005 1 commit
    • simonpj's avatar
      [project @ 2005-05-19 11:15:40 by simonpj] · 4a587049
      simonpj authored
      Tune up the reporting of unused imports
      
      		Merge to STABLE
      	(I think the earlier change made it across)
      	(PS: the commit also does some trimming of
      	redundant imports.  If they don't merge, just
      	discard them.)
      
      My earlier fixes to the reporting of unused imports still missed
      some obscure cases, some of which are now fixed by this commit.
      I had to make the import-provenance data type yet richer, but in
      fact it has more sharing now, so it may be cheaper on space.
      
      There's still one infelicity. Consider
      		import M( x )
      		imoprt N( x )
      where the same underlying 'x' is involved in both cases.  Currently we
      don't report a redundant import, because dropping either import would
      change the qualified names in scope (M.x, N.x). But if the qualified
      names aren't used, the import is indeed redundant. Sadly we don't know
      that, because we only know what Names are used.  Left for the future!
      There's a comment in RnNames.warnDuplicateImports
      
      This commit also trims quite a few redundant imports disovered
      by the new setup.
      4a587049
  16. 17 May, 2005 1 commit
    • simonmar's avatar
      [project @ 2005-05-17 12:00:04 by simonmar] · 8d6afe74
      simonmar authored
      Improve source locations on error messages from the downsweep.  We now
      keep track of SrcSpans from import declarations, so we can report a
      proper source location for unknown imports (this improves on the
      previous hacky solution of keeping track of the filename that
      contained the original import declaration).
      
      ModSummary now contains (Located Module) for each import instead of Module.
      8d6afe74
  17. 16 May, 2005 1 commit
    • simonmar's avatar
      [project @ 2005-05-16 13:47:57 by simonmar] · 34c2b1b2
      simonmar authored
      Implement -x <suffix> flag to override the suffix of a filename for
      the purposes of determinig how it should be compiled.  The usage is
      similar to gcc, except that we just use a suffix rather than a name
      for the language. eg.
      
         ghc -c -x hs hello.blah
      
      will pretend hello.blah is a .hs file.  Another possible use is -x
      hspp, which skips preprocessing.
      
      This works for one-shot compilation, --make, GHCi, and ghc -e.  The
      original idea was to make it possible to use runghc on a file that
      doesn't end in .hs, so changes to runghc will follow.
      
      Also, I made it possible to specify .c files and other kinds of files
      on the --make command line; these will be compiled to objects as
      normal and linked into the final executable.
      
      GHC API change: I had to extend the Target type to include an optional
      start phase, and also GHC.guessTarget now takes a (Maybe Phase) argument.
      
      I thought this would be half an hour, in fact it took half a day, and
      I still haven't documented it.  Sigh.
      34c2b1b2
  18. 28 Apr, 2005 1 commit
    • simonpj's avatar
      [project @ 2005-04-28 10:09:41 by simonpj] · dd313897
      simonpj authored
      This big commit does several things at once (aeroplane hacking)
      which change the format of interface files.  
      
      	So you'll need to recompile your libraries!
      
      1. The "stupid theta" of a newtype declaration
      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      Retain the "stupid theta" in a newtype declaration.
      For some reason this was being discarded, and putting it
      back in meant changing TyCon and IfaceSyn slightly.
         
      
      2. Overlap flags travel with the instance
      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      Arrange that the ability to support overlap and incoherence
      is a property of the *instance declaration* rather than the
      module that imports the instance decl.  This allows a library
      writer to define overlapping instance decls without the
      library client having to know.  
      
      The implementation is that in an Instance we store the
      overlap flag, and preseve that across interface files
      
      
      3. Nuke the "instnce pool" and "rule pool"
      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      A major tidy-up and simplification of the way that instances
      and rules are sucked in from interface files.  Up till now
      an instance decl has been held in a "pool" until its "gates" 
      (a set of Names) are in play, when the instance is typechecked
      and added to the InstEnv in the ExternalPackageState.  
      This is complicated and error-prone; it's easy to suck in 
      too few (and miss an instance) or too many (and thereby be
      forced to suck in its type constructors, etc).
      
      Now, as we load an instance from an interface files, we 
      put it straight in the InstEnv... but the Instance we put in
      the InstEnv has some Names (the "rough-match" names) that 
      can be used on lookup to say "this Instance can't match".
      The detailed dfun is only read lazily, and the rough-match
      thing meansn it is'nt poked on until it has a chance of
      being needed.
      
      This simply continues the successful idea for Ids, whereby
      they are loaded straightaway into the TypeEnv, but their
      TyThing is a lazy thunk, not poked on until the thing is looked
      up.
      
      Just the same idea applies to Rules.
      
      On the way, I made CoreRule and Instance into full-blown records
      with lots of info, with the same kind of key status as TyCon or 
      DataCon or Class.  And got rid of IdCoreRule altogether.   
      It's all much more solid and uniform, but it meant touching
      a *lot* of modules.
      
      
      4. Allow instance decls in hs-boot files
      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      Allowing instance decls in hs-boot files is jolly useful, becuase
      in a big mutually-recursive bunch of data types, you want to give
      the instances with the data type declarations.  To achieve this
      
      * The hs-boot file makes a provisional name for the dict-fun, something
        like $fx9.
      
      * When checking the "mother module", we check that the instance
        declarations line up (by type) and generate bindings for the 
        boot dfuns, such as
      	$fx9 = $f2
        where $f2 is the dfun generated by the mother module
      
      * In doing this I decided that it's cleaner to have DFunIds get their
        final External Name at birth.  To do that they need a stable OccName,
        so I have an integer-valued dfun-name-supply in the TcM monad.
        That keeps it simple.
      
      This feature is hardly tested yet.
      
      
      5. Tidy up tidying, and Iface file generation
      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      main/TidyPgm now has two entry points:
      
        simpleTidyPgm is for hi-boot files, when typechecking only
        (not yet implemented), and potentially when compiling without -O.
        It ignores the bindings, and generates a nice small TypeEnv.
      
        optTidyPgm is the normal case: compiling with -O.  It generates a
        TypeEnv rich in IdInfo
      
      MkIface.mkIface now only generates a ModIface.  A separate
      procedure, MkIface.writeIfaceFile, writes the file out to disk.
      dd313897
  19. 19 Apr, 2005 1 commit
    • simonmar's avatar
      [project @ 2005-04-19 15:28:35 by simonmar] · 44eaf25c
      simonmar authored
      - DriverPipeline.compile: report errors in GHC_OPTIONS pragmas using the
        Message callback, and give them a proper line number.
      
      - GHC.checkModule: read the GHC_OPTIONS pragma, and report errors
        appropriately.
      44eaf25c
  20. 13 Apr, 2005 2 commits
    • wolfgang's avatar
      [project @ 2005-04-13 21:42:17 by wolfgang] · 93cc7d22
      wolfgang authored
      Make the status messages from ghc --make display the number of modules
      to be compiled, as in:
      
      [3 of 9] Compiling Foo.hs     ( Foo.hs, Foo.o )
      93cc7d22
    • simonmar's avatar
      [project @ 2005-04-13 13:30:42 by simonmar] · b3302713
      simonmar authored
      Add :
      
        loadMsg :: Session -> LoadHowMuch
      	  -> (Messages-> IO ()) -> IO SuccessFlag
      
      ie. just like load, except it takes a message callback and plumbs it
      down to hscMain.  checkModule now uses loadMsgs.  Better name
      suggestions welcome.
      b3302713
  21. 05 Apr, 2005 1 commit
    • krasimir's avatar
      [project @ 2005-04-05 09:06:36 by krasimir] · bdfa0107
      krasimir authored
      In many places there was a common pattern
      
      when (verbose >= n) $ putMsg "..."
      
      It is now replaced with
      
      debutTraceMsg dflags n "..."
      
      In few places hPutStrLn stderr or putStrLn was used instead of putMsg in
      the above pattern. They are replaced too. Now putMsg is used only in places
      where the verbosity flag was not checked.
      bdfa0107
  22. 31 Mar, 2005 2 commits
    • simonmar's avatar
      [project @ 2005-03-31 16:11:49 by simonmar] · 426e0396
      simonmar authored
      DriverPipeline.compile: we should be grabbing the OPTIONS from the
      StringBuffer, not reading the file again (duh!)
      
      SysTools: some message cleanups
      426e0396
    • simonmar's avatar
      [project @ 2005-03-31 10:16:33 by simonmar] · 853e20a3
      simonmar authored
      Tweaks to get the GHC sources through Haddock.  Doesn't quite work
      yet, because Haddock complains about the recursive modules.  Haddock
      needs to understand SOURCE imports (it can probably just ignore them
      as a first attempt).
      853e20a3
  23. 30 Mar, 2005 2 commits
    • simonmar's avatar
      [project @ 2005-03-30 16:24:04 by simonmar] · 6720aae4
      simonmar authored
      Add support for partial reloads in the GHC API.
      
      This is mainly for VS: when editing a file you don't want to
      continually reload the entire project whenever the current file
      changes, you want to reload up to and including the current file only.
      However, you also want to retain any other modules in the session that
      are still stable.
      
      I added a variant of :reload in GHCi to test this.  You can say
      ':reload M' to reload up to module M only.  This will bring M up to
      date, and throw away any invalidated modules from the session.
      6720aae4
    • sof's avatar
      [project @ 2005-03-30 01:22:24 by sof] · 8e30c1ff
      sof authored
      Avoid a (rather verbose) GHC warning from being issued -- initialize the
      runPhase.mod_summary.ms_obj_date field.
      8e30c1ff
  24. 28 Mar, 2005 1 commit
  25. 24 Mar, 2005 1 commit
    • simonmar's avatar
      [project @ 2005-03-24 16:14:00 by simonmar] · 19519dc3
      simonmar authored
      Cleanup the upsweep strategy in GHC.load.
      
      Now it's hopefully clearer how we decide what modules to recompile,
      and which are "stable" (not even looked at) during a reload.  See the
      comments for details.
      
      Also, I've taken some trouble to explicitly prune out things that
      aren't required before a reload, which should reduce the memory
      requirements for :reload in GHCi.  Currently I believe it keeps most
      of the old program until the reload is complete, now it shouldn't
      require any extra memory.
      19519dc3
  26. 22 Mar, 2005 1 commit
    • simonmar's avatar
      [project @ 2005-03-22 17:13:12 by simonmar] · 069370a5
      simonmar authored
      A start on the GHC API:
      
      Flesh out the GHC module so that it can replace CompManager.  Now, the
      clients that used CompManager consume the GHC API instead (namely
      Main, DriverMkDepend, and InteractiveUI).  Main is significantly
      cleaner as a result.
      
      The interface needs more work: in particular, getInfo returns results
      in the form of IfaceDecls but we want to use full HsSyn and
      Id/DataCon/Class across the boundary instead.
      
      The interfaces for inspecting loaded modules are not yet implemented.
      069370a5
  27. 21 Mar, 2005 1 commit
    • simonmar's avatar
      [project @ 2005-03-21 10:50:22 by simonmar] · 50159f6c
      simonmar authored
      Complete the transition of -split-objs into a dynamic flag (looks like I
      half-finished it in the last commit).
      
      Also: complete the transition of -tmpdir into a dynamic flag, which
      involves some rearrangement of code from SysTools into DynFlags.
      
      Someday, initSysTools should move wholesale into initDynFlags, because
      most of the state that it initialises is now part of the DynFlags
      structure, and the rest could be moved in easily.
      50159f6c
  28. 18 Mar, 2005 1 commit
    • simonmar's avatar
      [project @ 2005-03-18 13:37:27 by simonmar] · d1c1b7d0
      simonmar authored
      Flags cleanup.
      
      Basically the purpose of this commit is to move more of the compiler's
      global state into DynFlags, which is moving in the direction we need
      to go for the GHC API which can have multiple active sessions
      supported by a single GHC instance.
      
      Before:
      
      $ grep 'global_var' */*hs | wc -l
           78
      
      After:
      
      $ grep 'global_var' */*hs | wc -l
           27
      
      Well, it's an improvement.  Most of what's left won't really affect
      our ability to host multiple sessions.
      
      Lots of static flags have become dynamic flags (yay!).  Notably lots
      of flags that we used to think of as "driver" flags, like -I and -L,
      are now dynamic.  The most notable static flags left behind are the
      "way" flags, eg. -prof.  It would be nice to fix this, but it isn't
      urgent.
      
      On the way, lots of cleanup has happened.  Everything related to
      static and dynamic flags lives in StaticFlags and DynFlags
      respectively, and they share a common command-line parser library in
      CmdLineParser.  The flags related to modes (--makde, --interactive
      etc.) are now private to the front end: in fact private to Main
      itself, for now.
      d1c1b7d0
  29. 04 Mar, 2005 1 commit
  30. 14 Feb, 2005 1 commit
  31. 02 Feb, 2005 1 commit
  32. 01 Feb, 2005 2 commits
    • simonmar's avatar
      [project @ 2005-02-01 13:18:05 by simonmar] · 9dadfbd7
      simonmar authored
      Fix the source_unchanged test in the Hsc phase
      9dadfbd7
    • simonpj's avatar
      [project @ 2005-02-01 08:36:02 by simonpj] · d7080606
      simonpj authored
      --------------------
      	Command-flag cleanup
      	--------------------
      
      * Fewer cases in GhcMode: eliminate DoMkDLL, DoLink, both in favour of
        StopBefore StopLn
      
      * Replace the NoLink boolean with a GhcLink three-way flag:
      	NoLink, StaticLink, MakeDLL
      
      * Corresponding plumbing to link it all up.
      d7080606