summaryrefslogtreecommitdiff
path: root/compiler/cmm/CLabel.hs
diff options
context:
space:
mode:
authorSergei Trofimovich <siarheit@google.com>2017-01-29 18:39:48 +0000
committerSergei Trofimovich <siarheit@google.com>2017-01-29 18:48:09 +0000
commit34a0205587c8c6017a26ddf7023e91789da2e81b (patch)
tree36f82fc0aaaa5d3dd652974bb830767c4ed3f227 /compiler/cmm/CLabel.hs
parentbc42e2b03a87e3f6c0d24584382f281c6580801b (diff)
downloadhaskell-34a0205587c8c6017a26ddf7023e91789da2e81b.tar.gz
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>
Diffstat (limited to 'compiler/cmm/CLabel.hs')
-rw-r--r--compiler/cmm/CLabel.hs6
1 files changed, 6 insertions, 0 deletions
diff --git a/compiler/cmm/CLabel.hs b/compiler/cmm/CLabel.hs
index ee87ef1b37..2f382039be 100644
--- a/compiler/cmm/CLabel.hs
+++ b/compiler/cmm/CLabel.hs
@@ -89,6 +89,7 @@ module CLabel (
addLabelSize,
foreignLabelStdcallInfo,
+ isBytesLabel,
isForeignLabel,
mkCCLabel, mkCCSLabel,
@@ -573,6 +574,11 @@ addLabelSize (ForeignLabel str _ src fod) sz
addLabelSize label _
= label
+-- | Whether label is a top-level string literal
+isBytesLabel :: CLabel -> Bool
+isBytesLabel (IdLabel _ _ Bytes) = True
+isBytesLabel _lbl = False
+
-- | Whether label is a non-haskell label (defined in C code)
isForeignLabel :: CLabel -> Bool
isForeignLabel (ForeignLabel _ _ _ _) = True