Patrick Walton
b079e1adbb
rustc: Parse "inline". Also write it into metadata.
2011-08-05 13:59:27 -07:00
Patrick Walton
59e9b629c0
Revert "rustc: Introduce the concept of inline to the AST"
...
This reverts commit 9b9170f9fe
.
2011-08-05 11:38:06 -07:00
Patrick Walton
9b9170f9fe
rustc: Introduce the concept of inline to the AST
2011-08-05 11:33:48 -07:00
Graydon Hoare
59c441a66a
Encode, decode, and thread through typechecking all the param kinds, not just the counts.
2011-07-29 16:40:30 -07:00
Graydon Hoare
f3c05b9fae
Turn on kind propagation for typarams. Annotate a bunch of typarams in rustc and libstd.
2011-07-29 12:58:52 -07:00
Graydon Hoare
3e63fdc4c9
Thread kinds into the type system. Don't quite activate yet, since it breaks stdlib and snapshot isn't ready to compile modified stdlib.
2011-07-28 13:29:39 -07:00
Marijn Haverbeke
6e2a7bff7f
Fix damage done by the pretty-printer
2011-07-27 15:54:33 +02:00
Marijn Haverbeke
df7f21db09
Reformat for new syntax
2011-07-27 15:54:33 +02:00
Michael Sullivan
ac948b4ccd
Resolve and typecheck alias-environment-capturing blocks.
2011-07-26 12:30:14 -07:00
Marijn Haverbeke
e133f929b7
Convert all code that uses walk.rs in the straightforward way to simple_visit
...
Code that needs the keep_going functionality is still using walk. I will
add an equivalent to visit.rs later.
2011-07-26 17:13:48 +02:00
Marijn Haverbeke
2c1250780d
Remove tuple support from the compiler
2011-07-26 15:19:56 +02:00
Marijn Haverbeke
aea537779e
Remove all uses of tuples from the compiler and stdlib
2011-07-26 14:06:02 +02:00
Marijn Haverbeke
e949aab10a
Remove some rustboot-isms
...
Closes #464
2011-07-25 15:07:48 +02: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
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
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
Brian Anderson
9334fb4459
Remove cwriter.rs
...
This file isn't actually in the crate
2011-07-19 12:13:06 -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
917afa4cc9
rustc: Remove a bunch of exterior vectors
2011-07-15 11:38:46 -07:00
Patrick Walton
1a6419bd73
rustc: Move metadata::encoder over to interior vectors
2011-07-14 15:39:35 -07:00
Graydon Hoare
49da7da441
Fix long line.
2011-07-14 12:55:17 -07:00
Patrick Walton
be489ee9e2
rustc: Move much of metadata reading over to interior vectors
2011-07-14 12:00:48 -07:00
Graydon Hoare
39151f2ad8
Prohibit trailing whitespace under 'tidy' script. Clean up all caught cases.
2011-07-13 15:44:09 -07:00
Patrick Walton
05390b4b38
rustc: Implement explicit global scope resolution via leading "::"; add a test case
2011-07-11 16:02:16 -07:00
Brian Anderson
e494e73cdd
Use more encapsulation for metadata::cstore
2011-07-10 15:44:11 -07:00
Brian Anderson
f5d604f0c3
Decode types across multiple crates. Closes #632
2011-07-08 15:07:14 -07:00
Brian Anderson
4319e7a655
Recursively load dependencies of external crates. Issue #632
2011-07-08 14:07:41 -07:00
Brian Anderson
412e203b3c
Refactor load_library_crate and resolve_crate
2011-07-08 14:07:41 -07:00
Brian Anderson
dd8ab24da2
Add a map from external cnums to local cnums in cstore::crate_metadata
...
Once populated, this will allow us to load type info for types defined in
external crates referenced by other external crates.
2011-07-08 14:07:41 -07:00
Brian Anderson
061bcb2e42
Extract resolve_crate from creader::visit_view_item
2011-07-08 14:07:41 -07:00
Rafael Ávila de Espíndola
4c309321e0
Try to use static crate if we cannot find the dynamic one. This supports
...
the common case of wanting to link statically with the project's libraries
but dynamically with the system ones.
2011-07-08 15:39:44 -04:00
Rafael Ávila de Espíndola
94f0e9d956
Add just enough logic to the driver so that we can link std statically.
2011-07-08 15:05:32 -04:00
Brian Anderson
4c0a2ed378
Fix newlines when outputting crate attributes with --ls
2011-07-08 11:34:15 -07:00
Brian Anderson
3070439c00
Encode/decode a crate's externel dependencies. Issue #632
...
The encoding is very simple right now, just the crate name. Ultimately this
won't be enough for our versioning needs, but it should fill our immediate
need of being able to correlate encoded crate numbers to actual crates.
2011-07-08 11:34:15 -07:00
Brian Anderson
d0a432f4bb
Don't export tyencode from the metadata module
...
This involves pulling the type_abbrev cache out of crate_ctxt
2011-07-08 09:37:01 -07:00
Brian Anderson
00d54018f1
Cleanup decoding and crate searching
2011-07-08 09:37:01 -07:00
Brian Anderson
06391dda02
Make the interface to metadata::csearch more consistent
2011-07-08 09:37:01 -07:00
Brian Anderson
85212840c0
Remove unused functions from metadata::csearch
2011-07-08 09:37:01 -07:00
Brian Anderson
9ebb60d38b
Extract various dependencies from metadata::decoder to metadata::csearch
2011-07-08 09:37:01 -07:00
Brian Anderson
7ae711fc03
Begin splitting metadata::decoder into decoding and crate search modules
2011-07-08 09:37:01 -07:00
Brian Anderson
cc2924068f
Replace various ints with ast::crate_nums
2011-07-08 09:37:01 -07:00
Brian Anderson
85535fc3e0
Move crate_map from resolve to cstore
2011-07-08 09:37:00 -07:00
Brian Anderson
513b2276c2
Remove non-existant export from metadata::decoder
2011-07-08 09:37:00 -07:00
Brian Anderson
51e60b6565
Comment creader
2011-07-08 09:37:00 -07:00
Brian Anderson
639cf1a8ff
Comment cstore
2011-07-08 09:37:00 -07:00
Brian Anderson
58d288a4f7
Move used_link_args from session to cstore
2011-07-08 09:37:00 -07:00
Brian Anderson
4bfa269fe7
Move used_libraries from session to cstore
2011-07-08 09:37:00 -07:00
Brian Anderson
1386420cad
Move used_crate_files from session to cstore
2011-07-08 09:37:00 -07:00
Brian Anderson
82983e5005
Replace the crate cache in session with the one in cstore
2011-07-08 09:37:00 -07:00
Brian Anderson
b23ecd47ce
Introduce metadata::cstore
...
I intend for this to be the location for storing all the data retrieved by
creader, most of which is currently in the session.
2011-07-08 09:37:00 -07:00
Patrick Walton
e1b107d74e
rustc: Remove all exterior vectors from the AST
2011-07-07 18:39:05 -07:00
Brian Anderson
6ee1ffe4ac
Rename encoder::ty_str to encoded_str
2011-07-07 13:31:12 -07:00
Brian Anderson
de88739350
Don't expert def_to_str from metadata::encoder
2011-07-07 13:31:12 -07:00
Brian Anderson
7d26d1d67b
Move tyencode::ty_str to metadata::encoder
2011-07-07 13:31:12 -07:00
Brian Anderson
73963eae9a
Refactor tyencode::ty_str to not require a tyencode::ctxt
...
All users were constructing the context the same way.
2011-07-07 13:31:11 -07:00
Brian Anderson
e29ef1bec2
Refactor a few things in the metadata module
...
Rename metadata::tags to metadata::common. Move some utility functions from
metadata::encoder to metadata::common.
2011-07-07 13:31:11 -07:00
Brian Anderson
b723082cdb
Rename hash_def_id to hash_node_id
2011-07-07 13:31:11 -07:00
Brian Anderson
d2362599d6
Remove metadata::encoder's dependence on trans::node_id_type
2011-07-07 13:31:11 -07:00
Patrick Walton
0e2fff5337
rustc: Change lots of AST nodes to use interior vectors
2011-07-07 12:53:17 -07:00
Patrick Walton
401b6362d7
rustc: Make meta items into interior vectors
2011-07-06 15:46:03 -07:00
Patrick Walton
0226f56115
rustc: Convert attribute in the AST to interior vectors
2011-07-06 15:15:00 -07:00
Patrick Walton
7714cb297b
rustc: Make AST paths use interior vectors
2011-07-06 15:14:52 -07:00
Patrick Walton
1d57800236
rustc: Migrate tag variants to interior vectors
2011-07-06 15:13:54 -07:00
Patrick Walton
2e1aa04fcd
rustc: Make object methods into interior vectors
2011-07-06 15:13:47 -07:00
Patrick Walton
717ac3df77
rustc: Make the various constraint-related types in middle::ty use interior vectors
2011-07-06 12:05:06 -07:00
Patrick Walton
cb2018c6db
rustc: Change constraints in types to use interior vectors
2011-07-06 12:04:07 -07:00
Patrick Walton
13d920c10d
rustc: Switch tag type parameters to interior vectors
2011-07-06 12:03:55 -07:00
Patrick Walton
ede35f4c43
rustc: Use interior vectors for tag type parameters
2011-07-06 12:03:06 -07:00
Patrick Walton
bbdba21b1f
rustc: Revert the conversion to interior vectors due to heap corruption
2011-07-06 11:26:26 -07:00
Patrick Walton
c927d97fa0
rustc: Convert attribute in the AST to interior vectors
2011-07-06 11:09:08 -07:00
Patrick Walton
1591955adf
rustc: Make AST paths use interior vectors
2011-07-06 11:09:08 -07:00
Patrick Walton
5703bd1760
rustc: Migrate tag variants to interior vectors
2011-07-06 11:09:07 -07:00
Patrick Walton
52a7c2b78e
rustc: Make object methods into interior vectors
2011-07-06 11:09:07 -07:00
Patrick Walton
b9a2117475
rustc: Make the various constraint-related types in middle::ty use interior vectors
2011-07-06 11:09:06 -07:00
Patrick Walton
8bee69da25
rustc: Change constraints in types to use interior vectors
2011-07-06 11:09:06 -07:00
Patrick Walton
f391acbd3f
rustc: Switch tag type parameters to interior vectors
2011-07-06 11:09:06 -07:00
Patrick Walton
09e591c12f
rustc: Use interior vectors for tag type parameters
2011-07-06 11:09:06 -07:00
Marijn Haverbeke
7661c08496
Remove temporary stdlib placeholders, use actual stdlib functions
...
(Possible now that a snapshot took place.)
2011-07-06 16:46:17 +02:00
Brian Anderson
2cb129355b
Change ast::meta_name_value to accept any literal, not just string
...
This isn't useful for much of anything yet, since metadata::encoder doesn't
know how to handle the non-string variants.
Issue #611
2011-07-05 17:25:18 -07:00
Brian Anderson
375f0b2211
Require that the meta items in a use statement have unique names
2011-07-05 16:12:24 -07:00
Marijn Haverbeke
6fd6fdea93
Move everything syntax-related to syntax/, break deps on rest of compiler
...
src/comp/syntax is currently just a sub-module of rustc, but it will,
in the near future, be its own crate. This includes:
- The AST data structure
- The parser
- The pretty-printer
- Visit, walk, and fold
- The syntax extension system
- Some utility stuff that should be in the stdlib*
*) Stdlib extensions currently require a snapshot before they can be
used, and the win build is very broken right now. This is temporary
and will be cleaned up when one of those problems goes away.
A lot of code was moved by this patch, mostly towards a more organized
layout. Some package paths did get longer, and I guess the new layout
will take some getting used to. Sorry about that!
Please try not to re-introduce any dependencies in syntax/ on any of
the other src/comp/ subdirs.
2011-07-05 15:57:21 +02:00
Patrick Walton
5d2c189631
rustc: Remove obsolete "The second has to be authed pure" comment
2011-07-04 19:08:25 -07:00
Rafael Ávila de Espíndola
b669430f72
Use metadata to avoid always passing -Lrustllvm to the linker.
2011-07-04 13:22:23 -04:00
Rafael Ávila de Espíndola
6b1da80eb4
Simplify.
2011-07-04 11:36:10 -04:00
Patrick Walton
d39c59ae41
rustc: Move path_to_str to front::ast
2011-07-01 17:22:18 -07:00
Patrick Walton
f7a2f01746
Revert "rustc: Change methods in ty::t to use interior vectors"
...
This reverts commit 6720ea760d
.
2011-07-01 11:37:19 -07:00
Patrick Walton
6720ea760d
rustc: Change methods in ty::t to use interior vectors
2011-07-01 11:33:17 -07:00
Brian Anderson
70a28dc238
Cleanup attribute code. Issue #487
2011-07-01 10:45:30 -07:00
Marijn Haverbeke
77f5d14f14
Track def_ids of native types so that they can be distinguished
...
Closes #526
2011-07-01 18:39:24 +02:00
Patrick Walton
108cc4e0ed
rustc: Change function argument types to interior vectors
2011-06-30 16:11:39 -07:00
Tim Chevalier
d8db9a0fe1
Kill unused variables
2011-06-30 12:37:30 -07:00
Patrick Walton
add9031dd5
rustc: Use interior vectors for record types
2011-06-30 12:02:40 -07:00
Patrick Walton
b841152a40
rustc: Use interior vectors for tuple types
2011-06-30 11:35:05 -07:00
Brian Anderson
5de916dd5c
Move middle::attr to front::attr
2011-06-30 10:06:26 -07:00
Marijn Haverbeke
86f16b90cd
Support type parameters in resources
...
Some rather dodgy code was added to trans in the process. I'd love to
discuss it with someone who knows more about types during translation.
2011-06-30 18:36:12 +02:00
Marijn Haverbeke
31ec26d46a
Make calling resource destructors work cross-crate
...
Tydescs are currently re-created for each compilation unit (and I
guess for structural types, they have to be, though the duplication
still bothers me). This means a destructor can not be inlined in the
drop glue for a resource type, since other crates don't have access to
the destructor body.
Destructors are now compiled as separate functions with an external
symbol that can be looked up in the crate (under the resource type's
def_id), and called from the drop glue.
2011-06-30 18:36:12 +02:00
Graydon Hoare
c796a8f24d
Re-enable tidy (it was broken) and fix various non-tidy things.
2011-06-29 15:14:55 -07:00
Brian Anderson
190644063e
Be more strategic about linking to rust crates
...
Instead of linking directly to the rust crate, try to figure out the location
and name of the library from the file name, then call gcc with appropriate -L,
-l flags. This will allow dynamic linking to be more forgiving about where it
loads the library from at runtime - currently a stage3 compiler can't run
correctly from the stage0 directory. Only tested on Linux. Fingers crossed.
2011-06-29 14:35:39 -07:00
Brian Anderson
29afe1a518
Write metadata for sythesized name/vers items to the crate's link attr
...
If the crate doesn't specify it's name or version, the defaults need to be
exported in the crate metadata
2011-06-29 14:21:39 -07:00
Graydon Hoare
5b2c17fba5
Fix resource encoding bugs.
2011-06-29 12:14:29 -07:00