ApiAnnotations : strings in warnings do not return SourceText
authorAlan Zimmerman <alan.zimm@gmail.com>
Mon, 1 Jun 2015 12:16:41 +0000 (14:16 +0200)
committerAlan Zimmerman <alan.zimm@gmail.com>
Mon, 1 Jun 2015 12:16:41 +0000 (14:16 +0200)
commite6191d1cc37e98785af8b309100ea840084fa3ba
tree94af94a1d98cf4bd5f7efd8bfc5d9696d3b02821
parent7dd0ea7428379df848e3d13528921b39b7bf5b95
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
34 files changed:
compiler/basicTypes/BasicTypes.hs
compiler/codeGen/StgCmmForeign.hs
compiler/deSugar/Desugar.hs
compiler/deSugar/DsCCall.hs
compiler/deSugar/DsExpr.hs
compiler/deSugar/DsForeign.hs
compiler/deSugar/DsMeta.hs
compiler/ghci/ByteCodeGen.hs
compiler/hsSyn/Convert.hs
compiler/hsSyn/HsDecls.hs
compiler/hsSyn/HsExpr.hs
compiler/hsSyn/HsImpExp.hs
compiler/iface/MkIface.hs
compiler/main/DriverMkDepend.hs
compiler/main/GhcMake.hs
compiler/main/HscMain.hs
compiler/parser/Parser.y
compiler/parser/RdrHsSyn.hs
compiler/prelude/ForeignCall.hs
compiler/prelude/TysWiredIn.hs
compiler/rename/RnNames.hs
compiler/rename/RnSource.hs
compiler/stgSyn/CoreToStg.hs
compiler/typecheck/TcForeign.hs
compiler/typecheck/TcRules.hs
ghc/InteractiveUI.hs
testsuite/tests/ghc-api/annotations/.gitignore
testsuite/tests/ghc-api/annotations/Makefile
testsuite/tests/ghc-api/annotations/T10313.stderr [new file with mode: 0644]
testsuite/tests/ghc-api/annotations/T10313.stdout [new file with mode: 0644]
testsuite/tests/ghc-api/annotations/Test10313.hs [new file with mode: 0644]
testsuite/tests/ghc-api/annotations/all.T
testsuite/tests/ghc-api/annotations/stringSource.hs [new file with mode: 0644]
utils/haddock