UNREG: fix "_bytes" string literal forward declaration
authorSergei Trofimovich <siarheit@google.com>
Sun, 29 Jan 2017 18:39:48 +0000 (18:39 +0000)
committerSergei Trofimovich <siarheit@google.com>
Sun, 29 Jan 2017 18:48:09 +0000 (18:48 +0000)
commit34a0205587c8c6017a26ddf7023e91789da2e81b
tree36f82fc0aaaa5d3dd652974bb830767c4ed3f227
parentbc42e2b03a87e3f6c0d24584382f281c6580801b
UNREG: fix "_bytes" string literal forward declaration

Typical UNREG build failure looks like that:

  ghc-unreg/includes/Stg.h:226:46: error:
     note: in definition of macro 'EI_'
     #define EI_(X)          extern StgWordArray (X) GNU_ATTRIBUTE(aligned (8))
                                                  ^
      |
  226 | #define EI_(X)          extern StgWordArray (X) GNU_ATTRIBUTE(aligned (8))
      |                                              ^

  /tmp/ghc10489_0/ghc_3.hc:1754:6: error:
     note: previous definition of 'ghczmprim_GHCziTypes_zdtcTyCon2_bytes' was here
     char ghczmprim_GHCziTypes_zdtcTyCon2_bytes[] = "TyCon";
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
       |
  1754 | char ghczmprim_GHCziTypes_zdtcTyCon2_bytes[] = "TyCon";
       |      ^

As we see here "_bytes" string literals are defined as 'char []'
array, not 'StgWord []'.

The change special-cases "_bytes" string literals to have
correct declaration type.

Signed-off-by: Sergei Trofimovich <siarheit@google.com>
compiler/cmm/CLabel.hs
compiler/cmm/PprC.hs
includes/Stg.h