Michael Sullivan
a0a2cee896
Clean up build_environment by having it return a rec with usefully named fields.
2011-07-21 18:19:07 -07:00
Michael Sullivan
4170390cb6
Add some useful functions to freevars.
2011-07-21 18:18:59 -07:00
Michael Sullivan
4b59ae0aa9
Add some support for using a map like a set.
2011-07-21 18:14:39 -07:00
Michael Sullivan
3b2d23b2cd
Move a bunch of trans into trans_common, including the context structures.
...
Probably more should be moved or split off into other files. My algorithm
was something along the lines of: move the contexts and their transitive
dependencies along with some functions to work with them. I stopped when
I was going to have to start pulling glue generation, which really
should go into a trans_glue file.
2011-07-21 17:39:06 -07:00
Michael Sullivan
f8bb5a3b58
Make ty::ctxt be boxed.
...
Arguably we should leave ty_ctxt as a bare rec and just always work with
boxes of it. This winds up being simpler and prettier, though.
2011-07-21 17:39:06 -07:00
Tim Chevalier
a9a1392b2c
Instantiate function preconditions inside the function body
...
so that if we have a function like:
f(...) : p(x) {
...
}
p(x) is true inside the body of f.
Closes #694 .
2011-07-21 16:11:34 -07:00
Tim Chevalier
2261ddc717
Move ast_constr_to_constr from typeck to ty
...
so that it can be used in places that import ty.
2011-07-21 16:09:55 -07:00
Lindsey Kuper
075a094c1f
Now with more type inference.
2011-07-21 15:46:03 -07:00
Lindsey Kuper
879b6392d9
Comments and cleanup.
2011-07-21 15:12:27 -07:00
Lindsey Kuper
8ebd292253
Consolidate obj_field_from_anon_obj_field().
2011-07-21 15:12:27 -07:00
Lindsey Kuper
55acc737a8
Remove vestiges of typarams from anon objs.
2011-07-21 15:12:27 -07:00
Eric Holk
d79afd7916
Improving move semantics for channel operations.
...
This lets us un-XFAIL task-comm-10.rs.
2011-07-21 11:51:22 -07:00
Eric Holk
3ae4dcd41e
Lots of work on memory tracking and channels.
...
We're trying to get closer to doing correct move semantics for channel
operations. This involves a lot of cleanup (such as removing the
unused sched parameter from rust_vec constructor) and making
circular_buffer kernel_owned.
Added tagging for memory allocations. This means we give a string tag
to everything we allocate. If we leak something and TRACK_ALLOCATIONS
is enabled, then it's much easier now to tell exactly what is leaking.
2011-07-21 11:51:22 -07:00
Patrick Walton
a44fb04d57
Revert "rustc: Avoid SHA-1 hashing every type, since they're interned"
...
This reverts commit df90f57a5f76059394abd8328d30003b844cb497.
2011-07-21 11:44:12 -07:00
Patrick Walton
b49bdad499
rustc: Box raw types. Shaves about 5 seconds off compilation.
2011-07-21 11:43:52 -07:00
Patrick Walton
df90f57a5f
rustc: Avoid SHA-1 hashing every type, since they're interned
2011-07-21 11:24:20 -07:00
Patrick Walton
355f77ef87
rustc: Remove cnames for now
2011-07-20 19:13:55 -07:00
Patrick Walton
3ec3b02ed0
rustc: Strip cnames before generating glue to avoid duplicates
2011-07-20 19:04:45 -07:00
Patrick Walton
142ff3bb4e
rustc: Translate functions only once
2011-07-20 18:43:05 -07:00
Michael Sullivan
1b9dbcc5b4
Box the vec of freevars we store in the freevars cache.
2011-07-20 18:15:56 -07:00
Lindsey Kuper
00f54b4a42
Refactoring and cleaning up.
2011-07-20 12:22:55 -07:00
Rafael Ávila de Espíndola
94c91382cd
Fix typo.
2011-07-20 15:14:13 -04:00
Rafael Ávila de Espíndola
b7a7120804
give rust_metadata internal linkage but mark it as used. This allows
...
multiple static crates to be used.
2011-07-20 14:55:01 -04:00
Tim Chevalier
41212792c6
Add missing case in tyencode for ty_constr
...
Fixes the Windoze breakage, I hope.
2011-07-19 20:16:03 -07:00
Lindsey Kuper
2eb4762936
Typechecking self-calls in anon objs. Closes #540 .
2011-07-19 19:52:21 -07:00
Lindsey Kuper
64fb39cdd3
Clean up formatting.
2011-07-19 19:52:21 -07:00
Tim Chevalier
bd4aeef78b
Beginnings of support for constrained types
...
Programs with constrained types now parse and typecheck, but
typestate doesn't check them specially, so the one relevant test
case so far is XFAILed.
Also rewrote all of the constraint-related data structures in the
process (again), for some reason. I got rid of a superfluous
data structure in the context that was mapping front-end constraints
to resolved constraints, instead handling constraints in the same
way in which everything else gets resolved.
2011-07-19 18:57:28 -07:00
Lindsey Kuper
19a17b3d1d
Style and indentation cleanups.
2011-07-19 16:08:49 -07:00
Lindsey Kuper
18162d3261
Some progress on issue #540 .
2011-07-19 14:30:53 -07:00
Lindsey Kuper
a0c6d0a27f
Comments and cleanup.
2011-07-19 12:33:45 -07:00
Lindsey Kuper
61ee22dc84
Wrapping long strings.
2011-07-19 12:33:45 -07:00
Michael Sullivan
f8c6d282f8
Add a pass that finds all of the free variables.
2011-07-19 12:01:14 -07:00
Michael Sullivan
c4bcd0a44d
Move collect_upvars into its own file.
2011-07-19 12:01:13 -07:00
Patrick Walton
2e6197aa95
rustc: Report how much time was spent to translate each function when --stats is on
2011-07-19 11:57:15 -07:00
Marijn Haverbeke
a0ab57b3f6
Fix trans_alt to handle unreachable branches without blowing up
2011-07-19 17:07:51 +02:00
Patrick Walton
ce3d6339e0
rustc: Translate locals in DPS style
2011-07-18 18:28:36 -07:00
Patrick Walton
242ec22032
rustc: Remove obsolete TODO
2011-07-18 18:02:11 -07:00
Patrick Walton
07a68df3b7
rustc: Skip null when translating string concatenation
2011-07-18 18:00:45 -07:00
Patrick Walton
08eabde97b
rustc: First stab at implementing interior vector concat in the DPS engine
2011-07-18 17:43:24 -07:00
Lindsey Kuper
7d4903544e
Don't use 'obj_info' as an identifier for things not of type obj_info.
2011-07-18 17:05:41 -07:00
Lindsey Kuper
b6fc86ae5a
Sane error message for self-call in non-obj context. Closes #707 .
2011-07-18 15:58:36 -07:00
Brian Anderson
c40d6265ce
Support x86 stdcall convention
...
This allows rust to call the Win32 API
2011-07-18 13:56:15 -07:00
Patrick Walton
682875929e
rustc: Stub binary operator translation
2011-07-18 00:24:21 -07:00
Patrick Walton
437b776100
rustc: Simplify the destination format in the DPS backend; optimize aliases to interior strings to require no allocation at all
2011-07-17 22:30:13 -07:00
Patrick Walton
22db8b1d53
rustc: Use memmove instructions more aggressively in DPS mode. LLVM converts these to optimized block transfer instructions, significantly reducing code size.
2011-07-17 14:02:39 -07:00
Patrick Walton
652da4ca55
rustc: Implement immediates in the DPS engine; it should now always be at least as efficient as the original engine (and typically much more).
2011-07-16 10:54:12 -07:00
Patrick Walton
88574c3cea
rustc: Implement interior string logging in DPS
2011-07-15 18:37:57 -07:00
Patrick Walton
f6f7f61908
rustc: Implement logging in DPS
2011-07-15 18:00:59 -07:00
Patrick Walton
0bd7b803f6
rustc: Translate literals in DPS style; no constification of strings yet.
2011-07-15 16:40:55 -07:00
Patrick Walton
6e114a367f
rustc: Write names of local variables into the LLVM IR when debug mode is on
2011-07-15 16:40:55 -07:00