]> git.lizzy.rs Git - rust.git/commit
Auto merge of #36200 - mattico:fix-llvm-linkage, r=arielb1
authorbors <bors@rust-lang.org>
Mon, 5 Sep 2016 15:13:32 +0000 (08:13 -0700)
committerGitHub <noreply@github.com>
Mon, 5 Sep 2016 15:13:32 +0000 (08:13 -0700)
commit3f50b6342db87f4a8fb76e70f6ada07331e062a2
tree953fd9d36fcf4b9b8fbe19d1be1b4de4285b88a0
parent58dc448f8c29d0262f2cde76a9d21343921b23fd
parentb9a8c1a06300c4d042b5455d83cacd689bad6283
Auto merge of #36200 - mattico:fix-llvm-linkage, r=arielb1

Fix incorrect LLVM Linkage enum

Followup of #33994 to actually work.

The `Linkage` enum in librustc_llvm got out of sync with the version in LLVM and it caused two variants of the `#[linkage=""]` attribute to break.

This adds the functions `LLVMRustGetLinkage` and `LLVMRustSetLinkage` which convert between the Rust Linkage enum and the LLVM one, which should stop this from breaking every time LLVM changes it.

Possible remaining concerns:

1. There could be a codegen test to make sure that the attributes are applied correctly (I don't know how to do this).
2. ~~The test does not exercise the `appending` linkage. I can't figure out how to make a global static raw pointer to an array. This might not even be possible? If not we should probably remove appending linkage as its unusable in rust.~~ Appending linkage is not 'emittable' anyway.
3. The test only runs on Linux.

Fixes #33992

r? @alexcrichton
src/librustc_trans/base.rs
src/librustc_trans/callee.rs
src/librustc_trans/trans_item.rs