Skip to content

Commit e98999b

Browse files
committed
---
yaml --- r: 137631 b: refs/heads/master c: 0075c27 h: refs/heads/master i: 137629: 040220b 137627: a5f85dd 137623: d65edbb 137615: 44462f6 137599: 1aa336c v: v3
1 parent 6133ab5 commit e98999b

File tree

15 files changed

+36
-126
lines changed

15 files changed

+36
-126
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
refs/heads/master: 78a7676898d9f80ab540c6df5d4c9ce35bb50463
2+
refs/heads/master: 0075c2762626d42a2b3036e0664f1372e1b143f4
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 78a7676898d9f80ab540c6df5d4c9ce35bb50463
55
refs/heads/try: cd53dac86b43e0b46f06ab265b71526242a2fc5e

trunk/man/rustc.1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,8 +125,8 @@ is invoked.
125125
Selects a target processor. If the value is 'help', then a list of available
126126
CPUs is printed.
127127
.TP
128-
\fBtarget-feature\fR='+feature1,-feature2'
129-
A comma-separated list of features to enable or disable for the target. A
128+
\fBtarget-feature\fR='+feature1 -feature2'
129+
A space-separated list of features to enable or disable for the target. A
130130
preceding '+' enables a feature while a preceding '-' disables it. Available
131131
features can be discovered through target-cpu=help.
132132
.TP

trunk/src/libcollections/vec.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1734,7 +1734,7 @@ impl<T> MutableSeq<T> for Vec<T> {
17341734
let size = max(old_size, 2 * mem::size_of::<T>()) * 2;
17351735
if old_size > size { fail!("capacity overflow") }
17361736
unsafe {
1737-
self.ptr = alloc_or_realloc(self.ptr, self.cap * mem::size_of::<T>(), size);
1737+
self.ptr = alloc_or_realloc(self.ptr, old_size, size);
17381738
}
17391739
self.cap = max(self.cap, 2) * 2;
17401740
}
@@ -1758,7 +1758,6 @@ impl<T> MutableSeq<T> for Vec<T> {
17581758
}
17591759
}
17601760
}
1761-
17621761
}
17631762

17641763
/// An iterator that moves out of a vector.

trunk/src/librustc/driver/config.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -390,8 +390,6 @@ cgoptions!(
390390
"divide crate into N units to optimize in parallel"),
391391
remark: Passes = (SomePasses(Vec::new()), parse_passes,
392392
"print remarks for these optimization passes (space separated, or \"all\")"),
393-
no_stack_check: bool = (false, parse_bool,
394-
"disable checks for stack exhaustion (a memory-safety hazard!)"),
395393
)
396394

397395
pub fn build_codegen_options(matches: &getopts::Matches) -> CodegenOptions

