Skip to content

Commit 6dee1ac

Browse files
committed
Merge branch 'master' of git://github.com/graydon/rust
2 parents 830f2d0 + 6f65ce5 commit 6dee1ac

Some content is hidden

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

43 files changed

+1835
-723
lines changed

Makefile.in

Lines changed: 402 additions & 0 deletions
Large diffs are not rendered by default.

configure

Lines changed: 133 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,133 @@
1+
#!/bin/sh
2+
3+
CFG_SRC_DIR=${0%${0##*/}}
4+
CFG_BUILD_DIR=$PWD
5+
6+
msg() {
7+
echo "configure: $1"
8+
}
9+
10+
err() {
11+
echo "configure: error: $1"
12+
exit 1
13+
}
14+
15+
make_dir() {
16+
if [ ! -d $1 ]
17+
then
18+
msg "mkdir -p $1"
19+
mkdir -p $1
20+
fi
21+
}
22+
23+
copy() {
24+
msg "cp $1 $1"
25+
cp $1 $2
26+
}
27+
28+
make_test_subdirs() {
29+
for t in run-pass run-fail compile-fail
30+
do
31+
make_dir $1/test/$t
32+
done
33+
}
34+
35+
putvar() {
36+
local T
37+
eval T=\$$1
38+
printf "%-20s := %s\n" $1 "$T"
39+
printf "%-20s := %s\n" $1 "$T" >>config.mk
40+
}
41+
42+
probe() {
43+
local V=$1
44+
local P=$2
45+
local T
46+
T=$(which $P 2>&1)
47+
if [ $? -ne 0 ]
48+
then
49+
T=""
50+
fi
51+
eval $V=\$T
52+
putvar $V
53+
}
54+
55+
probe_need() {
56+
local V=$1
57+
local P=$2
58+
probe $1 $2
59+
eval VV=\$$V
60+
if [ -z "$VV" ]
61+
then
62+
err "required program '$P' not found"
63+
fi
64+
}
65+
66+
67+
msg "recreating config.mk"
68+
echo '' >config.mk
69+
70+
msg "making directories"
71+
for i in \
72+
doc \
73+
boot/fe boot/me boot/be boot/driver boot/util \
74+
rt/isaac rt/bigint rt/sync rt/test
75+
do
76+
make_dir $i
77+
done
78+
79+
make_test_subdirs boot
80+
81+
for i in 0 1 2
82+
do
83+
make_dir stage$i
84+
make_test_subdirs stage$i
85+
done
86+
87+
msg "inspecting environment"
88+
89+
CFG_OSTYPE=$(uname -s)
90+
CFG_CPUTYPE=$(uname -m)
91+
92+
putvar CFG_SRC_DIR
93+
putvar CFG_BUILD_DIR
94+
putvar CFG_OSTYPE
95+
putvar CFG_CPUTYPE
96+
97+
msg "looking for programs"
98+
probe_need CFG_GCC gcc
99+
probe_need CFG_LLVM_CONFIG llvm-config
100+
probe_need CFG_OCAMLC ocamlc
101+
probe_need CFG_PERL perl
102+
probe_need CFG_SED sed
103+
104+
probe CFG_VALGRIND valgrind
105+
probe CFG_OCAMLOPT ocamlopt
106+
probe CFG_OCAMLC_OPT ocamlc.opt
107+
probe CFG_OCAMLOPT_OPT ocamlopt.opt
108+
probe CFG_FLEXLINK flexlink
109+
110+
CFG_LLVM_VERSION=$(llvm-config --version)
111+
case $CFG_LLVM_VERSION in
112+
(3.0svn | 3.0)
113+
msg "found ok version of LLVM: $CFG_LLVM_VERSION"
114+
;;
115+
(*)
116+
err "bad LLVM version: $CFG_LLVM_VERSION, need >=3.0svn"
117+
;;
118+
esac
119+
CFG_LLVM_INCDIR=$(llvm-config --includedir)
120+
CFG_LLVM_BINDIR=$(llvm-config --bindir)
121+
CFG_LLVM_CXXFLAGS=$(llvm-config --cxxflags)
122+
CFG_LLVM_LDFLAGS=$(llvm-config --ldflags)
123+
CFG_LLVM_LIBS=$(llvm-config --libs)
124+
125+
putvar CFG_LLVM_INCDIR
126+
putvar CFG_LLVM_BINDIR
127+
putvar CFG_LLVM_CXXFLAGS
128+
putvar CFG_LLVM_LDFLAGS
129+
putvar CFG_LLVM_LIBS
130+
131+
copy ${CFG_SRC_DIR}Makefile.in ./Makefile
132+
133+
echo "configure: complete"

src/Makefile

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
1+
# Delete the built-in rules.
2+
# This speeds builds up substantially on win32, maybe elsewhere.
3+
4+
.SUFFIXES:
5+
%:: %,v
6+
%:: RCS/%,v
7+
%:: RCS/%
8+
%:: s.%
9+
%:: SCCS/s.%
10+
111
######################################################################
212
# Auto-configuration
313
######################################################################
@@ -446,6 +456,7 @@ TEST_XFAILS_BOOT := $(TASK_XFAILS) \
446456
test/run-pass/iter-ret.rs \
447457
test/run-pass/leak-tag-copy.rs \
448458
test/run-pass/lib-io.rs \
459+
test/run-pass/maybe-mutable.rs \
449460
test/run-pass/mlist-cycle.rs \
450461
test/run-pass/obj-as.rs \
451462
test/run-pass/seq-compare.rs \
@@ -469,7 +480,6 @@ TEST_XFAILS_RUSTC := $(addprefix test/run-pass/, \
469480
acyclic-unwind.rs \
470481
alt-pattern-drop.rs \
471482
alt-type-simple.rs \
472-
append-units.rs \
473483
basic-1.rs \
474484
basic-2.rs \
475485
basic.rs \
@@ -489,6 +499,7 @@ TEST_XFAILS_RUSTC := $(addprefix test/run-pass/, \
489499
lib-sha1.rs \
490500
lib-sort.rs \
491501
lib-str.rs \
502+
lib-str-buf.rs \
492503
lib-task.rs \
493504
lib-uint.rs \
494505
lib-vec-str-conversions.rs \

src/Makefile.in

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

src/boot/fe/pexp.ml

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,14 @@ and parse_effect (ps:pstate) : Ast.effect =
159159

160160
and parse_mutability (ps:pstate) : Ast.mutability =
161161
match peek ps with
162-
MUTABLE -> bump ps; Ast.MUT_mutable
162+
MUTABLE ->
163+
begin
164+
(* HACK: ignore "mutable?" *)
165+
bump ps;
166+
match peek ps with
167+
QUES -> bump ps; Ast.MUT_immutable
168+
| _ -> Ast.MUT_mutable
169+
end
163170
| _ -> Ast.MUT_immutable
164171

165172
and parse_ty_fn
@@ -310,7 +317,12 @@ and parse_atomic_ty (ps:pstate) : Ast.ty =
310317

311318
| MUTABLE ->
312319
bump ps;
313-
Ast.TY_mutable (parse_ty ps)
320+
begin
321+
(* HACK: ignore "mutable?" *)
322+
match peek ps with
323+
QUES -> bump ps; parse_ty ps
324+
| _ -> Ast.TY_mutable (parse_ty ps)
325+
end
314326

315327
| LPAREN ->
316328
begin

src/boot/me/type.ml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -993,16 +993,14 @@ let check_block (cx:Semant.ctxt) : (fn_ctx -> Ast.block -> unit) =
993993
let src_ty = check_atom ~deref:true src in
994994
let dst_ty = check_lval dst in
995995
match fundamental_ty dst_ty, fundamental_ty src_ty with
996-
Ast.TY_vec elt1, Ast.TY_vec elt2
997-
| Ast.TY_vec elt1, elt2 ->
996+
Ast.TY_vec elt1, Ast.TY_vec elt2 ->
998997
if elt1 = elt2
999998
then ()
1000999
else
10011000
Common.err None
10021001
"mismatched types in vec-append: %s += %s"
10031002
(pretty_ty_str dst_ty)
10041003
(pretty_ty_str src_ty)
1005-
| Ast.TY_str, (Ast.TY_mach Common.TY_u8)
10061004
| Ast.TY_str, Ast.TY_str -> ()
10071005
| _ ->
10081006
infer_lval src_ty dst;

src/comp/back/x86.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -212,10 +212,10 @@ fn upcall_glue(int n_args) -> vec[str] {
212212
+ store_esp_to_rust_sp_second_arg()
213213
+ load_esp_from_runtime_sp_second_arg()
214214

215-
+ vec("subl $" + wstr(n_args + 1) + ", %esp # esp -= args",
215+
+ vec("subl $" + wstr(n_args) + ", %esp # esp -= args",
216216
"andl $~0xf, %esp # align esp down")
217217

218-
+ _vec.init_fn[str](carg, (n_args + 1) as uint)
218+
+ _vec.init_fn[str](carg, (n_args) as uint)
219219

220220
+ vec("movl %edx, %edi # save task from edx to edi",
221221
"call *%ecx # call *%ecx",
@@ -268,7 +268,7 @@ fn get_module_asm() -> str {
268268
rust_yield_glue()))
269269

270270
+ _vec.init_fn[str](bind decl_upcall_glue(align, prefix, _),
271-
abi.n_upcall_glues as uint);
271+
(abi.n_upcall_glues + 1) as uint);
272272

273273
ret _str.connect(glues, "\n\n");
274274
}

src/comp/driver/rustc.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -203,8 +203,8 @@ impure fn main(vec[str] args) {
203203
alt (output_file) {
204204
case (none[str]) {
205205
let vec[str] parts = _str.split(ifile, '.' as u8);
206-
parts = _vec.pop[str](parts);
207-
parts += ".bc";
206+
_vec.pop[str](parts);
207+
parts += vec(".bc");
208208
auto ofile = _str.concat(parts);
209209
compile_input(sess, env, ifile, ofile, shared,
210210
library_search_paths);

src/comp/driver/session.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,15 @@ obj session(cfg targ) {
4545
fail;
4646
}
4747

48+
fn span_unimpl(span sp, str msg) {
49+
log #fmt("%s:%u:%u:%u:%u: error: unimplemented %s",
50+
sp.filename,
51+
sp.lo.line, sp.lo.col,
52+
sp.hi.line, sp.hi.col,
53+
msg);
54+
fail;
55+
}
56+
4857
fn unimpl(str msg) {
4958
log #fmt("error: unimplemented %s", msg);
5059
fail;

0 commit comments

Comments
 (0)