Skip to content

Commit 8691cbe

Browse files
committed
---
yaml --- r: 78719 b: refs/heads/try c: ae63a3e h: refs/heads/master i: 78717: 0faea01 78715: 05ba308 78711: 806343b 78703: f35ee9b 78687: f6daa20 78655: f85d834 78591: 56024d7 v: v3
1 parent 970b66d commit 8691cbe

File tree

12 files changed

+160
-216
lines changed

12 files changed

+160
-216
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: 25ed29a0edb3d48fef843a0b818ee68faf2252da
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 60fba4d7d677ec098e6a43014132fe99f7547363
5-
refs/heads/try: 2c0f9bd35493def5e23f0f43ddeba54da9d788b4
5+
refs/heads/try: ae63a3e400970a895d03ec1ef359ba86217c854b
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: 147ecfdd8221e4a4d4e090486829a06da1e0ca3c

branches/try/doc/tutorial-container.md

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -160,18 +160,6 @@ assert_eq!(sum, 57);
160160
161161
## For loops
162162
163-
The function `range` (or `range_inclusive`) allows to simply iterate through a given range:
164-
165-
~~~
166-
for i in range(0, 5) {
167-
printf!("%d ", i) // prints "0 1 2 3 4"
168-
}
169-
170-
for i in std::iterator::range_inclusive(0, 5) { // needs explicit import
171-
printf!("%d ", i) // prints "0 1 2 3 4 5"
172-
}
173-
~~~
174-
175163
The `for` keyword can be used as sugar for iterating through any iterator:
176164
177165
~~~

branches/try/doc/tutorial-ffi.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -445,8 +445,9 @@ prefer using raw pointers (`*`) if that's needed because the compiler can't make
445445
about them.
446446

447447
Vectors and strings share the same basic memory layout, and utilities are available in the `vec` and
448-
`str` modules for working with C APIs. However, strings are not terminated with `\0`. If you need a
449-
NUL-terminated string for interoperability with C, you should use the `c_str::to_c_str` function.
448+
`str` modules for working with C APIs. Strings are terminated with `\0` for interoperability with C,
449+
but it should not be assumed because a slice will not always be nul-terminated. Instead, the
450+
`str::as_c_str` function should be used.
450451

451452
The standard library includes type aliases and function definitions for the C standard library in
452453
the `libc` module, and Rust links against `libc` and `libm` by default.

branches/try/mk/llvm.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ ifeq ($(CFG_LLVM_ROOT),)
2626

2727
$$(LLVM_CONFIG_$(1)): $$(LLVM_DEPS)
2828
@$$(call E, make: llvm)
29-
$$(Q)$$(MAKE) -C $$(CFG_LLVM_BUILD_DIR_$(1))
29+
$$(Q)$$(MAKE) -C $$(CFG_LLVM_BUILD_DIR_$(1)) $$(CFG_LLVM_BUILD_ENV)
3030
$$(Q)touch $$(LLVM_CONFIG_$(1))
3131
endif
3232

branches/try/mk/platform.mk

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,10 @@ endef
2626
$(foreach t,$(CFG_TARGET_TRIPLES),$(eval $(call DEF_OSTYPE_VAR,$(t))))
2727
$(foreach t,$(CFG_TARGET_TRIPLES),$(info cfg: os for $(t) is $(OSTYPE_$(t))))
2828

29-
CFG_GCCISH_CFLAGS += -DUSE_UTF8
29+
# FIXME: no-omit-frame-pointer is just so that task_start_wrapper
30+
# has a frame pointer and the stack walker can understand it. Turning off
31+
# frame pointers everywhere is overkill
32+
CFG_GCCISH_CFLAGS += -fno-omit-frame-pointer -DUSE_UTF8
3033

3134
# On Darwin, we need to run dsymutil so the debugging information ends
3235
# up in the right place. On other platforms, it automatically gets
@@ -150,6 +153,7 @@ CFG_GCCISH_POST_LIB_FLAGS_x86_64-unknown-linux-gnu := -Wl,-no-whole-archive
150153
CFG_DEF_SUFFIX_x86_64-unknown-linux-gnu := .linux.def
151154
CFG_INSTALL_NAME_x86_64-unknown-linux-gnu =
152155
CFG_LIBUV_LINK_FLAGS_x86_64-unknown-linux-gnu =
156+
CFG_LLVM_BUILD_ENV_x86_64-unknown-linux-gnu="CXXFLAGS=-fno-omit-frame-pointer"
153157
CFG_EXE_SUFFIX_x86_64-unknown-linux-gnu =
154158
CFG_WINDOWSY_x86_64-unknown-linux-gnu :=
155159
CFG_UNIXY_x86_64-unknown-linux-gnu := 1
@@ -175,6 +179,7 @@ CFG_GCCISH_POST_LIB_FLAGS_i686-unknown-linux-gnu := -Wl,-no-whole-archive
175179
CFG_DEF_SUFFIX_i686-unknown-linux-gnu := .linux.def
176180
CFG_INSTALL_NAME_i686-unknown-linux-gnu =
177181
CFG_LIBUV_LINK_FLAGS_i686-unknown-linux-gnu =
182+
CFG_LLVM_BUILD_ENV_i686-unknown-linux-gnu="CXXFLAGS=-fno-omit-frame-pointer"
178183
CFG_EXE_SUFFIX_i686-unknown-linux-gnu =
179184
CFG_WINDOWSY_i686-unknown-linux-gnu :=
180185
CFG_UNIXY_i686-unknown-linux-gnu := 1

