about summary refs log tree commit diff
path: root/src/comp/middle/metadata.rs
AgeCommit message (Collapse)AuthorLines
2011-06-27Rename middle::metadata to metadata::cwriter. Move creader to metadataBrian Anderson-817/+0
Preparation for a lot more metadata refactoring
2011-06-27Limit exports from middle::metadataBrian Anderson-0/+26
2011-06-27Index obj and res ctor metadata by ctor id, not item idBrian Anderson-12/+16
Both the type and the ctor were trying to use the same id and this was making creader unable to find the ctor when running 'rustc --ls'
2011-06-25Partial implementation of resourcesMarijn Haverbeke-0/+35
Non-copyability is not enforced yet, and something is still flaky with dropping of the internal value, so don't actually use them yet. I'm merging this in so that I don't have to keep merging against new patches.
2011-06-24Sanitize use of ids for obj constructors.Marijn Haverbeke-1/+1
Typeck and trans used to, by historical coincidence, use the item_obj node id, which was used to identify the obj type by the rest of the system, for the constructor function. This is now identified by the ctor id stored in the tag throughout.
2011-06-24Remove def_objMarijn Haverbeke-1/+1
Since obj constructors and types have different def_ids now, their def can simply be a def_fn and a def_ty.
2011-06-22rustc: Downcase metadata::EncodeBrian Anderson-2/+2
2011-06-22rustc: Introduce and parse additional meta_item formsBrian Anderson-6/+14
Examples: #[test], #[link(name = "vers")] Issue #487
2011-06-21Serialize constraints in types (literal arguments still not supported)Tim Chevalier-13/+18
This involved, in part, changing the ast::def type so that a def_fn has a "purity" field. This lets the typechecker determine whether functions defined in other crates are pure. It also required updating some error messages in tests. As a test for cross-crate constrained functions, I added a safe_slice function to std::str (slice(), with one of the asserts replaced with a function precondition) and some test cases (various versions of fn-constraint.rs) that call it. Also, I changed "fn" to "pred" for some of the boolean functions in std::uint.
2011-06-21Move names and ids of native items into their recs, rather than their tagsMarijn Haverbeke-22/+11
2011-06-20Make trans use the new ast_map instead of building its ownMarijn Haverbeke-8/+12
2011-06-20Get rid of def_ids and anns in AST nodes, use single node_idMarijn Haverbeke-108/+107
This reduces some redundancy in the AST data structures and cruft in the code that works with them. To get a def_id from a node_id, apply ast::local_def, which adds the local crate_num to the given node_id. Most code only deals with crate-local node_ids, and won't have to create def_ids at all.
2011-06-16Reformat a bunch of recent churn.Graydon Hoare-2/+2
2011-06-16Refactor ast::item representationMarijn Haverbeke-60/+62
Most of the fields in an AST item were present in all variants. Things could be simplified considerably by putting them in the rec rather than in the variant tags.
2011-06-15Refactor data structures representing constraints (again...)Tim Chevalier-5/+4
I added a "resolved" version of the ast::constr type -- ty::constr_def -- that has a def_id field instead of an ann_field. This is more consistent with other types and eliminates some checking. Incidentally, I removed the def_map argument to the top-level function in middle::alias, since the ty::ctxt already has a def_map field.
2011-06-15Reformat source tree (minus a couple tests that are still grumpy).Graydon Hoare-163/+98
2011-06-15rustc: Make room in remaining AST item nodes for attributesBrian Anderson-12/+12
Issue #487
2011-06-15rustc: Make room in item_mod for metadataBrian Anderson-2/+2
Issue #487
2011-06-15Fix assignments to immutable fields throughout the codeMarijn Haverbeke-5/+5
2011-06-10Reject programs with unsatisfied predicate constraintsTim Chevalier-1/+3
Generate appropriate constraints for calls to functions with preconditions, and reject calls where those constraints don't hold true in the prestate. ...by which I mean that it works for one test case :-)
2011-06-10Encode meta tags in the crate and start sketching enhanced logic for ↵Graydon Hoare-0/+36
resolving crate "use" directives. Now with extra "works on OSX" kludging.
2011-06-10Implement mutable/immutable alias distinction.Marijn Haverbeke-1/+7
Before, all aliases were implicitly mutable, and writing &mutable was the same as writing &. Now, the two are distinguished, and assignments to regular aliases are no longer allowed.
2011-06-09Revert "Encode meta tags in the crate and start sketching enhanced logic for ↵Patrick Walton-36/+0
resolving crate "use" directives." due to tree bustage This reverts commit ab3635eebef2b8cf0e19cdbc5b4e8dd7a49a4658.
2011-06-09rustc: Write interior vecs and strings into the metadata and add logic for ↵Patrick Walton-0/+2
them in ty_to_str
2011-06-09Encode meta tags in the crate and start sketching enhanced logic for ↵Graydon Hoare-0/+36
resolving crate "use" directives.
2011-06-09Further support for predicate constraintsTim Chevalier-5/+40
Changed function types to include a list of constraints. Added code for parsing and pretty-printing constraints. This necessitated splitting pprust into two files (pprust and ppaux) to break a circulate dependency, as ty_to_str now needs to print out constraints, which may include literals, but pprust depended on ty.
2011-06-07rustc: Use a set-based approach to unification; remove ty_bound_param and ↵Patrick Walton-11/+0
ty_local. Sorry, big perf regression; will fix soon.
2011-06-03Boilerplate for pointers. Sorry for missing this on the first patch.Rafael Ávila de Espíndola-0/+1
2011-06-01Don't create an empty section.Rafael Ávila de Espíndola-3/+3
2011-05-31rustc: Remove unneeded type params from alt patternsBrian Anderson-4/+4
2011-05-26Remove residual uses of fold, and fold itself.Graydon Hoare-1/+0
2011-05-20rustc: Don't write metadata for unexported itemsBrian Anderson-1/+4
2011-05-20Make controlflow part of a function typeTim Chevalier-6/+15
Change ty_fn to have a controlflow field. A 'controlflow' is essentially a bit of data that says whether or not this function never returns to the caller (if it never returns, that means it calls "fail" or another "never-returns" function on every control path). Also add syntax for annotating functions that never return: fn foo() -> ! { fail; } for example. Functions marked with ! implicitly have a result type of ty_bot, which is a new type that this commit also adds.
2011-05-17Finally rename std::_xxx to std::xxxMarijn Haverbeke-19/+19
Except for _task, which is still a keyword.
2011-05-16Merge remote branch 'origin/master' into HEADGraydon Hoare-0/+1
Conflicts: src/comp/middle/trans.rs
2011-05-16Rewrite everything to use [] instead of vec() in value position.Graydon Hoare-20/+20
2011-05-16Noticed that metadata::Encode::enc_sty didn't have a case for ty_task, so I ↵Tim Chevalier-0/+1
added one (though this wasn't causing the problem I was seeing...
2011-05-13Extend crate format to allow multiple definitions for a single nameMarijn Haverbeke-8/+8
The type/value namespace distinction pretty much works now. Module namespace is up next.
2011-05-12Downcase std modules again, move to :: for module dereferencingMarijn Haverbeke-257/+257
This should be a snapshot transition.
2011-05-12Change module dereference syntax from . to ::Marijn Haverbeke-1/+1
This will need to be a snapshot.
2011-05-11Rewrite comp/middle/resolve.rsMarijn Haverbeke-1/+1
* Cleans up the algorithm * Move first pass to walk (second still folds) * Support part of a type/value namespace split (crate metadata and module indices still need to be taught about this) * Remove a few blatant inefficiencies (import tables being recreated for every lookup, most importantly)
2011-05-10rustc: Cache intermediate results of metadata.Encode.ty_str. Shaves 30% off ↵Patrick Walton-1/+13
translation time.
2011-05-09Alias-ify walk, typeck, metadata. Cuts another 80kb off rustc.Graydon Hoare-37/+38
2011-05-09rustc: Alias fix part 1 -- Separate out AST modes from typechecker modes, ↵Patrick Walton-1/+1
and introduce an "either value or alias" mode
2011-05-06Rename std modules to be camelcasedMarijn Haverbeke-137/+137
(Have fun mergining your stuff with this.)
2011-05-05rustc: Add Rust intrinsic support to the crate metadata reader and writerPatrick Walton-0/+3
2011-05-04Add a structure for passing option flags around the compiler, put it in ↵Graydon Hoare-2/+2
session, and use it.
2011-05-03rustc: Refactor metadata.Encode.* to not require a type abbreviation table ↵Patrick Walton-35/+48
if abbreviation isn't enabled
2011-05-02Un-revert "Use different syntax for checks that matter to typestate", fixing ↵Patrick Walton-1/+1
the problem. This reverts commit d08b443fffb1181d8d45ae5d061412f202dd4118.
2011-05-02Revert "Use different syntax for checks that matter to typestate"Graydon Hoare-1/+1
This reverts commit aa25f22f197682de3b18fc4c8ba068d1feda220f. It broke stage2, not sure why yet.