1. 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
  2. 19 Mar, 2005 1 commit
    • sof's avatar
      [project @ 2005-03-19 02:03:26 by sof] · cbe4c3a7
      sof authored
      [Windows only]
      for System.Directory / Compat.Directory functionality that probes the OS
      for local details re: misc user directories, perform late binding of
      SHGetFolderPath() from shell32.dll, as it may not be present.
      (cf. ghc-6.4's failure to operate on Win9x / NT boxes.) If the API isn't
      there, fail with UnsupportedOperation.
      Packages.readPackageConfigs: gracefully handle excns from getAppUserDataDirectory.
      
      Merge to STABLE.
      cbe4c3a7
  3. 18 Mar, 2005 3 commits
    • simonpj's avatar
      [project @ 2005-03-18 17:17:02 by simonpj] · c0eed017
      simonpj authored
      Import wibble
      c0eed017
    • simonpj's avatar
      [project @ 2005-03-18 17:16:00 by simonpj] · d5b3e9b5
      simonpj authored
      Fix stage-2 build
      d5b3e9b5
    • 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
  4. 17 Mar, 2005 1 commit
  5. 15 Mar, 2005 1 commit
  6. 08 Mar, 2005 1 commit
  7. 07 Mar, 2005 1 commit
    • simonpj's avatar
      [project @ 2005-03-07 16:46:08 by simonpj] · 36d22a1c
      simonpj authored
      -----------------------------------------
             Fix a long-standing indirection-zapping bug
      	-----------------------------------------
      
      	Merge to STABLE
      
      Up to now we zap indirections as part of the occurence analyser.
      But this is bogus.  The indirection zapper does the following:
      
      	x_local = <expression>
      	...bindings...
      	x_exported = x_local
      
      where x_exported is exported, and x_local is not, then we
      replace it with this:
      
      	x_exported = <expression>
      	x_local = x_exported
      	...bindings...
      
      But this is plain wrong if x_exported has a RULE that mentions
      something (f, say) in ...bindings.., because 'f' will then die.
      
      After hacking a few solutions, I've eventually simply made the indirection
      zapping into a separate pass (which is cleaner anyway), which wraps the
      entire program back into a single Rec if the bad thing can happen.
      
      On the way I've made indirection-zapping work in Recs too, which wasn't the
      case before.
      
      * Move the zapper from OccurAnal into SimplCore
      * Tidy up the printing of pragmas (PprCore and friends)
      * Add a new function Rules.addRules
      * Merge rules in the indirection zapper (previously one set was discarded)
      36d22a1c
  8. 04 Mar, 2005 1 commit
  9. 02 Mar, 2005 1 commit
  10. 23 Feb, 2005 1 commit
  11. 22 Feb, 2005 1 commit
    • simonpj's avatar
      [project @ 2005-02-22 16:29:41 by simonpj] · fed0cc3f
      simonpj authored
      -------------------------------------------------------
      	Change -include-prelude to -include-pkg-deps for ghc -M
      	-------------------------------------------------------
      
      	Merge to STABLE
      
      This commit just renames the flag for ghc -M to something more
      sensible.
      fed0cc3f
  12. 21 Feb, 2005 1 commit
    • simonmar's avatar
      [project @ 2005-02-21 14:07:07 by simonmar] · ff9ab413
      simonmar authored
      Fix a recompilation bug caused by the fact that typecheckIface wasn't
      going via loadDecl to create the binders properly.  The fix actually
      results in slightly cleaner code.
      ff9ab413
  13. 18 Feb, 2005 1 commit
  14. 15 Feb, 2005 2 commits
  15. 14 Feb, 2005 3 commits
  16. 10 Feb, 2005 1 commit
  17. 07 Feb, 2005 1 commit
    • simonpj's avatar
      [project @ 2005-02-07 12:16:50 by simonpj] · 3ab57e45
      simonpj authored
      -----------------------------------------------------
      	Switch off derivable type class generation by default
      	-----------------------------------------------------
      
      	Merge to STABLE
      
      This commit switches off the generation of the support code for 'Derivable
      Type Classes' by default.  Use -fgenerics to switch it on.
      
      Motivation: seldom used, and there's a nasty blowup in Core types for data
      types that have lots of constructors or lots of fields.
      
      We now put -fgenerics in the GhcLibOpts, so that the libraries have the
      support code, as before.
      3ab57e45
  18. 04 Feb, 2005 2 commits
  19. 02 Feb, 2005 3 commits
  20. 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
  21. 31 Jan, 2005 2 commits
    • simonpj's avatar
      [project @ 2005-01-31 16:59:37 by simonpj] · b2446845
      simonpj authored
      Tidy up stop-phase passing; fix bug in -o handling for ghc -E X.hs -o X.pp
      b2446845
    • wolfgang's avatar
      [project @ 2005-01-31 05:27:14 by wolfgang] · c560ae86
      wolfgang authored
      Reorganise handling of -fPIC flags passed to C compiler.
      The flags expected by gcc differ only slightly per platform
      (basically depending whether you are on a Mac or not), we don't need
      separate cases for every processor.
      
      TODO: Display an error message for platforms where -fPIC -fvia-C is not
            supported.
      c560ae86
  22. 28 Jan, 2005 4 commits
    • ross's avatar
      [project @ 2005-01-28 18:50:25 by ross] · 5500fa8f
      ross authored
      add missing underscores
      5500fa8f
    • simonmar's avatar
      [project @ 2005-01-28 14:27:00 by simonmar] · b4b792b5
      simonmar authored
      add an INCLUDE pragma, as a compiler-independent alternative to
      -#include.
      b4b792b5
    • simonmar's avatar
      [project @ 2005-01-28 14:21:12 by simonmar] · a02314bd
      simonmar authored
      Fix -no-recomp
      a02314bd
    • simonmar's avatar
      [project @ 2005-01-28 12:55:17 by simonmar] · 153b9cb9
      simonmar authored
      Rationalise the BUILD,HOST,TARGET defines.
      
      Recall that:
      
        - build is the platform we're building on
        - host is the platform we're running on
        - target is the platform we're generating code for
      
      The change is that now we take these definitions as applying from the
      point of view of the particular source code being built, rather than
      the point of view of the whole build tree.
      
      For example, in RTS and library code, we were previously testing the
      TARGET platform.  But under the new rule, the platform on which this
      code is going to run is the HOST platform.  TARGET only makes sense in
      the compiler sources.
      
      In practical terms, this means that the values of BUILD, HOST & TARGET
      may vary depending on which part of the build tree we are in.
      
      Actual changes:
      
       - new file: includes/ghcplatform.h contains platform defines for
         the RTS and library code.
      
       - new file: includes/ghcautoconf.h contains the autoconf settings
         only (HAVE_BLAH).  This is so that we can get hold of these
         settings independently of the platform defines when necessary
         (eg. in GHC).
      
       - ghcconfig.h now #includes both ghcplatform.h and ghcautoconf.h.
      
       - MachRegs.h, which is included into both the compiler and the RTS,
         now has to cope with the fact that it might need to test either
         _TARGET_ or _HOST_ depending on the context.
      
       - the compiler's Makefile now generates
           stage{1,2,3}/ghc_boot_platform.h
         which contains platform defines for the compiler.  These differ
         depending on the stage, of course: in stage2, the HOST is the
         TARGET of stage1.  This was wrong before.
      
       - The compiler doesn't get platform info from Config.hs any more.
         Previously it did (sometimes), but unless we want to generate
         a new Config.hs for each stage we can't do this.
      
       - GHC now helpfully defines *_{BUILD,HOST}_{OS,ARCH} automatically
         in CPP'd Haskell source.
      
       - ghcplatform.h defines *_TARGET_* for backwards compatibility
         (ghcplatform.h is included by ghcconfig.h, which is included by
         config.h, so code which still #includes config.h will get the TARGET
         settings as before).
      
       - The Users's Guide is updated to mention *_HOST_* rather than
         *_TARGET_*.
      
       - coding-style.html in the commentary now contains a section on
         platform defines.  There are further doc updates to come.
      
      Thanks to Wolfgang Thaller for pointing me in the right direction.
      153b9cb9
  23. 27 Jan, 2005 4 commits
    • simonpj's avatar
      [project @ 2005-01-27 15:55:38 by simonpj] · b5dbb387
      simonpj authored
      Make -no-recomp a dynamic flag
      b5dbb387
    • simonmar's avatar
      [project @ 2005-01-27 14:38:29 by simonmar] · 2cf37ff9
      simonmar authored
      Fix explicit layout
      2cf37ff9
    • simonpj's avatar
      [project @ 2005-01-27 11:50:58 by simonpj] · 281bcf70
      simonpj authored
      Make sure that the interactive context can see home-package instances;
      I forgot to do this when making tcRnModule find the appropriate intances
      (TcRnDriver rev 1.91)
      
      This was causing SourceForge [ghc-Bugs-1106171].
      281bcf70
    • simonpj's avatar
      [project @ 2005-01-27 10:44:00 by simonpj] · 508a505e
      simonpj authored
      --------------------------------------------
                Replace hi-boot files with hs-boot files
        	--------------------------------------------
      
      This major commit completely re-organises the way that recursive modules
      are dealt with.
      
        * It should have NO EFFECT if you do not use recursive modules
      
        * It is a BREAKING CHANGE if you do
      
      ====== Warning: .hi-file format has changed, so if you are
      ======		updating into an existing HEAD build, you'll
      ======		need to make clean and re-make
      
      
      The details:  [documentation still to be done]
      
      * Recursive loops are now broken with Foo.hs-boot (or Foo.lhs-boot),
        not Foo.hi-boot
      
      * An hs-boot files is a proper source file.  It is compiled just like
        a regular Haskell source file:
      	ghc Foo.hs		generates Foo.hi, Foo.o
      	ghc Foo.hs-boot		generates Foo.hi-boot, Foo.o-boot
      
      * hs-boot files are precisely a subset of Haskell. In particular:
      	- they have the same import, export, and scoping rules
      	- errors (such as kind errors) in hs-boot files are checked
        You do *not* need to mention the "original" name of something in
        an hs-boot file, any more than you do in any other Haskell module.
      
      * The Foo.hi-boot file generated by compiling Foo.hs-boot is a machine-
        generated interface file, in precisely the same format as Foo.hi
      
      * When compiling Foo.hs, its exports are checked for compatibility with
        Foo.hi-boot (previously generated by compiling Foo.hs-boot)
      
      * The dependency analyser (ghc -M) knows about Foo.hs-boot files, and
        generates appropriate dependencies.  For regular source files it
        generates
      	Foo.o : Foo.hs
      	Foo.o : Baz.hi		-- Foo.hs imports Baz
      	Foo.o : Bog.hi-boot	-- Foo.hs source-imports Bog
      
        For a hs-boot file it generates similar dependencies
      	Bog.o-boot : Bog.hs-boot
      	Bog.o-boot : Nib.hi	-- Bog.hs-boto imports Nib
      
      * ghc -M is also enhanced to use the compilation manager dependency
        chasing, so that
      	ghc -M Main
        will usually do the job.  No need to enumerate all the source files.
      
      * The -c flag is no longer a "compiler mode". It simply means "omit the
        link step", and synonymous with -no-link.
      508a505e
  24. 20 Jan, 2005 1 commit
    • simonmar's avatar
      [project @ 2005-01-20 14:22:19 by simonmar] · c830ae13
      simonmar authored
      Fill in the haddock-interfaces and haddock-html fields in the
      package.conf files.
      
      To do this I had to make some changes:
      
        - haddock-interfaces requires the value of $(datadir).  We can't
          just plug this in, because $(datadir) might change at install-time
          (eg. a Windows installer can be placed anywhere, as can a Unix
          binary .tar.gz distribution).  The current trick is for the
          compiler to splice in the value of $libdir in package.conf at
          runtime.  So we could extend this mechanism and tell the compiler
          the value of $datadir via a command-line option, but that seems
          ugly.
      
          On Windows, $datadir==$libdir, so we don't need any changes:
          package.conf still uses $libdir, and a Windows installation is
          independent of its absolute location.  Even 'make install' on
          Windows should have this property.
      
          On Unix:
      	- for 'make install' and in-place execution, we just use
                absolute paths in package.conf
      
      	- for a binary dist, we generate a package.conf that refers
      	  to $libdir and $datadir, and splice in the values at
      	  install-time (distrib/Makefile-bin.in).
      
        - Also, I renamed $libdir to $topdir to more closely reflect its
          actual meaning.  This is somewhat malicious in that it will flush
          out all those clients using $libdir when they really shouldn't
          be :-)
      c830ae13