[commit: ghc] master: Have Core linter accept programs using StaticPointers and -fhpc. (7fc20b0)

git at git.haskell.org git at git.haskell.org
Thu Jun 23 14:05:43 UTC 2016


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

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

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

commit 7fc20b02b20c97209b97f0e36d34a4ef40f537a4
Author: Facundo Domínguez <facundo.dominguez at tweag.io>
Date:   Wed Jun 22 14:09:57 2016 -0300

    Have Core linter accept programs using StaticPointers and -fhpc.
    
    Summary:
    This patch uses collectArgsTicks instead of collectArgs to test that
    StaticPtr only occurs at the top of RHSs of top-level expressions.
    
    Ticks introduced by -fhpc would interfere otherwise.
    
    Test Plan: ./validate
    
    Reviewers: thomie, austin, goldfire, bgamari, simonpj
    
    Reviewed By: simonpj
    
    Differential Revision: https://phabricator.haskell.org/D2355
    
    GHC Trac Issues: #12207


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

7fc20b02b20c97209b97f0e36d34a4ef40f537a4
 compiler/coreSyn/CoreLint.hs                   | 2 +-
 testsuite/tests/typecheck/should_compile/all.T | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/compiler/coreSyn/CoreLint.hs b/compiler/coreSyn/CoreLint.hs
index 06e45830..e7acafc 100644
--- a/compiler/coreSyn/CoreLint.hs
+++ b/compiler/coreSyn/CoreLint.hs
@@ -552,7 +552,7 @@ lintRhs :: CoreExpr -> LintM OutType
 -- but produce errors otherwise.
 lintRhs rhs
     | (binders0, rhs') <- collectTyBinders rhs
-    , (fun@(Var b), args) <- collectArgs rhs'
+    , (fun@(Var b), args, _) <- collectArgsTicks (const True) rhs'
     , Just con <- isDataConId_maybe b
     , dataConName con == staticPtrDataConName
     , length args == 5
diff --git a/testsuite/tests/typecheck/should_compile/all.T b/testsuite/tests/typecheck/should_compile/all.T
index 0f222aa..7e3c33f 100644
--- a/testsuite/tests/typecheck/should_compile/all.T
+++ b/testsuite/tests/typecheck/should_compile/all.T
@@ -421,8 +421,8 @@ test('T8474', normal, compile, [''])
 test('T8563', normal, compile, [''])
 test('T8565', normal, compile, [''])
 test('T8644', normal, compile, [''])
-test('TcStaticPointers01', expect_broken_for(12207, ['hpc']), compile, [''])
-test('TcStaticPointers02', expect_broken_for(12207, ['hpc']), compile, [''])
+test('TcStaticPointers01', normal, compile, [''])
+test('TcStaticPointers02', normal, compile, [''])
 test('T8762', normal, compile, [''])
 test('MutRec', normal, compile, [''])
 test('T8856', normal, compile, [''])



More information about the ghc-commits mailing list