Skip to content

Commit b3d88c5

Browse files
committed
---
yaml --- r: 82696 b: refs/heads/auto c: 2aadd36 h: refs/heads/master v: v3
1 parent 4811a1d commit b3d88c5

File tree

5 files changed

+9
-64
lines changed

5 files changed

+9
-64
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ refs/heads/try3: 9387340aab40a73e8424c48fd42f0c521a4875c0
1313
refs/tags/release-0.3.1: 495bae036dfe5ec6ceafd3312b4dca48741e845b
1414
refs/tags/release-0.4: e828ea2080499553b97dfe33b3f4d472b4562ad7
1515
refs/tags/release-0.5: 7e3bcfbf21278251ee936ad53e92e9b719702d73
16-
refs/heads/auto: 48499c7494d47f505a640157816cea2690b8d407
16+
refs/heads/auto: 2aadd3652dbbfa1179eea57091b0de2dc87006a4
1717
refs/heads/servo: af82457af293e2a842ba6b7759b70288da276167
1818
refs/tags/release-0.6: b4ebcfa1812664df5e142f0134a5faea3918544c
1919
refs/tags/0.1: b19db808c2793fe2976759b85a355c3ad8c8b336

branches/auto/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,

branches/auto/src/librustc/middle/trans/controlflow.rs

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ use syntax::ast;
2525
use syntax::ast::Name;
2626
use syntax::ast_util;
2727
use syntax::codemap::Span;
28-
use syntax::visit::Visitor;
2928

3029
pub fn trans_block(bcx: @mut Block, b: &ast::Block, dest: expr::Dest) -> @mut Block {
3130
let _icx = push_ctxt("trans_block");
@@ -65,22 +64,12 @@ pub fn trans_if(bcx: @mut Block,
6564
// Drop branches that are known to be impossible
6665
if is_const(cond_val) && !is_undef(cond_val) {
6766
if const_to_uint(cond_val) == 1 {
68-
match els {
69-
Some(elexpr) => {
70-
let mut trans = TransItemVisitor { ccx: bcx.fcx.ccx };
71-
trans.visit_expr(elexpr, ());
72-
}
73-
None => {}
74-
}
7567
// if true { .. } [else { .. }]
7668
return do with_scope(bcx, thn.info(), "if_true_then") |bcx| {
7769
let bcx_out = trans_block(bcx, thn, dest);
7870
trans_block_cleanups(bcx_out, block_cleanups(bcx))
7971
}
8072
} else {
81-
let mut trans = TransItemVisitor { ccx: bcx.fcx.ccx } ;
82-
trans.visit_block(thn, ());
83-
8473
match els {
8574
// if false { .. } else { .. }
8675
Some(elexpr) => {

branches/auto/src/test/auxiliary/cfg_inner_static.rs

Lines changed: 0 additions & 17 deletions
This file was deleted.

branches/auto/src/test/run-pass/cfg_inner_static.rs

Lines changed: 0 additions & 18 deletions
This file was deleted.

0 commit comments

Comments
 (0)