branches/try/src/libextra/getopts.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -501,6 +501,7 @@ pub enum FailType {
501501
pub mod groups {
502502
use getopts::{HasArg, Long, Maybe, Multi, No, Occur, Opt, Optional, Req};
503503
use getopts::{Short, Yes};
504+
use std::str;
504505

505506
/** one group of options, e.g., both -h and --help, along with
506507
* their shared description and properties
@@ -691,7 +692,7 @@ pub mod groups {
691692

692693
// FIXME: #5516
693694
// here we just need to indent the start of the description
694-
let rowlen = row.len();
695+
let rowlen = str::count_chars(row, 0, row.len());
695696
if rowlen < 24 {
696697
do (24 - rowlen).times {
697698
row.push_char(' ')
@@ -798,7 +799,7 @@ pub mod groups {
798799
cont
799800
};
800801

801-
ss.iter().enumerate().advance(|x| machine(x));
802+
ss.char_offset_iter().advance(|x| machine(x));
802803

803804
// Let the automaton 'run out' by supplying trailing whitespace
804805
while cont && match state { B | C => true, A => false } {

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

Lines changed: 5 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -137,13 +137,6 @@ fn fcx_has_nonzero_span(fcx: &FunctionContext) -> bool {
137137
}
138138
}
139139

140-
fn span_is_empty(opt_span: &Option<span>) -> bool {
141-
match *opt_span {
142-
None => true,
143-
Some(span) => *span.lo == 0 && *span.hi == 0
144-
}
145-
}
146-
147140
struct StatRecorder<'self> {
148141
ccx: @mut CrateContext,
149142
name: &'self str,
@@ -1631,13 +1624,6 @@ pub fn new_fn_ctxt_w_id(ccx: @mut CrateContext,
16311624
}
16321625
};
16331626
let uses_outptr = type_of::return_uses_outptr(ccx.tcx, substd_output_type);
1634-
1635-
let debug_context = if id != -1 && ccx.sess.opts.debuginfo && !span_is_empty(&sp) {
1636-
Some(debuginfo::create_function_debug_context(ccx, id, param_substs, llfndecl))
1637-
} else {
1638-
None
1639-
};
1640-
16411627
let fcx = @mut FunctionContext {
16421628
llfn: llfndecl,
16431629
llenv: unsafe {
@@ -1658,7 +1644,7 @@ pub fn new_fn_ctxt_w_id(ccx: @mut CrateContext,
16581644
span: sp,
16591645
path: path,
16601646
ccx: ccx,
1661-
debug_context: debug_context,
1647+
debug_context: None,
16621648
};
16631649
fcx.llenv = unsafe {
16641650
llvm::LLVMGetParam(llfndecl, fcx.env_arg_pos() as c_uint)
@@ -1891,7 +1877,6 @@ pub fn trans_closure(ccx: @mut CrateContext,
18911877
param_substs,
18921878
body.info(),
18931879
Some(body.span));
1894-
18951880
let raw_llargs = create_llargs_for_fn_args(fcx, self_arg, decl.inputs);
18961881

18971882
// Set the fixed stack segment flag if necessary.
@@ -1900,6 +1885,10 @@ pub fn trans_closure(ccx: @mut CrateContext,
19001885
set_fixed_stack_segment(fcx.llfn);
19011886
}
19021887

1888+
if ccx.sess.opts.debuginfo && fcx_has_nonzero_span(fcx) {
1889+
debuginfo::create_function_metadata(fcx);
1890+
}
1891+
19031892
// Create the first basic block in the function and keep a handle on it to
19041893
// pass to finish_fn later.
19051894
let bcx_top = fcx.entry_bcx.unwrap();
@@ -1911,11 +1900,6 @@ pub fn trans_closure(ccx: @mut CrateContext,
19111900

19121901
maybe_load_env(fcx);
19131902

1914-
// Up until here, IR instructions for this function have explicitly not been annotated with
1915-
// source code location, so we don't step into call setup code. From here on, source location
1916-
// emitting should be enabled.
1917-
debuginfo::start_emitting_source_locations(fcx);
1918-
19191903
// This call to trans_block is the place where we bridge between
19201904
// translation calls that don't have a return value (trans_crate,
19211905
// trans_mod, trans_item, et cetera) and those that do

0 commit comments

Comments
 (0)