diff options
author | Peter Wortmann <scpmw@leeds.ac.uk> | 2013-06-26 15:43:45 +0100 |
---|---|---|
committer | David Terei <davidterei@gmail.com> | 2013-06-27 13:39:11 -0700 |
commit | 720a87c7ec967ff878f081bd3cc810cae3fe4a50 (patch) | |
tree | 925703005df243eb21e175ebf9d817e998292731 /compiler/llvmGen/LlvmCodeGen/Data.hs | |
parent | 99d39221cfa6f6b8ccf950763a73ad32edd7beef (diff) | |
download | haskell-720a87c7ec967ff878f081bd3cc810cae3fe4a50.tar.gz |
Extend globals to aliases
Also give them a proper constructor - getGlobalVar and getGlobalValue
map directly to the accessors.
Diffstat (limited to 'compiler/llvmGen/LlvmCodeGen/Data.hs')
-rw-r--r-- | compiler/llvmGen/LlvmCodeGen/Data.hs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/compiler/llvmGen/LlvmCodeGen/Data.hs b/compiler/llvmGen/LlvmCodeGen/Data.hs index 83b5453aa9..f31b3e5203 100644 --- a/compiler/llvmGen/LlvmCodeGen/Data.hs +++ b/compiler/llvmGen/LlvmCodeGen/Data.hs @@ -66,9 +66,9 @@ resolveLlvmData env (lbl, sec, alias, unres) = label = strCLabel_llvm env lbl link = if (externallyVisibleCLabel lbl) then ExternallyVisible else Internal - const = isSecConstant sec + const = if isSecConstant sec then Constant else Global glob = LMGlobalVar label alias link Nothing Nothing const - in (env', ((glob,struct):refs, [alias])) + in (env', ((LMGlobal glob struct):refs, [alias])) -- | Should a data in this section be considered constant isSecConstant :: Section -> Bool @@ -114,7 +114,7 @@ resData env (Left cmm@(CmmLabel l)) = in case ty of -- Make generic external label defenition and then pointer to it Nothing -> - let glob@(var, _) = genStringLabelRef dflags label + let glob@(LMGlobal var _) = genStringLabelRef dflags label env' = funInsert label (pLower $ getVarType var) env ptr = LMStaticPointer var in (env', LMPtoI ptr lmty, [glob]) @@ -122,7 +122,7 @@ resData env (Left cmm@(CmmLabel l)) = -- pointer to it. Just ty' -> let var = LMGlobalVar label (LMPointer ty') - ExternallyVisible Nothing Nothing False + ExternallyVisible Nothing Nothing Global ptr = LMStaticPointer var in (env, LMPtoI ptr lmty, []) |