[commit: ghc] master: ApiAnnotations : strings in warnings do not return SourceText (e6191d1)

git at git.haskell.org git at git.haskell.org
Mon Jun 1 12:16:40 UTC 2015


Repository : ssh://git@git.haskell.org/ghc

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/e6191d1cc37e98785af8b309100ea840084fa3ba/ghc

>---------------------------------------------------------------

commit e6191d1cc37e98785af8b309100ea840084fa3ba
Author: Alan Zimmerman <alan.zimm at gmail.com>
Date:   Mon Jun 1 14:16:41 2015 +0200

    ApiAnnotations : strings in warnings do not return SourceText
    
    Summary:
    The strings used in a WARNING pragma are captured via
    
        strings :: { Located ([AddAnn],[Located FastString]) }
            : STRING { sL1 $1 ([],[L (gl $1) (getSTRING $1)]) }
        ..
    
    The STRING token has a method getSTRINGs that returns the original
    source text for a string.
    
    A warning of the form
    
        {-# WARNING Logic
                  , mkSolver
                  , mkSimpleSolver
                  , mkSolverForLogic
                  , solverSetParams
                  , solverPush
                  , solverPop
                  , solverReset
                  , solverGetNumScopes
                  , solverAssertCnstr
                  , solverAssertAndTrack
                  , solverCheck
                  , solverCheckAndGetModel
                  , solverGetReasonUnknown
                  "New Z3 API support is still incomplete and fragile: \
                  \you may experience segmentation faults!"
          #-}
    
    returns the concatenated warning string rather than the original source.
    
    This patch now deals with all remaining instances of getSTRING to bring
    in a SourceText for each.
    
    This updates the haddock submodule as well, for the AST change.
    
    Test Plan: ./validate
    
    Reviewers: hvr, austin, goldfire
    
    Reviewed By: austin
    
    Subscribers: bgamari, thomie, mpickering
    
    Differential Revision: https://phabricator.haskell.org/D907
    
    GHC Trac Issues: #10313


>---------------------------------------------------------------

e6191d1cc37e98785af8b309100ea840084fa3ba
 compiler/basicTypes/BasicTypes.hs                  | 14 +++--
 compiler/codeGen/StgCmmForeign.hs                  |  4 +-
 compiler/deSugar/Desugar.hs                        |  4 +-
 compiler/deSugar/DsCCall.hs                        |  3 +-
 compiler/deSugar/DsExpr.hs                         |  2 +-
 compiler/deSugar/DsForeign.hs                      | 15 +++--
 compiler/deSugar/DsMeta.hs                         | 12 ++--
 compiler/ghci/ByteCodeGen.hs                       |  4 +-
 compiler/hsSyn/Convert.hs                          |  5 +-
 compiler/hsSyn/HsDecls.hs                          | 13 +++--
 compiler/hsSyn/HsExpr.hs                           | 13 +++--
 compiler/hsSyn/HsImpExp.hs                         |  6 +-
 compiler/iface/MkIface.hs                          |  2 +-
 compiler/main/DriverMkDepend.hs                    |  2 +-
 compiler/main/GhcMake.hs                           |  3 +-
 compiler/main/HscMain.hs                           |  2 +-
 compiler/parser/Parser.y                           | 40 ++++++-------
 compiler/parser/RdrHsSyn.hs                        | 19 +++---
 compiler/prelude/ForeignCall.hs                    | 38 +++++++-----
 compiler/prelude/TysWiredIn.hs                     | 22 +++----
 compiler/rename/RnNames.hs                         |  8 +--
 compiler/rename/RnSource.hs                        |  9 +--
 compiler/stgSyn/CoreToStg.hs                       |  3 +-
 compiler/typecheck/TcForeign.hs                    |  8 +--
 compiler/typecheck/TcRules.hs                      | 10 ++--
 ghc/InteractiveUI.hs                               |  7 ++-
 testsuite/tests/ghc-api/annotations/.gitignore     |  1 +
 testsuite/tests/ghc-api/annotations/Makefile       |  6 ++
 testsuite/tests/ghc-api/annotations/T10313.stderr  | 29 ++++++++++
 testsuite/tests/ghc-api/annotations/T10313.stdout  | 27 +++++++++
 testsuite/tests/ghc-api/annotations/Test10313.hs   | 38 ++++++++++++
 testsuite/tests/ghc-api/annotations/all.T          |  1 +
 .../annotations/{parseTree.hs => stringSource.hs}  | 67 +++++++++++++++++-----
 utils/haddock                                      |  2 +-
 34 files changed, 304 insertions(+), 135 deletions(-)

Diff suppressed because of size. To see it, use:

    git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc e6191d1cc37e98785af8b309100ea840084fa3ba


More information about the ghc-commits mailing list