[commit: ghc] master: StaticPointers: Allow closed vars in the static form. (36d29f7)
git at git.haskell.org
git at git.haskell.org
Mon May 2 17:27:23 UTC 2016
Repository : ssh://git@git.haskell.org/ghc
On branch : master
Link : http://ghc.haskell.org/trac/ghc/changeset/36d29f7ce332a2b1fbc36de831b0eef7a6405555/ghc
>---------------------------------------------------------------
commit 36d29f7ce332a2b1fbc36de831b0eef7a6405555
Author: Facundo Domínguez <facundo.dominguez at tweag.io>
Date: Thu Apr 7 16:20:19 2016 -0300
StaticPointers: Allow closed vars in the static form.
Summary:
With this patch closed variables are allowed regardless of whether
they are bound at the top level or not.
The FloatOut pass is always performed. When optimizations are
disabled, only expressions that go to the top level are floated.
Thus, the applications of the StaticPtr data constructor are always
floated.
The CoreTidy pass makes sure the floated applications appear in the
symbol table of object files. It also collects the floated bindings
and inserts them in the static pointer table.
The renamer does not check anymore if free variables appearing in the
static form are top-level. Instead, the typechecker looks at the
tct_closed flag to decide if the free variables are closed.
The linter checks that applications of StaticPtr only occur at the
top of top-level bindings after the FloatOut pass.
The field spInfoName of StaticPtrInfo has been removed. It used to
contain the name of the top-level binding that contains the StaticPtr
application. However, this information is no longer available when the
StaticPtr is constructed, as the binding name is determined now by the
FloatOut pass.
Test Plan: ./validate
Reviewers: goldfire, simonpj, austin, hvr, bgamari
Reviewed By: simonpj
Subscribers: thomie, mpickering, mboes
Differential Revision: https://phabricator.haskell.org/D2104
GHC Trac Issues: #11656
>---------------------------------------------------------------
36d29f7ce332a2b1fbc36de831b0eef7a6405555
compiler/coreSyn/CoreLint.hs | 69 +++++++++++-
compiler/coreSyn/CoreSyn.hs | 2 +-
compiler/deSugar/Coverage.hs | 2 +-
compiler/deSugar/Desugar.hs | 10 +-
compiler/deSugar/DsExpr.hs | 114 ++++++++-----------
compiler/deSugar/DsMeta.hs | 2 +-
compiler/deSugar/DsMonad.hs | 18 +--
compiler/deSugar/StaticPtrTable.hs | 97 ----------------
compiler/hsSyn/Convert.hs | 2 +-
compiler/hsSyn/HsBinds.hs | 6 +-
compiler/hsSyn/HsExpr.hs | 6 +-
compiler/main/StaticPtrTable.hs | 125 +++++++++++++++++++++
compiler/main/TidyPgm.hs | 30 +++--
compiler/parser/Parser.y | 2 +-
compiler/rename/RnExpr.hs | 24 +---
compiler/simplCore/CoreMonad.hs | 10 +-
compiler/simplCore/SetLevels.hs | 12 +-
compiler/simplCore/SimplCore.hs | 45 +++++++-
compiler/typecheck/TcExpr.hs | 24 +++-
compiler/typecheck/TcHsSyn.hs | 4 +-
compiler/typecheck/TcRnTypes.hs | 3 -
docs/users_guide/8.0.2-notes.rst | 23 ++++
docs/users_guide/glasgow_exts.rst | 15 ++-
libraries/base/GHC/StaticPtr.hs | 26 +++--
libraries/base/changelog.md | 3 +
.../tests/codeGen/should_run/CgStaticPointers.hs | 6 +-
.../deSugar/should_run/DsStaticPointers.stdout | 10 +-
.../should_fail/RnStaticPointersFail01.stderr | 7 +-
.../rename/should_fail/RnStaticPointersFail03.hs | 8 ++
.../should_fail/RnStaticPointersFail03.stderr | 16 ++-
30 files changed, 445 insertions(+), 276 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 36d29f7ce332a2b1fbc36de831b0eef7a6405555
More information about the ghc-commits
mailing list