[commit: ghc] master: llvmGen: Compatibility with LLVM 3.5 (re #9142) (e16a342)
git at git.haskell.org
git at git.haskell.org
Fri Nov 21 21:31:54 UTC 2014
Repository : ssh://git@git.haskell.org/ghc
On branch : master
Link : http://ghc.haskell.org/trac/ghc/changeset/e16a342d70b92fc8480793d3ec911853f0c31e44/ghc
>---------------------------------------------------------------
commit e16a342d70b92fc8480793d3ec911853f0c31e44
Author: Ben Gamari <bgamari.foss at gmail.com>
Date: Fri Nov 21 21:05:25 2014 +0100
llvmGen: Compatibility with LLVM 3.5 (re #9142)
Due to changes in LLVM 3.5 aliases now may only refer to definitions.
Previously to handle symbols defined outside of the current commpilation
unit GHC would emit both an `external` declaration, as well as an alias
pointing to it, e.g.,
@stg_BCO_info = external global i8
@stg_BCO_info$alias = alias private i8* @stg_BCO_info
Where references to `stg_BCO_info` will use the alias
`stg_BCO_info$alias`. This is not permitted under the new alias
behavior, resulting in errors resembling,
Alias must point to a definition
i8* @"stg_BCO_info$alias"
To fix this, we invert the naming relationship between aliases and
definitions. That is, now the symbol definition takes the name
`@stg_BCO_info$def` and references use the actual name, `@stg_BCO_info`.
This means the external symbols can be handled by simply emitting an
`external` declaration,
@stg_BCO_info = external global i8
Whereas in the case of a forward declaration we emit,
@stg_BCO_info = alias private i8* @stg_BCO_info$def
Reviewed By: austin
Differential Revision: https://phabricator.haskell.org/D155
>---------------------------------------------------------------
e16a342d70b92fc8480793d3ec911853f0c31e44
compiler/llvmGen/Llvm/Types.hs | 3 +-
compiler/llvmGen/LlvmCodeGen.hs | 5 +-
compiler/llvmGen/LlvmCodeGen/Base.hs | 102 +++++++++++++++++++++++++++++------
compiler/llvmGen/LlvmCodeGen/Data.hs | 10 ++--
compiler/llvmGen/LlvmCodeGen/Ppr.hs | 38 ++++++++++---
5 files changed, 127 insertions(+), 31 deletions(-)
Diff suppressed because of size. To see it, use:
git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc e16a342d70b92fc8480793d3ec911853f0c31e44
More information about the ghc-commits
mailing list