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
Michael Sullivan
c610d027d9
gather_locals shouldn't descend down into fns and items.
2011-07-15 14:42:59 -05:00
Michael Sullivan
7caf8a0929
Convert gather_locals to use visit.
2011-07-15 14:24:09 -05:00
Patrick Walton
9fadab64a2
rustc: Introduce a stub destination-passing-style translation engine, accessible via the --dps switch for now
2011-07-15 11:38:46 -07:00
Patrick Walton
917afa4cc9
rustc: Remove a bunch of exterior vectors
2011-07-15 11:38:46 -07:00
Lindsey Kuper
a716eb28ec
Getting rid of unnecessary casts for objects.
...
Now that all objects are of rust_object_type in the wake of the LLVM
type system rewrite, we don't need this cast anymore.
2011-07-15 10:55:31 -07:00
Eric Holk
827e300485
refactor: Move the task and communication-related translation functions to a new module.
2011-07-14 17:33:28 -07:00
Michael Sullivan
e9a6fc94d5
Make collect_upvars know about function args.
...
Closes #697 .
2011-07-14 19:18:56 -05:00
Michael Sullivan
a3301f74f9
Generalize collect_upvars to work over any type of ast node.
2011-07-14 19:18:56 -05:00
Eric Holk
8afb1a7c63
refactor: Move the LLVM type and constant constructors into a new module.
2011-07-14 17:08:45 -07:00
Michael Sullivan
e2fcd29bbd
Consolidate some arguments in typeck by just passing the record they came from.
2011-07-14 18:45:55 -05:00
Michael Sullivan
53c4cb6a2f
Factor out build_environment's code to find a variable in a function context.
2011-07-14 18:45:02 -05:00
Michael Sullivan
759317ca8b
Factor out closure construction from trans_for_each.
2011-07-14 18:45:01 -05:00
Michael Sullivan
0957525cc6
Fix array out of bounds index in load_environment.
...
Closes #696 .
2011-07-14 18:34:43 -05:00
Rafael Ávila de Espíndola
c124a025bf
Move rustc to the new llvm type system. Requires an update to llvm trunk.
2011-07-14 15:19:17 -04:00
Patrick Walton
e76f44453b
rustc: First stab at interior string literals, untested as of yet
2011-07-14 11:47:20 -07:00
Brian Anderson
f4beac4a43
Revert "Allow main to return int"
...
This reverts commit 8c94d8fd54ba864e6a603ba6d90d41ccfaa62f53.
There's no mechanism to actually return the value from main, so all this does
is allow main -> int to compile. Per #688 , the program returns non-zero on
failure, so it's not obvious that this change is appropriate at this time.
2011-07-14 10:37:28 -07:00
Rafael Ávila de Espíndola
7376e751ae
Keep a pointer to rust_object_type.
2011-07-14 12:07:51 -04:00
Rafael Ávila de Espíndola
40f617390d
Main part of the type system rewrite:
...
Change the type of all objects to be { {}*, {}* }.
2011-07-14 00:34:45 -04:00
Brian Anderson
8c94d8fd54
Allow main to return int
2011-07-13 19:22:53 -07:00
Tim Chevalier
f26ca025de
Make resolve and the typechecker check for a main fn of the
...
correct type
This means if a non-library program leaves out the main program,
the error gets caught earlier than link.
Closes #626 .
2011-07-13 18:30:53 -07:00