1. 07 Nov, 2015 1 commit
    • Bartosz Nitka's avatar
      Add pprSTrace for debugging with call stacks · 80d7ce80
      Bartosz Nitka authored
      I've spent quite a bit of time giving unique labels to my `pprTrace`
      calls and then trying to intuit where the function is called from.
      Thanks to the new implicit parameter CallStack functionality I don't
      have to do that anymore.
      
      Test Plan: harbormaster
      
      Reviewers: austin, simonmar, bgamari
      
      Reviewed By: simonmar, bgamari
      
      Subscribers: thomie
      
      Differential Revision: https://phabricator.haskell.org/D1440
      80d7ce80
  2. 15 Oct, 2015 1 commit
  3. 15 Sep, 2015 1 commit
    • Sebastian Reuße's avatar
      Pretty: fix unicode arrow operators. · 14c4090e
      Sebastian Reuße authored
      As per issue #10509, the documentation gave the wrong glyphs for Unicode
      alternatives to the -< and >- arrow operators (the codepoints were
      correct, but the glyphs were not). The incorrect glyphs have also
      made it into the error output. This replaces those characters with the
      correct versions.
      
      GHC Trac Issues: #10883
      14c4090e
  4. 11 Sep, 2015 1 commit
  5. 03 Sep, 2015 1 commit
  6. 21 Aug, 2015 1 commit
    • thomie's avatar
      Refactor: delete most of the module FastTypes · 2f29ebbb
      thomie authored
      This reverses some of the work done in #1405, and goes back to the
      assumption that the bootstrap compiler understands GHC-haskell.
      
      In particular:
        * use MagicHash instead of _ILIT and _CLIT
        * pattern matching on I# if possible, instead of using iUnbox
          unnecessarily
        * use Int#/Char#/Addr# instead of the following type synonyms:
          - type FastInt   = Int#
          - type FastChar  = Char#
          - type FastPtr a = Addr#
        * inline the following functions:
          - iBox           = I#
          - cBox           = C#
          - fastChr        = chr#
          - fastOrd        = ord#
          - eqFastChar     = eqChar#
          - shiftLFastInt  = uncheckedIShiftL#
          - shiftR_FastInt = uncheckedIShiftRL#
          - shiftRLFastInt = uncheckedIShiftRL#
        * delete the following unused functions:
          - minFastInt
          - maxFastInt
          - uncheckedIShiftRA#
          - castFastPtr
          - panicDocFastInt and pprPanicFastInt
        * rename panicFastInt back to panic#
      
      These functions remain, since they actually do something:
        * iUnbox
        * bitAndFastInt
        * bitOrFastInt
      
      Test Plan: validate
      
      Reviewers: austin, bgamari
      
      Subscribers: rwbarton
      
      Differential Revision: https://phabricator.haskell.org/D1141
      
      GHC Trac Issues: #1405
      2f29ebbb
  7. 05 Aug, 2015 2 commits
  8. 03 Aug, 2015 1 commit
  9. 22 Jul, 2015 1 commit
  10. 07 Apr, 2015 1 commit
    • Simon Peyton Jones's avatar
      Reduce module qualifiers in pretty-printing · 547c5971
      Simon Peyton Jones authored
      The change is in HscTypes.mkPrintUnqualified, and suppresses the
      module qualifier on Names from ghc-prim, base, and template-haskell,
      where no ambiguity can aries.  It's somewhat arbitrary, but helps
      with things like 'Constraint' which are often not in scope, but
      occasionally show up in error messages.
      547c5971
  11. 16 Mar, 2015 1 commit
    • thomie's avatar
      Dont call unsafeGlobalDynFlags if it is not set · 5166ee94
      thomie authored
      Parsing of static and mode flags happens before any session is started,
      i.e., before the first call to 'GHC.withGhc'. Therefore, to report
      errors for invalid usage of these two types of flags, we can not call
      any function that needs DynFlags, as there are no DynFlags available yet
      (unsafeGlobalDynFlags is not set either). So we always print "on the
      commandline" as the location, which is true except for Api users, which
      is probably ok.
      
      When reporting errors for invalid usage of dynamic flags we /can/ make
      use of DynFlags, and we do so explicitly in
      DynFlags.parseDynamicFlagsFull.
      
      Before, we called unsafeGlobalDynFlags when an invalid (combination of)
      flag(s) was given on the commandline, resulting in panics (#9963). This
      regression was introduced in 1d6124de.
      
      Also rename showSDocSimple to showSDocUnsafe, to hopefully prevent this
      from happening again.
      
      Reviewed By: austin
      
      Differential Revision: https://phabricator.haskell.org/D730
      
      GHC Trac Issues: #9963
      5166ee94
  12. 09 Mar, 2015 3 commits
  13. 03 Mar, 2015 1 commit
    • thomie's avatar
      Pretty-print # on unboxed literals in core · 89458eba
      thomie authored
      Summary:
      Ticket #10104 dealt with showing the '#'s on types with unboxed fields. This
      commit pretty prints the '#'s on unboxed literals in core output.
      
      Test Plan: simplCore/should_compile/T8274
      
      Reviewers: jstolarek, simonpj, austin
      
      Reviewed By: simonpj, austin
      
      Subscribers: simonpj, thomie
      
      Differential Revision: https://phabricator.haskell.org/D678
      
      GHC Trac Issues: #8274
      89458eba
  14. 03 Dec, 2014 1 commit
  15. 04 Nov, 2014 1 commit
  16. 25 Aug, 2014 1 commit
    • Simon Peyton Jones's avatar
      Use DumpStyle rather than UserStyle for pprTrace output · 9f8754eb
      Simon Peyton Jones authored
      The main motivation is that user-style output assumes that everything has been
      tidied, not enough uniques are printed by default.
      
      The downside is that pprTrace output now has module prefixes which can be overwhelming,
      but -dsuppress-module-prefixes will suppress them.
      9f8754eb
  17. 05 Aug, 2014 1 commit
    • Edward Z. Yang's avatar
      Package keys (for linking/type equality) separated from package IDs. · 66218d15
      Edward Z. Yang authored
      This patch set makes us no longer assume that a package key is a human
      readable string, leaving Cabal free to "do whatever it wants" to allocate
      keys; we'll look up the PackageId in the database to display to the user.
      This also means we have a new level of qualifier decisions to make at the
      package level, and rewriting some Safe Haskell error reporting code to DTRT.
      
      Additionally, we adjust the build system to use a new ghc-cabal output
      Make variable PACKAGE_KEY to determine library names and other things,
      rather than concatenating PACKAGE/VERSION as before.
      
      Adds a new `-this-package-key` flag to subsume the old, erroneously named
      `-package-name` flag, and `-package-key` to select packages by package key.
      
      RFC: The md5 hashes are pretty tough on the eye, as far as the file
      system is concerned :(
      
      ToDo: safePkg01 test had its output updated, but the fix is not really right:
      the rest of the dependencies are truncated due to the fact the we're only
      grepping a single line, but ghc-pkg is wrapping its output.
      
      ToDo: In a later commit, update all submodules to stop using -package-name
      and use -this-package-key.  For now, we don't do it to avoid submodule
      explosion.
      Signed-off-by: default avatarEdward Z. Yang <ezyang@cs.stanford.edu>
      
      Test Plan: validate
      
      Reviewers: simonpj, simonmar, hvr, austin
      
      Subscribers: simonmar, relrod, carter
      
      Differential Revision: https://phabricator.haskell.org/D80
      66218d15
  18. 06 Jun, 2014 2 commits
  19. 24 Apr, 2014 1 commit
  20. 25 Feb, 2014 1 commit
  21. 10 Jan, 2014 1 commit
    • Simon Peyton Jones's avatar
      Make showSDoc and friends respect -dppr-cols · 08a3536e
      Simon Peyton Jones authored
      Previously they just used a fixed width of 100, ignoring
      -dppr-cols.  I think this dates back to a time when
      the flag didn't exist, or wasn't conveniently available.
      
      Thanks to Andrew Gibiansky for pointing this out.
      08a3536e
  22. 09 Jan, 2014 1 commit
    • Simon Peyton Jones's avatar
      Re-work the naming story for the GHCi prompt (Trac #8649) · 73c08ab1
      Simon Peyton Jones authored
      The basic idea here is simple, and described in Note [The interactive package]
      in HscTypes, which starts thus:
      
          Note [The interactive package]
          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          Type and class declarations at the command prompt are treated as if
          they were defined in modules
             interactive:Ghci1
             interactive:Ghci2
             ...etc...
          with each bunch of declarations using a new module, all sharing a
          common package 'interactive' (see Module.interactivePackageId, and
          PrelNames.mkInteractiveModule).
      
          This scheme deals well with shadowing.  For example:
      
             ghci> data T = A
             ghci> data T = B
             ghci> :i A
             data Ghci1.T = A  -- Defined at <interactive>:2:10
      
          Here we must display info about constructor A, but its type T has been
          shadowed by the second declaration.  But it has a respectable
          qualified name (Ghci1.T), and its source location says where it was
          defined.
      
          So the main invariant continues to hold, that in any session an original
          name M.T only refers to oe unique thing.  (In a previous iteration both
          the T's above were called :Interactive.T, albeit with different uniques,
          which gave rise to all sorts of trouble.)
      
      This scheme deals nicely with the original problem.  It allows us to
      eliminate a couple of grotseque hacks
        - Note [Outputable Orig RdrName] in HscTypes
        - Note [interactive name cache] in IfaceEnv
      (both these comments have gone, because the hacks they describe are no
      longer necessary). I was also able to simplify Outputable.QueryQualifyName,
      so that it takes a Module/OccName as args rather than a Name.
      
      However, matters are never simple, and this change took me an
      unreasonably long time to get right.  There are some details in
      Note [The interactive package] in HscTypes.
      73c08ab1
  23. 13 Sep, 2013 1 commit
  24. 27 Jun, 2013 1 commit
    • Peter Wortmann's avatar
      Use SDoc for all LLVM pretty-printing · 99d39221
      Peter Wortmann authored
      This patch reworks some parts of the LLVM pretty-printing code that were
      still using Show and String. Now we should be using SDoc and Outputable
      throughout. Note that many get*Name functions become pp*Name
      here as a side-effect.
      99d39221
  25. 24 Jun, 2013 1 commit
    • Simon Peyton Jones's avatar
      Make sure that Pretty.text is inlined in stage 0, · d2c3630d
      Simon Peyton Jones authored
      so that RULE text/str gets a chance to fire (Trac #7995).
      
      And make sure that Outputable.text is inlined, so that the underlying
      Pretty.text rule can fire.
      
      The thing is that literal strings only turn into unpackCString#
      in phase 1.
      d2c3630d
  26. 09 Mar, 2013 1 commit
  27. 24 Feb, 2013 1 commit
  28. 14 Feb, 2013 1 commit
    • Simon Peyton Jones's avatar
      Add OverloadedLists, allowing list syntax to be overloaded · 3234a4ad
      Simon Peyton Jones authored
      This work was all done by
         Achim Krause <achim.t.krause@gmail.com>
         George Giorgidze <giorgidze@gmail.com>
         Weijers Jeroen <jeroen.weijers@uni-tuebingen.de>
      
      It allows list syntax, such as [a,b], [a..b] and so on, to be
      overloaded so that it works for a variety of types.
      
      The design is described here:
          http://hackage.haskell.org/trac/ghc/wiki/OverloadedLists
      
      Eg. you can use it for maps, so that
              [(1,"foo"), (4,"bar")] :: Map Int String
      
      The main changes
       * The ExplicitList constructor of HsExpr gets witness field
       * Ditto ArithSeq constructor
       * Ditto the ListPat constructor of HsPat
      
      Everything else flows from this.
      3234a4ad
  29. 29 Jan, 2013 1 commit
  30. 14 Dec, 2012 2 commits
  31. 04 Dec, 2012 2 commits
  32. 21 Nov, 2012 1 commit
  33. 08 Oct, 2012 1 commit
    • ian@well-typed.com's avatar
      Put the DynFlags in a global variable for tracing; fixes #7304 · f7cd14fd
      ian@well-typed.com authored
      This is an ugly kludge to make a DynFlags value available for the
      'trace' functions. It may not be the value we really ought to use,
      but it'll be good enough for the pretty-printer to use.
      
      Ideally we'd pass the real DynFlags down to all the trace calls,
      but this will do for now at least.
      f7cd14fd
  34. 05 Aug, 2012 1 commit