Skip to content

Commit 52c38ba

Browse files
committed
Merge branch 'incoming' into newsnap
2 parents e5dea14 + a214e3a commit 52c38ba

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+335
-252
lines changed

Makefile.in

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,10 @@ rwildcard=$(foreach d,$(wildcard $1*),$(call rwildcard,$d/,$2) \
5555

5656
include config.mk
5757

58+
# We track all of the object files we might build so that we can find
59+
# and include all of the .d files in one fell swoop.
60+
ALL_OBJ_FILES :=
61+
5862
MKFILE_DEPS := config.stamp $(call rwildcard,$(CFG_SRC_DIR)mk/,*)
5963
NON_HOST_TRIPLES = $(filter-out $(CFG_HOST_TRIPLE),$(CFG_TARGET_TRIPLES))
6064

@@ -527,3 +531,8 @@ ifneq ($(strip $(findstring TAGS.emacs,$(MAKECMDGOALS)) \
527531
CFG_INFO := $(info cfg: including ctags rules)
528532
include $(CFG_SRC_DIR)mk/ctags.mk
529533
endif
534+
535+
# Find all of the .d files and include them to add information about
536+
# header file dependencies.
537+
ALL_DEP_FILES := $(ALL_OBJ_FILES:%.o=%.d)
538+
-include $(ALL_DEP_FILES)

mk/platform.mk

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -210,18 +210,20 @@ ifeq ($(CFG_C_COMPILER),clang)
210210
CXX=clang++
211211
endif
212212
ifeq ($(origin CPP),default)
213-
CPP=cpp
213+
CPP=clang -E
214214
endif
215215
CFG_GCCISH_CFLAGS += -Wall -Werror -fno-rtti -g
216216
CFG_GCCISH_LINK_FLAGS += -g
217-
CFG_DEPEND_C = $(CFG_GCCISH_CROSS)$(CXX) $(CFG_GCCISH_CFLAGS) -MT "$(1)" \
218-
-MM $(2)
217+
# These flags will cause the compiler to produce a .d file
218+
# next to the .o file that lists header deps.
219+
CFG_DEPEND_FLAGS = -MMD -MP -MT $(1) -MF $(1:%.o=%.d)
219220

220221
define CFG_MAKE_CC
221222
CFG_COMPILE_C_$(1) = $$(CFG_GCCISH_CROSS)$$(CXX) \
222223
$$(CFG_GCCISH_CFLAGS) $$(CFG_CLANG_CFLAGS) \
223224
$$(CFG_GCCISH_CFLAGS_$$(HOST_$(1))) \
224225
$$(CFG_CLANG_CFLAGS_$$(HOST_$(1))) \
226+
$$(CFG_DEPEND_FLAGS) \
225227
-c -o $$(1) $$(2)
226228
CFG_LINK_C_$(1) = $$(CFG_GCCISH_CROSS)$$(CXX) \
227229
$$(CFG_GCCISH_LINK_FLAGS) -o $$(1) \
@@ -241,19 +243,21 @@ ifeq ($(CFG_C_COMPILER),gcc)
241243
CXX=g++
242244
endif
243245
ifeq ($(origin CPP),default)
244-
CPP=cpp
246+
CPP=gcc -E
245247
endif
246248
CFG_GCCISH_CFLAGS += -Wall -Werror -fno-rtti -g
247249
CFG_GCCISH_LINK_FLAGS += -g
248-
CFG_DEPEND_C = $(CFG_GCCISH_CROSS)$(CXX) $(CFG_GCCISH_CFLAGS) -MT "$(1)" \
249-
-MM $(2)
250+
# These flags will cause the compiler to produce a .d file
251+
# next to the .o file that lists header deps.
252+
CFG_DEPEND_FLAGS = -MMD -MP -MT $(1) -MF $(1:%.o=%.d)
250253

251254
define CFG_MAKE_CC
252255
CFG_COMPILE_C_$(1) = $$(CFG_GCCISH_CROSS)$$(CXX) \
253256
$$(CFG_GCCISH_CFLAGS) \
254257
$$(CFG_GCCISH_CFLAGS_$$(HOST_$(1))) \
255258
$$(CFG_GCC_CFLAGS) \
256259
$$(CFG_GCC_CFLAGS_$$(HOST_$(1))) \
260+
$$(CFG_DEPEND_FLAGS) \
257261
-c -o $$(1) $$(2)
258262
CFG_LINK_C_$(1) = $$(CFG_GCCISH_CROSS)$$(CXX) \
259263
$$(CFG_GCCISH_LINK_FLAGS) -o $$(1) \
@@ -272,7 +276,7 @@ endif
272276
# We're using llvm-mc as our assembler because it supports
273277
# .cfi pseudo-ops on mac
274278
define CFG_MAKE_ASSEMBLER
275-
CFG_ASSEMBLE_$(1)=$$(CPP) $$(2) | \
279+
CFG_ASSEMBLE_$(1)=$$(CPP) $$(CFG_DEPEND_FLAGS) $$(2) | \
276280
$$(LLVM_MC_$$(CFG_HOST_TRIPLE)) \
277281
-assemble \
278282
-filetype=obj \

mk/rt.mk

Lines changed: 8 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -79,17 +79,6 @@ RUNTIME_S_$(1) := rt/arch/$$(HOST_$(1))/_context.S \
7979
rt/arch/$$(HOST_$(1))/ccall.S \
8080
rt/arch/$$(HOST_$(1))/record_sp.S
8181

82-
RUNTIME_HDR_$(1) := $$(wildcard \
83-
rt/*.h \
84-
rt/bigint/*.h \
85-
rt/isaac/*.h \
86-
rt/msvc/*.h \
87-
rt/sync/*.h \
88-
rt/uthash/*.h \
89-
rt/util/*.h \
90-
rt/vg/*.h \
91-
rt/arch/$$(HOST_$(1))/*.h)
92-
9382
ifeq ($$(HOST_$(1)), i386)
9483
LIBUV_ARCH_$(1) := ia32
9584
else
@@ -116,25 +105,28 @@ RUNTIME_INCS_$(1) := -I $$(S)src/rt -I $$(S)src/rt/isaac -I $$(S)src/rt/uthash \
116105
-I $$(S)src/libuv/include
117106
RUNTIME_OBJS_$(1) := $$(RUNTIME_CS_$(1):rt/%.cpp=rt/$(1)/%.o) \
118107
$$(RUNTIME_S_$(1):rt/%.S=rt/$(1)/%.o)
108+
ALL_OBJ_FILES += $$(RUNTIME_OBJS_$(1))
109+
110+
MORESTACK_OBJ_$(1) := rt/$(1)/arch/$$(HOST_$(1))/morestack.o
111+
ALL_OBJ_FILES += $$(MORESTACK_OBJS_$(1))
112+
119113
RUNTIME_LIBS_$(1) := $$(LIBUV_LIB_$(1))
120114

121-
rt/$(1)/%.o: rt/%.cpp $$(RUNTIME_HDR_$(1)) $$(MKFILE_DEPS)
115+
rt/$(1)/%.o: rt/%.cpp $$(MKFILE_DEPS)
122116
@$$(call E, compile: $$@)
123117
$$(Q)$$(call CFG_COMPILE_C_$(1), $$@, $$(RUNTIME_INCS_$(1)) \
124118
$$(SNAP_DEFINES)) $$<
125119

126-
rt/$(1)/%.o: rt/%.S $$(RUNTIME_HDR_$(1)) $$(MKFILE_DEPS) \
120+
rt/$(1)/%.o: rt/%.S $$(MKFILE_DEPS) \
127121
$$(LLVM_CONFIG_$$(CFG_HOST_TRIPLE))
128122
@$$(call E, compile: $$@)
129123
$$(Q)$$(call CFG_ASSEMBLE_$(1),$$@,$$<)
130124

131-
rt/$(1)/arch/$$(HOST_$(1))/libmorestack.a: \
132-
rt/$(1)/arch/$$(HOST_$(1))/morestack.o
125+
rt/$(1)/arch/$$(HOST_$(1))/libmorestack.a: $$(MORESTACK_OBJ_$(1))
133126
@$$(call E, link: $$@)
134127
$$(Q)ar rcs $$@ $$<
135128

136129
rt/$(1)/$(CFG_RUNTIME): $$(RUNTIME_OBJS_$(1)) $$(MKFILE_DEPS) \
137-
$$(RUNTIME_HDR_$(1)) \
138130
$$(RUNTIME_DEF_$(1)) \
139131
$$(RUNTIME_LIBS_$(1))
140132
@$$(call E, link: $$@)

mk/rustllvm.mk

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ RUSTLLVM_INCS_$(1) = $$(LLVM_EXTRA_INCDIRS_$(1)) \
2020
-iquote $$(LLVM_INCDIR_$(1)) \
2121
-iquote $$(S)src/rustllvm/include
2222
RUSTLLVM_OBJS_OBJS_$(1) := $$(RUSTLLVM_OBJS_CS_$(1):rustllvm/%.cpp=rustllvm/$(1)/%.o)
23+
ALL_OBJ_FILES += $$(RUSTLLVM_OBJS_OBJS_$(1))
2324

2425
rustllvm/$(1)/$(CFG_RUSTLLVM): $$(RUSTLLVM_OBJS_OBJS_$(1)) \
2526
$$(MKFILE_DEPS) $$(RUSTLLVM_DEF_$(1))

src/libcore/dvec.rs

Lines changed: 23 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ impl extensions<A> for dvec<A> {
129129
#[doc = "Overwrite the current contents"]
130130
fn set(+w: [mut A]) {
131131
self.check_not_borrowed();
132-
self.data <- w; //FIXME check for recursive use
132+
self.data <- w; //FIXME check for recursive use (#2607)
133133
}
134134
}
135135

@@ -177,25 +177,28 @@ impl extensions<A:copy> for dvec<A> {
177177
}
178178
}
179179

180-
//FIXME--
181-
//#[doc = "
182-
// Append all elements of an iterable.
183-
//
184-
// Failure will occur if the iterable's `each()` method
185-
// attempts to access this vector.
186-
//"]
187-
//fn append_iter<I:iter::base<A>>(ts: I) {
188-
// self.data.swap { |v|
189-
// alt ts.size_hint() {
190-
// none {}
191-
// some(h) { vec::reserve(v, len(v) + h) }
192-
// }
193-
//
194-
// for ts.each { |t| v = v + [t] };
195-
//
196-
// v
197-
// }
198-
//}
180+
#[doc = "
181+
Append all elements of an iterable.
182+
183+
Failure will occur if the iterable's `each()` method
184+
attempts to access this vector.
185+
"]
186+
fn append_iter<A, I:iter::base_iter<A>>(ts: I) {
187+
self.swap { |v|
188+
let mut v = alt ts.size_hint() {
189+
none { v }
190+
some(h) {
191+
let len = v.len() + h;
192+
let mut v <- v;
193+
vec::reserve(v, len);
194+
v
195+
}
196+
};
197+
198+
for ts.each { |t| v += [t] };
199+
v
200+
}
201+
}
199202

200203
#[doc = "
201204
Gets a copy of the current contents.

src/libcore/float.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ fn to_str_common(num: float, digits: uint, exact: bool) -> str {
109109
// stack of digits
110110
let mut fractionalParts = [];
111111

112-
// FIXME:
112+
// FIXME: (#2608)
113113
// This used to return right away without rounding, as "[-]num",
114114
// but given epsilon like in f64.rs, I don't see how the comparison
115115
// to epsilon did much when only used there.

src/libcore/int-template.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ impl num of num::num for T {
137137
}
138138

139139

140-
// FIXME: Has alignment issues on windows and 32-bit linux
140+
// FIXME: Has alignment issues on windows and 32-bit linux (#2609)
141141
#[test]
142142
#[ignore]
143143
fn test_from_str() {
@@ -157,7 +157,7 @@ fn test_from_str() {
157157
assert from_str("x") == none;
158158
}
159159

160-
// FIXME: Has alignment issues on windows and 32-bit linux
160+
// FIXME: Has alignment issues on windows and 32-bit linux (#2609)
161161
#[test]
162162
#[ignore]
163163
fn test_parse_buf() {

src/libcore/iter-trait.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ impl extensions<A:copy> for IMPL_T<A> {
2525
fn map_to_vec<B>(op: fn(A) -> B) -> [B] { iter::map_to_vec(self, op) }
2626
fn to_vec() -> [A] { iter::to_vec(self) }
2727

28-
// FIXME--bug in resolve prevents this from working
28+
// FIXME--bug in resolve prevents this from working (#2611)
2929
// fn flat_map_to_vec<B:copy,IB:base_iter<B>>(op: fn(A) -> IB) -> [B] {
3030
// iter::flat_map_to_vec(self, op)
3131
// }

src/libcore/num.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
#[doc="An interface for numbers."]
22

33
iface num {
4-
// FIXME: Cross-crate overloading doesn't work yet.
5-
// FIXME: Interface inheritance.
4+
// FIXME: Cross-crate overloading doesn't work yet. (#2615)
5+
// FIXME: Interface inheritance. (#2616)
66
fn add(&&other: self) -> self;
77
fn sub(&&other: self) -> self;
88
fn mul(&&other: self) -> self;

src/libcore/os.rs

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ export last_os_error;
3636
export set_exit_status;
3737
export walk_dir;
3838

39-
// FIXME: move these to str perhaps?
39+
// FIXME: move these to str perhaps? #2620
4040
export as_c_charp, fill_charp_buf;
4141

4242
native mod rustrt {
@@ -86,7 +86,7 @@ mod win32 {
8686
fn fill_utf16_buf_and_decode(f: fn(*mut u16, dword) -> dword)
8787
-> option<str> {
8888

89-
// FIXME: remove these when export globs work properly.
89+
// FIXME: remove these when export globs work properly. #1238
9090
import libc::funcs::extra::kernel32::*;
9191
import libc::consts::os::extra::*;
9292

@@ -167,7 +167,7 @@ mod global_env {
167167
sched: some({
168168
mode: task::single_threaded,
169169
// FIXME: This would be a good place to use
170-
// a very small native stack
170+
// a very small native stack (#2621)
171171
native_stack_size: none
172172
})
173173
with task::get_opts(builder)
@@ -227,7 +227,7 @@ mod global_env {
227227
#[cfg(unix)]
228228
fn setenv(n: str, v: str) {
229229

230-
// FIXME: remove this when export globs work properly.
230+
// FIXME: remove this when export globs work properly. #1238
231231
import libc::funcs::posix01::unistd::setenv;
232232
str::as_c_str(n) {|nbuf|
233233
str::as_c_str(v) {|vbuf|
@@ -239,7 +239,7 @@ mod global_env {
239239

240240
#[cfg(windows)]
241241
fn setenv(n: str, v: str) {
242-
// FIXME: remove imports when export globs work properly.
242+
// FIXME: remove imports when export globs work properly. #1238
243243
import libc::funcs::extra::kernel32::*;
244244
import win32::*;
245245
as_utf16_p(n) {|nbuf|
@@ -329,7 +329,7 @@ fn pipe() -> {in: c_int, out: c_int} {
329329

330330
#[cfg(windows)]
331331
fn pipe() -> {in: c_int, out: c_int} {
332-
// FIXME: remove this when export globs work properly.
332+
// FIXME: remove this when export globs work properly. #1238
333333
import libc::consts::os::extra::*;
334334
// Windows pipes work subtly differently than unix pipes, and their
335335
// inheritance has to be handled in a different way that I do not fully
@@ -387,7 +387,7 @@ fn self_exe_path() -> option<path> {
387387

388388
#[cfg(target_os = "macos")]
389389
fn load_self() -> option<path> unsafe {
390-
// FIXME: remove imports when export globs work properly.
390+
// FIXME: remove imports when export globs work properly. #1238
391391
import libc::funcs::extra::*;
392392
fill_charp_buf() {|buf, sz|
393393
_NSGetExecutablePath(buf, ptr::mut_addr_of(sz as u32))
@@ -397,7 +397,7 @@ fn self_exe_path() -> option<path> {
397397

398398
#[cfg(windows)]
399399
fn load_self() -> option<path> unsafe {
400-
// FIXME: remove imports when export globs work properly.
400+
// FIXME: remove imports when export globs work properly. #1238
401401
import libc::types::os::arch::extra::*;
402402
import libc::funcs::extra::kernel32::*;
403403
import win32::*;
@@ -500,7 +500,7 @@ fn path_exists(p: path) -> bool {
500500
}
501501

502502
// FIXME: under Windows, we should prepend the current drive letter to paths
503-
// that start with a slash.
503+
// that start with a slash. #2622
504504
#[doc = "
505505
Convert a relative path to an absolute path
506506
@@ -526,11 +526,11 @@ fn make_dir(p: path, mode: c_int) -> bool {
526526

527527
#[cfg(windows)]
528528
fn mkdir(p: path, _mode: c_int) -> bool unsafe {
529-
// FIXME: remove imports when export globs work properly.
529+
// FIXME: remove imports when export globs work properly. #1238
530530
import libc::types::os::arch::extra::*;
531531
import libc::funcs::extra::kernel32::*;
532532
import win32::*;
533-
// FIXME: turn mode into something useful?
533+
// FIXME: turn mode into something useful? #2623
534534
as_utf16_p(p) {|buf|
535535
CreateDirectoryW(buf, unsafe::reinterpret_cast(0))
536536
!= (0 as BOOL)
@@ -588,7 +588,7 @@ fn remove_dir(p: path) -> bool {
588588

589589
#[cfg(windows)]
590590
fn rmdir(p: path) -> bool {
591-
// FIXME: remove imports when export globs work properly.
591+
// FIXME: remove imports when export globs work properly. #1238
592592
import libc::funcs::extra::kernel32::*;
593593
import libc::types::os::arch::extra::*;
594594
import win32::*;
@@ -610,7 +610,7 @@ fn change_dir(p: path) -> bool {
610610

611611
#[cfg(windows)]
612612
fn chdir(p: path) -> bool {
613-
// FIXME: remove imports when export globs work properly.
613+
// FIXME: remove imports when export globs work properly. #1238
614614
import libc::funcs::extra::kernel32::*;
615615
import libc::types::os::arch::extra::*;
616616
import win32::*;
@@ -633,7 +633,7 @@ fn copy_file(from: path, to: path) -> bool {
633633

634634
#[cfg(windows)]
635635
fn do_copy_file(from: path, to: path) -> bool {
636-
// FIXME: remove imports when export globs work properly.
636+
// FIXME: remove imports when export globs work properly. #1238
637637
import libc::funcs::extra::kernel32::*;
638638
import libc::types::os::arch::extra::*;
639639
import win32::*;

src/libcore/path.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,20 +12,20 @@ export split;
1212
export splitext;
1313
export normalize;
1414

15-
// FIXME: This type should probably be constrained
15+
// FIXME: This type should probably be constrained (#2624)
1616
#[doc = "A path or fragment of a filesystem path"]
1717
type path = str;
1818

1919
#[cfg(unix)]
2020
mod consts {
2121
#[doc = "
22-
The primary path seperator character for the platform
22+
The primary path separator character for the platform
2323
2424
On all platforms it is '/'
2525
"]
2626
const path_sep: char = '/';
2727
#[doc = "
28-
The secondary path seperator character for the platform
28+
The secondary path separator character for the platform
2929
3030
On Unixes it is '/'. On Windows it is '\\'.
3131
"]
@@ -98,7 +98,6 @@ fn basename(pp: path) -> path {
9898
ret split_dirname_basename(pp).basename;
9999
}
100100

101-
// FIXME: Need some typestate to avoid bounds check when len(pre) == 0
102101
#[doc = "
103102
Connects to path segments
104103

0 commit comments

Comments
 (0)