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
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
51e60b6565
Comment creader
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
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
Patrick Walton
401b6362d7
rustc: Make meta items into interior vectors
2011-07-06 15:46:03 -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
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
Brian Anderson
5de916dd5c
Move middle::attr to front::attr
2011-06-30 10:06:26 -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
83b7215366
Cleanup attribute code. Issue #487
2011-06-28 16:55:07 -07:00
Brian Anderson
1c6ae8cadf
Use span_fatal for failure to find crates
2011-06-28 16:04:09 -07:00
Brian Anderson
a83b64d15d
Rework how linkage attributes are determined
...
The meta items within a crate's link attribute are used in linkage:
#[link(name = "std",
vers = "1.0",
custom = "whatever")];
Name and vers are treated specially, and everything else is hashed together
into the crate meta hash.
Issue #487
2011-06-28 15:25:47 -07:00
Brian Anderson
cab73f8897
Write metadata for more meta_item types. Issue #487
2011-06-28 10:12:05 -07:00
Brian Anderson
d328c7e03e
List crate attributes when running rustc with '--ls'
2011-06-28 10:03:40 -07:00
Rafael Ávila de Espíndola
ecc080ed0b
Use "" in the native_name as an indication that no extra options have to
...
be passed to the "linker". Use that for libc.
2011-06-28 08:21:13 -04:00
Brian Anderson
a72481f90b
Rename metadata::defs to metadata::tags
2011-06-27 16:43:50 -07:00
Brian Anderson
45efb1f02a
Cleanup in metadata module
2011-06-27 16:30:27 -07:00
Brian Anderson
119193497e
Extract metadata::decoder from metadata::creader
2011-06-27 16:30:27 -07:00
Brian Anderson
a3a2cc3d98
Extract metadata::tydecode from metadata::creader
2011-06-27 16:30:27 -07:00
Brian Anderson
33294c7293
Extract llvm-independent code from cwriter to metadata::encoder
2011-06-27 16:30:27 -07:00
Brian Anderson
279a229414
Move metadata tag definition to metadata::defs
2011-06-27 16:30:27 -07:00
Brian Anderson
ba5c7a570d
Rename middle::metadata to metadata::cwriter. Move creader to metadata
...
Preparation for a lot more metadata refactoring
2011-06-27 16:30:27 -07:00