1. 15 Aug, 2001 1 commit
  2. 24 Jul, 2001 1 commit
  3. 18 Jul, 2001 1 commit
    • rrt's avatar
      [project @ 2001-07-18 16:06:10 by rrt] · 0143969c
      rrt authored
      Add support for Hugs's :info command. Doesn't work yet, but shouldn't
      interfere with anything else. Some of the files touched are just to correct
      out-of-date comments.
      
      Highlights are:
      
      hscThing: like hscStmt, but just gets info about a single identifier
      cmInfoThing: exposes hscThing's functionality to the outside world
      0143969c
  4. 17 Jul, 2001 1 commit
  5. 16 Jul, 2001 1 commit
  6. 13 Jul, 2001 1 commit
    • simonpj's avatar
      [project @ 2001-07-13 13:29:56 by simonpj] · d4e38936
      simonpj authored
      ------------------------------------
      	Tidy up the "syntax rebinding" story
      	------------------------------------
      
      I found a bug in the code that dealt with re-binding implicit
      numerical syntax:
      	literals 	(fromInteger/fromRational)
      	negation	(negate)
      	n+k patterns	(minus)
      
      This is triggered by the -fno-implicit-prelude flag, and it
      used to be handled via the PrelNames.SyntaxMap.
      
      But I found a nicer way to do it that involves much less code,
      and doesn't have the bug.  The explanation is with
      	RnEnv.lookupSyntaxName
      d4e38936
  7. 12 Jul, 2001 1 commit
    • simonpj's avatar
      [project @ 2001-07-12 16:21:22 by simonpj] · ab46fd8e
      simonpj authored
      --------------------------------------------
      	Fix another bug in the squash-newtypes story.
      	--------------------------------------------
      
      [This one was spotted by Marcin, and is now enshrined in test tc130.]
      
      The desugarer straddles the boundary between the type checker and
      Core, so it sometimes needs to look through newtypes/implicit parameters
      and sometimes not.  This is really a bit painful, but I can't think of
      a better way to do it.
      
      The only simple way to fix things was to pass a bit more type
      information in the HsExpr type, from the type checker to the desugarer.
      That led to the non-local changes you can see.
      
      On the way I fixed one other thing.  In various HsSyn constructors
      there is a Type that is bogus (bottom) before the type checker, and
      filled in with a real type by the type checker.  In one place it was
      a (Maybe Type) which was Nothing before, and (Just ty) afterwards.
      I've defined a type synonym HsTypes.PostTcType for this, and a named
      bottom value HsTypes.placeHolderType to use when you want the bottom
      value.
      ab46fd8e
  8. 15 Jun, 2001 1 commit
    • simonpj's avatar
      [project @ 2001-06-15 08:29:57 by simonpj] · 972d6442
      simonpj authored
      Some tidying up
      
      * Remove CmStaticInfo
         - GhciMode moves to HscTypes
         - The package stuff moves to new module main/Packages.lhs
      
      [put any package-related stuff in the new module]
      
      * Add Outputable.docToSDoc
      972d6442
  9. 01 Jun, 2001 1 commit
  10. 31 May, 2001 1 commit
    • simonmar's avatar
      [project @ 2001-05-31 11:32:25 by simonmar] · e0a941b9
      simonmar authored
      - add -hidir flag to control the destination for .hi files when doing
        multiple compilations (matches -odir).
      
      - change the ml_hi_file component of ModuleLocation from Maybe FilePath to
        FilePath.  We never made use of its Maybeness.
      
      - clear out some unused code from the Hsc phase of run_phase and clean up
        a bit.  Fix a bug with the -ohi option at the same time (I don't think
        it works in 5.xx.x before this patch).
      e0a941b9
  11. 22 May, 2001 1 commit
    • simonpj's avatar
      [project @ 2001-05-22 13:43:14 by simonpj] · f16228e4
      simonpj authored
      -------------------------------------------
      	Towards generalising 'foreign' declarations
      	-------------------------------------------
      
      This is a first step towards generalising 'foreign' declarations to
      handle langauges other than C.  Quite a lot of files are touched,
      but nothing has really changed.  Everything should work exactly as
      before.
      
      	But please be on your guard for ccall-related bugs.
      
      Main things
      
      Basic data types: ForeignCall.lhs
      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      * Remove absCSyn/CallConv.lhs
      
      * Add prelude/ForeignCall.lhs.  This defines the ForeignCall
        type and its variants
      
      * Define ForeignCall.Safety to say whether a call is unsafe
        or not (was just a boolean).  Lots of consequential chuffing.
      
      * Remove all CCall stuff from PrimOp, and put it in ForeignCall
      
      
      Take CCallOp out of the PrimOp type (where it was always a glitch)
      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      * Add IdInfo.FCallId variant to the type IdInfo.GlobalIdDetails,
      	along with predicates Id.isFCallId, Id.isFCallId_maybe
      
      * Add StgSyn.StgOp, to sum PrimOp with FCallOp, because it
        *is* useful to sum them together in Stg and AbsC land.  If
        nothing else, it minimises changes.
      
      
      Also generally rename "CCall" stuff to "FCall" where it's generic
      to all foreign calls.
      f16228e4
  12. 01 May, 2001 1 commit
  13. 26 Mar, 2001 1 commit
    • simonmar's avatar
      [project @ 2001-03-26 12:28:15 by simonmar] · 7d6569fb
      simonmar authored
      Simplify the foreign-export stub processing.
      
        - DynFlags now has fields for the stub.h and stub.c filenames, for
          consistency with the normal hsc output file name.
      
        - codeOutput puts the stubs into these files rather than dreaming
          up new temporary names for them
      
        - now we don't have to move the stubs into the right place in
          DriverPipeline.
      
        - we do however have to inject the correct #includes into the stub.c
          file when it is generated: I'm now injecting the same includes as
          the .hc file gets plus "RtsAPI.h", which is probably more correct
          than the hacky hardcoded "Stg.h" we had before.
      7d6569fb
  14. 19 Mar, 2001 2 commits
    • simonpj's avatar
      [project @ 2001-03-19 16:17:27 by simonpj] · 82d808ba
      simonpj authored
      -------------------------------
      PS to:	Improve orphan-module resolution
      	-------------------------------
      
      {This comment got missed out of the previous commit.}
      
      I also moved mkFinalIface from HscMain to MkIface, where it is much tidier.
      (This is related, because it's mkFinalIface that now sets mi_orphan.)
      82d808ba
    • simonpj's avatar
      [project @ 2001-03-19 16:13:22 by simonpj] · 17d765ce
      simonpj authored
      -------------------------------
      	Improve orphan-module resolution
      	-------------------------------
      
      Consider the following rule (and there are lots of these in
      the Prelude):
      
      	fromIntegral T = fromIntegral_T
      
      where T is defined in the module being compiled.
      
      is an orphan.  Of course it isn't, an declaring it an orphan would
      make the whole module an orphan module, which is bad.
      
      This commit arranges to determine orphan rules, and the orphan-hood
      of a module, much later than before.  (Before mi_orphan was set by
      the renamer, now it is set by MkIface.)
      17d765ce
  15. 15 Mar, 2001 1 commit
    • simonmar's avatar
      [project @ 2001-03-15 11:26:27 by simonmar] · cf2aab8a
      simonmar authored
      Do a better job of telling the user whether we're interpreting a
      module or using an existing object file.
      
      eg.
      
         Main> :load A
         Skipping  D                ( D.hs, D.o )
         Compiling C                ( C.hs, interpreted )
         Skipping  B                ( B.hs, B.o )
         Compiling Main             ( A.hs, interpreted )
         Main>
      cf2aab8a
  16. 14 Mar, 2001 1 commit
  17. 13 Mar, 2001 2 commits
    • simonmar's avatar
      [project @ 2001-03-13 17:08:36 by simonmar] · e9866166
      simonmar authored
      fix up for GHCi
      e9866166
    • simonmar's avatar
      [project @ 2001-03-13 12:50:29 by simonmar] · 10cbc75d
      simonmar authored
      Some rearrangements that Simon & I have been working on recently:
      
          - CoreSat is now CorePrep, and is a general "prepare-for-code-
            generation" pass.  It does cloning, saturation of constructors &
            primops, A-normal form, and a couple of other minor fiddlings.
      
          - CoreTidy no longer does cloning, and minor fiddlings.  It doesn't
            need the unique supply any more, so that's removed.
      
          - CoreToStg now collects CafInfo and the list of CafRefs for each
            binding.  The SRT pass is much simpler now.
      
          - IdInfo now has a CgInfo field for "code generator info".  It currently
            contains arity (the actual code gen arity which affects the calling
            convention as opposed to the ArityInfo which is a measure of how
            many arguments the Id can be applied to before it does any work), and
            CafInfo.
      
            Previously we overloaded the ArityInfo field to contain both
            codegen arity and simplifier arity.  Things are cleaner now.
      
          - CgInfo is collected by CoreToStg, and passed back into CoreTidy in
            a loop.  The compiler will complain rather than going into a black
            hole if the CgInfo is pulled on too early.
      
          - Worker info in an interface file now comes with arity info attached.
            Previously the main arity info was overloaded for this purpose, but
            it lead to a few hacks in the compiler, this tidies things up somewhat.
      
      Bottom line: we removed several fragilities, and tidied up a number of
      things.  Code size should be smaller, but we'll see...
      10cbc75d
  18. 08 Mar, 2001 2 commits
    • qrczak's avatar
      [project @ 2001-03-08 18:05:31 by qrczak] · 0171137c
      qrczak authored
      s/setIdGlobalDetails/sedGlobalIdDetails/, and import it.
      0171137c
    • simonpj's avatar
      [project @ 2001-03-08 12:07:38 by simonpj] · 51a571c0
      simonpj authored
      --------------------
      	A major hygiene pass
      	--------------------
      
      1. The main change here is to
      
      	Move what was the "IdFlavour" out of IdInfo,
      	and into the varDetails field of a Var
      
         It was a mess before, because the flavour was a permanent attribute
         of an Id, whereas the rest of the IdInfo was ephemeral.  It's
         all much tidier now.
      
         Main places to look:
      
      	   Var.lhs	Defn of VarDetails
      	   IdInfo.lhs	Defn of GlobalIdDetails
      
         The main remaining infelicity is that SpecPragmaIds are right down
         in Var.lhs, which seems unduly built-in for such an ephemeral thing.
         But that is no worse than before.
      
      
      2. Tidy up the HscMain story a little.  Move mkModDetails from MkIface
         into CoreTidy (where it belongs more nicely)
      
         This was partly forced by (1) above, because I didn't want to make
         DictFun Ids into a separate kind of Id (which is how it was before).
         Not having them separate means we have to keep a list of them right
         through, rather than pull them out of the bindings at the end.
      
      3. Add NameEnv as a separate module (to join NameSet).
      
      4. Remove unnecessary {-# SOURCE #-} imports from FieldLabel.
      51a571c0
  19. 06 Mar, 2001 1 commit
  20. 02 Mar, 2001 1 commit
  21. 01 Mar, 2001 1 commit
    • simonmar's avatar
      [project @ 2001-03-01 14:26:00 by simonmar] · 18b24e64
      simonmar authored
      GHCi fixes:
      
        - expressions are now compiled in a pseudo-module "$Interactive",
          which avoids some problems with storage of demand-loaded declarations.
      
        - compilation manager now detects when it needs to read the interace
          for a module, even if it is already compiled.  GHCi never demand-loads
          interfaces now.
      
        - (from Simon PJ) fix a problem with the recompilation checker, which
          meant that modules were sometimes not recompiled when they should
          have been.
      
        - ByteCodeGen/Link: move linker related stuff into ByteCodeLink.
      18b24e64
  22. 28 Feb, 2001 1 commit
  23. 27 Feb, 2001 1 commit
  24. 26 Feb, 2001 3 commits
    • simonmar's avatar
      [project @ 2001-02-26 16:43:31 by simonmar] · 252fd0cd
      simonmar authored
      Update the interactive context in cmRunStmt rather than hscMain.
      252fd0cd
    • simonmar's avatar
      [project @ 2001-02-26 15:50:21 by simonmar] · 436d7d67
      simonmar authored
      - message wibbles
      
      - in one-shot mode, make sure the interface file follows the module rather
        than the filename of the source.
      436d7d67
    • simonmar's avatar
      [project @ 2001-02-26 15:06:57 by simonmar] · 1c62b517
      simonmar authored
      Implement do-style bindings on the GHCi command line.
      
      The syntax for a command-line is exactly that of a do statement, with
      the following meanings:
      
        - `pat <- expr'
          performs expr, and binds each of the variables in pat.
      
        - `let pat = expr; ...'
          binds each of the variables in pat, doesn't do any evaluation
      
        - `expr'
          behaves as `it <- expr' if expr is IO-typed, or `let it = expr'
          followed by `print it' otherwise.
      1c62b517
  25. 23 Feb, 2001 1 commit
  26. 20 Feb, 2001 2 commits
    • qrczak's avatar
      [project @ 2001-02-20 18:40:54 by qrczak] · 8c2df3ea
      qrczak authored
      Apply tweaks needed to let this compile: remove syn_map argument from
      typecheckExpr in HscMain, import PrelNum.fromInt to modules which
      use integer literals with -fno-implicit-prelude flag.
      
      It crashes later, on Directory.hs:
      ghc: panic! (the `impossible' happened):
              srtExpr
      
      I'm not sure if resolving numeric literals to top-level definitions
      of fromInt/fromInteger with -fno-implicit-prelude is a good idea.
      Using names from whatever module is called Prelude would be IMHO
      better, probably when -fglasgow-exts is given. Prel* modules themselves
      would import PrelNum as Prelude.
      
      Both schemes break for fromInt, which is non-standard and by default
      it's visible neither at the top level nor in the Prelude module. My
      proposal for dealing with it is as follows (assuming that fromInteger
      is taken from the module locally called Prelude instead of the top
      level): when the standard Prelude is used, take fromInt from PrelNum;
      when a Prelude replacement is used, use fromInt from it if available,
      otherwise use its fromInteger instead. That way Prelude replacements
      can ignore this non-standard extension and get the expected behavior,
      or they can also choose to use this extension (in a way compatible
      with Haskell implementations which allow to replace Prelude but don't
      have fromInt).
      8c2df3ea
    • simonpj's avatar
      [project @ 2001-02-20 09:38:59 by simonpj] · d5c7622a
      simonpj authored
      Back end changes [CgExpr, ClosureInfo, CoreSat, CoreUtils,
      ~~~~~~~~~~~~~~~~  CmdLineOpts, HscMain, CoreToStg, StgSyn]
      * Move CoreTidy and interface-file dumping *before* CoreSat.
        In this way interface files are not in A-normal form, so
        they are less bulky, and a bit easier to use as input to
        the optimiser.  
      
        So now CoreSat is regarded as a pre-pass to CoreToStg.
        Since CoreTidy pins on utterly-final IdInfo, CoreSat has to
        be very careful not to change the arity of any function.
      
      * CoreSat uses OrdList instead of lists to collect floating binds
        This in turn meant I could simplify the FloatingBind type a bit
      
      * Greatly simplfy the StgBinderInfo data type.  It was 
        gathering far more information than we needed.
      
      * Add a flag -fkeep-stg-types, which keeps type abstractions
        and applications in STG code, for the benefit of code generators
        that are typed; notably the .NET ILX code generator.
      d5c7622a
  27. 14 Feb, 2001 1 commit
  28. 07 Feb, 2001 2 commits
  29. 01 Feb, 2001 1 commit
    • simonmar's avatar
      [project @ 2001-02-01 11:49:32 by simonmar] · 31853d3e
      simonmar authored
      Fix two bugs:
      
      - the typechecker wasn't attempting to resolve all the overloading when
        forcing an expression to IO type.  Now typing '1' at the prompt works
        again.
      
      - the typechecker was attempting to check for Main.main even when
        we had avoided recompilation of Main.
      31853d3e
  30. 30 Jan, 2001 1 commit
    • simonmar's avatar
      [project @ 2001-01-30 10:53:22 by simonmar] · 675a9a5d
      simonmar authored
      Don't discard top-level functions in interactive mode, even if they're
      not exported.  When typing expressions in the context of a module, the
      entire top-level scope of the module should be available.
      675a9a5d
  31. 25 Jan, 2001 1 commit
    • simonpj's avatar
      [project @ 2001-01-25 17:47:12 by simonpj] · ab7fb945
      simonpj authored
      A big improvement to the way command-line expressions are typechecked.
      Now we don't wrap in "print" and hope for the best (the wrong "print"
      might be in scope).  Instead we work on the renamed epxression and
      do the Right Thing by using the correct "print".
      
      Also do generalisation, so that we get the right type back from
      the :t command.
      
      WARNING: it's possible that these files overlap with my fortcoming
      Big Commit of typechecker stuff, so you may need to hang on for
      a few mins.
      ab7fb945
  32. 19 Jan, 2001 1 commit
  33. 18 Jan, 2001 1 commit