[commit: ghc] master: UNREG: add a forward declaration for local literals (4441f90)

git at git.haskell.org git at git.haskell.org
Sun Jan 29 21:25:57 UTC 2017


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

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

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

commit 4441f90738e27ea7ba368723f27d19c03093aa66
Author: Sergei Trofimovich <siarheit at google.com>
Date:   Sun Jan 29 21:11:40 2017 +0000

    UNREG: add a forward declaration for local literals
    
    When toplevel literals don't have a way to be exported
    from module GHC infers their labels as static.
    
    Example from GHC.Arr:
        static char rdVA_bytes[] = " out of range ";
    
    When this label is used in module internally
    we also need to provide it's forward declaration.
    
    Signed-off-by: Sergei Trofimovich <siarheit at google.com>


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

4441f90738e27ea7ba368723f27d19c03093aa66
 includes/Stg.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/includes/Stg.h b/includes/Stg.h
index e3de331..939bed6 100644
--- a/includes/Stg.h
+++ b/includes/Stg.h
@@ -224,6 +224,7 @@ typedef StgWord StgWordArray[];
 typedef StgFunPtr       F_;
 
 #define EB_(X)    extern char X[]
+#define IB_(X)    static char X[]
 #define EI_(X)          extern StgWordArray (X) GNU_ATTRIBUTE(aligned (8))
 #define II_(X)          static StgWordArray (X) GNU_ATTRIBUTE(aligned (8))
 #define IF_(f)    static StgFunPtr GNUC3_ATTRIBUTE(used) f(void)



More information about the ghc-commits mailing list