trunk/src/librustc/lint/builtin.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -571,7 +571,6 @@ impl LintPass for UnusedAttribute {
571571
"no_builtins",
572572
"no_mangle",
573573
"no_split_stack",
574-
"no_stack_check",
575574
"packed",
576575
"static_assert",
577576
"thread_local",

trunk/src/librustc/middle/trans/base.rs

Lines changed: 15 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ pub fn decl_fn(ccx: &CrateContext, name: &str, cc: llvm::CallConv,
204204
// Function addresses in Rust are never significant, allowing functions to be merged.
205205
llvm::SetUnnamedAddr(llfn, true);
206206

207-
if ccx.is_split_stack_supported() && !ccx.sess().opts.cg.no_stack_check {
207+
if ccx.is_split_stack_supported() {
208208
set_split_stack(llfn);
209209
}
210210

@@ -245,7 +245,7 @@ fn get_extern_rust_fn(ccx: &CrateContext, fn_ty: ty::t, name: &str, did: ast::De
245245
let f = decl_rust_fn(ccx, fn_ty, name);
246246

247247
csearch::get_item_attrs(&ccx.sess().cstore, did, |attrs| {
248-
set_llvm_fn_attrs(ccx, attrs.as_slice(), f)
248+
set_llvm_fn_attrs(attrs.as_slice(), f)
249249
});
250250

251251
ccx.externs().borrow_mut().insert(name.to_string(), f);
@@ -450,7 +450,7 @@ pub fn set_inline_hint(f: ValueRef) {
450450
llvm::SetFunctionAttribute(f, llvm::InlineHintAttribute)
451451
}
452452

453-
pub fn set_llvm_fn_attrs(ccx: &CrateContext, attrs: &[ast::Attribute], llfn: ValueRef) {
453+
pub fn set_llvm_fn_attrs(attrs: &[ast::Attribute], llfn: ValueRef) {
454454
use syntax::attr::*;
455455
// Set the inline hint if there is one
456456
match find_inline_attr(attrs) {
@@ -460,24 +460,16 @@ pub fn set_llvm_fn_attrs(ccx: &CrateContext, attrs: &[ast::Attribute], llfn: Val
460460
InlineNone => { /* fallthrough */ }
461461
}
462462

463-
for attr in attrs.iter() {
464-
let mut used = true;
465-
match attr.name().get() {
466-
"no_stack_check" => unset_split_stack(llfn),
467-
"no_split_stack" => {
468-
unset_split_stack(llfn);
469-
ccx.sess().span_warn(attr.span,
470-
"no_split_stack is a deprecated synonym for no_stack_check");
471-
}
472-
"cold" => unsafe {
473-
llvm::LLVMAddFunctionAttribute(llfn,
474-
llvm::FunctionIndex as c_uint,
475-
llvm::ColdAttribute as uint64_t)
476-
},
477-
_ => used = false,
478-
}
479-
if used {
480-
attr::mark_used(attr);
463+
// Add the no-split-stack attribute if requested
464+
if contains_name(attrs, "no_split_stack") {
465+
unset_split_stack(llfn);
466+
}
467+
468+
if contains_name(attrs, "cold") {
469+
unsafe {
470+
llvm::LLVMAddFunctionAttribute(llfn,
471+
llvm::FunctionIndex as c_uint,
472+
llvm::ColdAttribute as uint64_t)
481473
}
482474
}
483475
}
@@ -2740,7 +2732,7 @@ pub fn get_item_val(ccx: &CrateContext, id: ast::NodeId) -> ValueRef {
27402732
sym,
27412733
i.id)
27422734
};
2743-
set_llvm_fn_attrs(ccx, i.attrs.as_slice(), llfn);
2735+
set_llvm_fn_attrs(i.attrs.as_slice(), llfn);
27442736
llfn
27452737
}
27462738

@@ -2882,7 +2874,7 @@ fn register_method(ccx: &CrateContext, id: ast::NodeId,
28822874
let sym = exported_name(ccx, id, mty, m.attrs.as_slice());
28832875

28842876
let llfn = register_fn(ccx, m.span, sym, id, mty);
2885-
set_llvm_fn_attrs(ccx, m.attrs.as_slice(), llfn);
2877+
set_llvm_fn_attrs(m.attrs.as_slice(), llfn);
28862878
llfn
28872879
}
28882880

trunk/src/librustc/middle/trans/foreign.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -640,7 +640,7 @@ pub fn trans_rust_fn_with_foreign_abi(ccx: &CrateContext,
640640
id, t.repr(tcx));
641641

642642
let llfn = base::decl_internal_rust_fn(ccx, t, ps.as_slice());
643-
base::set_llvm_fn_attrs(ccx, attrs, llfn);
643+
base::set_llvm_fn_attrs(attrs, llfn);
644644
base::trans_fn(ccx, decl, body, llfn, param_substs, id, []);
645645
llfn
646646
}

trunk/src/librustc/middle/trans/monomorphize.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ pub fn monomorphic_fn(ccx: &CrateContext,
149149
};
150150
let setup_lldecl = |lldecl, attrs: &[ast::Attribute]| {
151151
base::update_linkage(ccx, lldecl, None, base::OriginalTranslation);
152-
set_llvm_fn_attrs(ccx, attrs, lldecl);
152+
set_llvm_fn_attrs(attrs, lldecl);
153153

154154
let is_first = !ccx.available_monomorphizations().borrow().contains(&s);
155155
if is_first {

trunk/src/librustrt/thread.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,9 @@ static DEFAULT_STACK_SIZE: uint = 1024 * 1024;
3939

4040
// This is the starting point of rust os threads. The first thing we do
4141
// is make sure that we don't trigger __morestack (also why this has a
42-
// no_stack_check annotation), and then we extract the main function
42+
// no_split_stack annotation), and then we extract the main function
4343
// and invoke it.
44-
#[no_stack_check]
44+
#[no_split_stack]
4545
extern fn thread_start(main: *mut libc::c_void) -> imp::rust_thread_return {
4646
unsafe {
4747
stack::record_os_managed_stack_bounds(0, uint::MAX);

trunk/src/test/debuginfo/function-prologue-stepping-no-stack-check.rs renamed to trunk/src/test/debuginfo/function-prologue-stepping-no-split-stack.rs

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
// ignore-android: FIXME(#10381)
1212

1313
// This test case checks if function arguments already have the correct value when breaking at the
14-
// beginning of a function. Functions with the #[no_stack_check] attribute have the same prologue as
14+
// beginning of a function. Functions with the #[no_split_stack] attribute have the same prologue as
1515
// regular C functions compiled with GCC or Clang and therefore are better handled by GDB. As a
1616
// consequence, and as opposed to regular Rust functions, we can set the breakpoints via the
1717
// function name (and don't have to fall back on using line numbers). For LLDB this shouldn't make
@@ -246,7 +246,7 @@
246246

247247
#![allow(unused_variable)]
248248

249-
#[no_stack_check]
249+
#[no_split_stack]
250250
fn immediate_args(a: int, b: bool, c: f64) {
251251
()
252252
}
@@ -262,42 +262,42 @@ struct BigStruct {
262262
h: u64
263263
}
264264

265-
#[no_stack_check]
265+
#[no_split_stack]
266266
fn non_immediate_args(a: BigStruct, b: BigStruct) {
267267
()
268268
}
269269

270-
#[no_stack_check]
270+
#[no_split_stack]
271271
fn binding(a: i64, b: u64, c: f64) {
272272
let x = 0i;
273273
}
274274

275-
#[no_stack_check]
275+
#[no_split_stack]
276276
fn assignment(mut a: u64, b: u64, c: f64) {
277277
a = b;
278278
}
279279

280-
#[no_stack_check]
280+
#[no_split_stack]
281281
fn function_call(x: u64, y: u64, z: f64) {
282282
std::io::stdio::print("Hi!")
283283
}
284284

285-
#[no_stack_check]
285+
#[no_split_stack]
286286
fn identifier(x: u64, y: u64, z: f64) -> u64 {
287287
x
288288
}
289289

290-
#[no_stack_check]
290+
#[no_split_stack]
291291
fn return_expr(x: u64, y: u64, z: f64) -> u64 {
292292
return x;
293293
}
294294

295-
#[no_stack_check]
295+
#[no_split_stack]
296296
fn arithmetic_expr(x: u64, y: u64, z: f64) -> u64 {
297297
x + y
298298
}
299299

300-
#[no_stack_check]
300+
#[no_split_stack]
301301
fn if_expr(x: u64, y: u64, z: f64) -> u64 {
302302
if x + y < 1000 {
303303
x
@@ -306,15 +306,15 @@ fn if_expr(x: u64, y: u64, z: f64) -> u64 {
306306
}
307307
}
308308

309-
#[no_stack_check]
309+
#[no_split_stack]
310310
fn while_expr(mut x: u64, y: u64, z: u64) -> u64 {
311311
while x + y < 1000 {
312312
x += z
313313
}
314314
return x;
315315
}
316316

317-
#[no_stack_check]
317+
#[no_split_stack]
318318
fn loop_expr(mut x: u64, y: u64, z: u64) -> u64 {
319319
loop {
320320
x += z;

trunk/src/test/run-make/no-stack-check/Makefile

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

trunk/src/test/run-make/no-stack-check/attr.rs

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

trunk/src/test/run-make/no-stack-check/flag.rs

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

trunk/src/test/run-pass/deprecated-no-split-stack.rs

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

trunk/src/test/run-pass/smallest-hello-world.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ extern "rust-intrinsic" { fn transmute<T, U>(t: T) -> U; }
2525
#[lang = "fail_fmt"] fn fail_fmt() -> ! { loop {} }
2626

2727
#[start]
28-
#[no_stack_check]
28+
#[no_split_stack]
2929
fn main(_: int, _: *const *const u8) -> int {
3030
unsafe {
3131
let (ptr, _): (*const u8, uint) = transmute("Hello!\0");

0 commit comments

Comments
 (0)