1. 20 Aug, 2007 1 commit
  2. 09 Aug, 2007 1 commit
  3. 03 Aug, 2007 1 commit
  4. 05 Jul, 2007 1 commit
  5. 03 Jul, 2007 2 commits
  6. 27 Jun, 2007 5 commits
    • Michael D. Adams's avatar
      d31dfb32
    • Michael D. Adams's avatar
      Added stack checks to the CPS algorithm · 1f46671f
      Michael D. Adams authored
      This eliminates one of the panics introduced by 
      the previous patch:
      'First pass at implementing info tables for CPS'
        
      The other panic introduced by that patch still remains.
      It was due to the need to convert from a
        ContinuationInfo to a CmmInfo.
        (codeGen/CgInfoTbls.hs:emitClosureCodeAndInfoTable)
        (codeGen/CgInfoTbls.hs:emitReturnTarget)
      1f46671f
    • Michael D. Adams's avatar
      First pass at implementing info tables for CPS · f96e9aa0
      Michael D. Adams authored
      This is a fairly complete implementation, however
      two 'panic's have been placed in the critical path
      where the implementation is still a bit lacking so
      do not expect it to run quite yet.
      
      One call to panic is because we still need to create
      a GC block for procedures that don't have them yet.
      (cmm/CmmCPS.hs:continuationToProc)
      
      The other is due to the need to convert from a
      ContinuationInfo to a CmmInfo.
      (codeGen/CgInfoTbls.hs:emitClosureCodeAndInfoTable)
      (codeGen/CgInfoTbls.hs:emitReturnTarget)
      f96e9aa0
    • Michael D. Adams's avatar
    • Michael D. Adams's avatar
      Added pointerhood to LocalReg · 20780258
      Michael D. Adams authored
      This version should compile but is still incomplete as it introduces
      potential bugs at the places marked 'TODO FIXME NOW'.
      It is being recorded to help keep track of changes.
      20780258
  7. 25 May, 2007 1 commit
    • Michael D. Adams's avatar
      Moved global register saving from the backend to codeGen · bd3a364d
      Michael D. Adams authored
      This frees the Cmm data type from keeping a list of live global registers
      in CmmCall which helps prepare for the CPS conversion phase.
      
      CPS conversion does its own liveness analysis and takes input that should
      not directly refer to parameter registers (e.g. R1, F5, D3, L2).  Since
      these are the only things which could occur in the live global register
      list, CPS conversion makes that field of the CmmCall constructor obsolite.
      
      Once the CPS conversion pass is fully implemented, global register saving
      will move from codeGen into the CPS pass.  Until then, this patch
      is worth scrutinizing and testing to ensure it doesn't cause any performance
      or correctness problems as the code passed to the backends by the CPS
      converting will look very similar to the code that this patch makes codeGen
      pass to the backend.
      bd3a364d
  8. 22 May, 2007 1 commit
    • Michael D. Adams's avatar
      Make CmmProc take CmmFormals as argument · 418175d3
      Michael D. Adams authored
      Since a CmmCall returns CmmFormals which may include
      global registers (and indeed one place in the code
      returns the results of a CmmCall into BaseReg) and
      since CPS conversion will change those return slots
      into formal arguments for the continuation of the call,
      CmmProc has to have CmmFormals for the formal arguments.
      
      Oddly, the old code never made use of procedure arguments
      so this change only effects the types and not any of the code.
      (Because [] is both of type [LocalReg] and CmmFormals.)
      418175d3
  9. 18 May, 2007 1 commit
  10. 16 May, 2007 1 commit
  11. 02 Jul, 2007 1 commit
  12. 17 Jan, 2007 2 commits
  13. 11 Oct, 2006 1 commit
    • Simon Marlow's avatar
      Module header tidyup, phase 1 · 49c98d14
      Simon Marlow authored
      This patch is a start on removing import lists and generally tidying
      up the top of each module.  In addition to removing import lists:
      
         - Change DATA.IOREF -> Data.IORef etc.
         - Change List -> Data.List etc.
         - Remove $Id$
         - Update copyrights
         - Re-order imports to put non-GHC imports last
         - Remove some unused and duplicate imports
      49c98d14
  14. 07 Apr, 2006 1 commit
    • Simon Marlow's avatar
      Reorganisation of the source tree · 0065d5ab
      Simon Marlow authored
      Most of the other users of the fptools build system have migrated to
      Cabal, and with the move to darcs we can now flatten the source tree
      without losing history, so here goes.
      
      The main change is that the ghc/ subdir is gone, and most of what it
      contained is now at the top level.  The build system now makes no
      pretense at being multi-project, it is just the GHC build system.
      
      No doubt this will break many things, and there will be a period of
      instability while we fix the dependencies.  A straightforward build
      should work, but I haven't yet fixed binary/source distributions.
      Changes to the Building Guide will follow, too.
      0065d5ab
  15. 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
  16. 21 May, 2005 1 commit
    • panne's avatar
      [project @ 2005-05-21 15:39:00 by panne] · faa8d785
      panne authored
      Warning police: Removed overlapped patterns. In general, taking
      compiler warnings about unmatched patterns seriously when they come up
      later might be better than writing catch-all patterns right from the
      start. Otherwise readers are confused and wonder which patterns might
      be missing when there are none.
      faa8d785
  17. 15 May, 2005 1 commit
  18. 31 Mar, 2005 1 commit
    • 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
  19. 23 Jan, 2005 1 commit
    • wolfgang's avatar
      [project @ 2005-01-23 18:50:40 by wolfgang] · e171a977
      wolfgang authored
      Make the NCG distinguish between the read-only data section and the
      "relocatable read-only data" section.
      Read-only data is supposed to be _really_ read-only, whereas "relrodata"
      can have relocations, but should not be modified by the program at runtime.
      
      For Linux, put relrodata into ".data" by default, as the dynamic linker
      tends to do evil things to avoid relocating things in read-only sections.
      e171a977
  20. 16 Jan, 2005 1 commit
  21. 07 Oct, 2004 1 commit
    • wolfgang's avatar
      [project @ 2004-10-07 15:54:03 by wolfgang] · b4d045ae
      wolfgang authored
      Position Independent Code and Dynamic Linking Support, Part 1
      
      This commit allows generation of position independent code (PIC) that fully supports dynamic linking on Mac OS X and PowerPC Linux.
      Other platforms are not yet supported, and there is no support for actually linking or using dynamic libraries - so if you use the -fPIC or -dynamic code generation flags, you have to type your (platform-specific) linker command lines yourself.
      
      
      nativeGen/PositionIndependentCode.hs:
      New file. Look here for some more comments on how this works.
      
      cmm/CLabel.hs:
      Add support for DynamicLinkerLabels and PIC base labels - for use inside the NCG.
      needsCDecl: Case alternative labels now need C decls, see the codeGen/CgInfoTbls.hs below for details
      
      cmm/Cmm.hs:
      Add CmmPicBaseReg (used in NCG),
      and CmmLabelDiffOff (used in NCG and for offsets in info tables)
      
      cmm/CmmParse.y:
      support offsets in info tables
      
      cmm/PprC.hs:
      support CmmLabelDiffOff
      Case alternative labels now need C decls (see the codeGen/CgInfoTbls.hs for details), so we need to pprDataExterns for info tables.
      
      cmm/PprCmm.hs:
      support CmmLabelDiffOff
      
      codeGen/CgInfoTbls.hs:
      no longer store absolute addresses in info tables, instead, we store offsets.
      Also, for vectored return points, emit the alternatives _after_ the vector table. This is to work around a limitation in Apple's as, which refuses to handle label differences where one label is at the end of a section. Emitting alternatives after vector info tables makes sure this never happens in GHC generated code. Case alternatives now require prototypes in hc code, though (see changes in PprC.hs, CLabel.hs).
      
      main/CmdLineOpts.lhs:
      Add a new option, -fPIC.
      
      main/DriverFlags.hs:
      Pass the correct options for PIC to gcc, depending on the platform. Only for powerpc for now.
      
      nativeGen/AsmCodeGen.hs:
      Many changes...
      Mac OS X-specific management of import stubs is no longer, it's now part of a general mechanism to handle such things for all platforms that need it (Darwin [both ppc and x86], Linux on ppc, and some platforms we don't support).
      Move cmmToCmm into its own monad which can accumulate a list of imported symbols. Make it call cmmMakeDynamicReference at the right places.
      
      nativeGen/MachCodeGen.hs:
      nativeGen/MachInstrs.hs:
      nativeGen/MachRegs.lhs:
      nativeGen/PprMach.hs:
      nativeGen/RegAllocInfo.hs:
      Too many changes to enumerate here, PowerPC specific.
      
      nativeGen/NCGMonad.hs:
      NatM still tracks imported symbols, as more labels can be created during code generation (float literals, jump tables; on some platforms all data access has to go through the dynamic linking mechanism).
      
      driver/mangler/ghc-asm.lprl:
      Mangle absolute addresses in info tables to offsets.
      Correctly pass through GCC-generated PIC for Mac OS X and powerpc linux.
      
      includes/Cmm.h:
      includes/InfoTables.h:
      includes/Storage.h:
      includes/mkDerivedConstants.c:
      rts/GC.c:
      rts/GCCompact.c:
      rts/HeapStackCheck.cmm:
      rts/Printer.c:
      rts/RetainerProfile.c:
      rts/Sanity.c:
      Adapt to the fact that info tables now contain offsets.
      
      rts/Linker.c:
      Mac-specific: change machoInitSymbolsWithoutUnderscore to support PIC.
      b4d045ae
  22. 20 Aug, 2004 1 commit
    • simonmar's avatar
      [project @ 2004-08-20 12:21:03 by simonmar] · 557d889d
      simonmar authored
      Simplify the "impossible branch" handling, and fix a bug in the
      process.  CmmSwitch encodes the possibility of having impossible
      branches (the destinations are Maybe BlockId rather than just BlockId)
      so we don't need to encode impossible branches as dummy blocks
      containing a jump to an impossible location (currently 0).
      
      However, PprC and PprCmm weren't set up to cope with Nothings in a
      CmmSwitch, so this commit fixes that too.
      557d889d
  23. 13 Aug, 2004 1 commit