]> git.lizzy.rs Git - rust.git/commitdiff
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)
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

1  2 
src/librustc_trans/base.rs
src/librustc_trans/callee.rs
src/librustc_trans/trans_item.rs

Simple merge
Simple merge
Simple merge