Skip to content

Commit 7fb101c

Browse files
committed
---
yaml --- r: 82697 b: refs/heads/auto c: 09a5338 h: refs/heads/master i: 82695: 4811a1d v: v3
1 parent b3d88c5 commit 7fb101c

File tree

3 files changed

+18
-29
lines changed

3 files changed

+18
-29
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: 2aadd3652dbbfa1179eea57091b0de2dc87006a4
16+
refs/heads/auto: 09a53381974bcf42c0b081cbfcd9f20f1e5d4f04
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: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2544,10 +2544,6 @@ 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-
25512547
// Apply the `unnamed_addr` attribute if
25522548
// requested
25532549
if attr::contains_name(i.attrs,
@@ -3062,18 +3058,31 @@ pub fn write_metadata(cx: &mut CrateContext, crate: &ast::Crate) {
30623058
}
30633059
}
30643060

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

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+
30773086
pub fn trans_crate(sess: session::Session,
30783087
crate: &ast::Crate,
30793088
analysis: &CrateAnalysis,

branches/auto/src/libsyntax/ext/expand.rs

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1006,26 +1006,6 @@ pub fn std_macros() -> @str {
10061006
}
10071007
)
10081008

1009-
// NOTE(acrichto): start removing this after the next snapshot
1010-
macro_rules! printf (
1011-
($arg:expr) => (
1012-
print(fmt!(\"%?\", $arg))
1013-
);
1014-
($( $arg:expr ),+) => (
1015-
print(fmt!($($arg),+))
1016-
)
1017-
)
1018-
1019-
// NOTE(acrichto): start removing this after the next snapshot
1020-
macro_rules! printfln (
1021-
($arg:expr) => (
1022-
println(fmt!(\"%?\", $arg))
1023-
);
1024-
($( $arg:expr ),+) => (
1025-
println(fmt!($($arg),+))
1026-
)
1027-
)
1028-
10291009
macro_rules! format(($($arg:tt)*) => (
10301010
format_args!(::std::fmt::format, $($arg)*)
10311011
))

0 commit comments

Comments
 (0)