Skip to content

Commit c8e5c70

Browse files
committed
---
yaml --- r: 83516 b: refs/heads/try c: 01313a1 h: refs/heads/master v: v3
1 parent 2dd9526 commit c8e5c70

File tree

2 files changed

+9
-18
lines changed

2 files changed

+9
-18
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
refs/heads/master: 0e4d1fc8cae42e15e00f71d9f439b01bb25a86ae
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 6c08cc2db4f98e9f07ae7d50338396c4123c2f0a
5-
refs/heads/try: 74dfd93bad2a2343f330cbea38c702192095210a
5+
refs/heads/try: 01313a131b1bdef0f2abfc03c5e7f00c8cb00add
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: 147ecfdd8221e4a4d4e090486829a06da1e0ca3c

branches/try/src/librustc/middle/trans/base.rs

Lines changed: 8 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2544,6 +2544,10 @@ pub fn get_item_val(ccx: @mut CrateContext, id: ast::NodeId) -> ValueRef {
25442544
llvm::LLVMAddGlobal(ccx.llmod, llty, buf)
25452545
};
25462546

2547+
if !*ccx.sess.building_library {
2548+
lib::llvm::SetLinkage(g, lib::llvm::InternalLinkage);
2549+
}
2550+
25472551
// Apply the `unnamed_addr` attribute if
25482552
// requested
25492553
if attr::contains_name(i.attrs,
@@ -3058,31 +3062,18 @@ pub fn write_metadata(cx: &mut CrateContext, crate: &ast::Crate) {
30583062
}
30593063
}
30603064

3061-
fn mk_global(ccx: &CrateContext,
3062-
name: &str,
3063-
llval: ValueRef,
3064-
internal: bool)
3065-
-> ValueRef {
3065+
// Writes the current ABI version into the crate.
3066+
pub fn write_abi_version(ccx: &mut CrateContext) {
30663067
unsafe {
3067-
let llglobal = do name.with_c_str |buf| {
3068+
let llval = C_uint(ccx, abi::abi_version);
3069+
let llglobal = do "rust_abi_version".with_c_str |buf| {
30683070
llvm::LLVMAddGlobal(ccx.llmod, val_ty(llval).to_ref(), buf)
30693071
};
30703072
llvm::LLVMSetInitializer(llglobal, llval);
30713073
llvm::LLVMSetGlobalConstant(llglobal, True);
3072-
3073-
if internal {
3074-
lib::llvm::SetLinkage(llglobal, lib::llvm::InternalLinkage);
3075-
}
3076-
3077-
return llglobal;
30783074
}
30793075
}
30803076

3081-
// Writes the current ABI version into the crate.
3082-
pub fn write_abi_version(ccx: &mut CrateContext) {
3083-
mk_global(ccx, "rust_abi_version", C_uint(ccx, abi::abi_version), false);
3084-
}
3085-
30863077
pub fn trans_crate(sess: session::Session,
30873078
crate: &ast::Crate,
30883079
analysis: &CrateAnalysis,

0 commit comments

Comments
 (0)