summary refs log tree commit diff
path: root/src/libsyntax/ext/deriving/cmp
AgeCommit message (Collapse)AuthorLines
2013-09-03Modernized a few more types in syntax::astMarvin Löbel-14/+14
2013-09-01Modernized a few type names in rustc and syntaxMarvin Löbel-14/+14
2013-08-04syntax: make #[deriving(TotalOrd)] lazy.Huon Wilson-16/+47
Previously it would call: f(sf1.cmp(&of1), f(sf2.cmp(&of2), ...)) (where s/of1 = 'self/other field 1', and f was std::cmp::lexical_ordering) This meant that every .cmp subcall got evaluated when calling a derived TotalOrd.cmp. This corrects this to use let test = sf1.cmp(&of1); if test == Equal { let test = sf2.cmp(&of2); if test == Equal { // ... } else { test } } else { test } This gives a lexical ordering by short-circuiting on the first comparison that is not Equal.
2013-07-20syntax: modernise attribute handling in syntax::attr.Huon Wilson-11/+10
This does a number of things, but especially dramatically reduce the number of allocations performed for operations involving attributes/ meta items: - Converts ast::meta_item & ast::attribute and other associated enums to CamelCase. - Converts several standalone functions in syntax::attr into methods, defined on two traits AttrMetaMethods & AttributeMethods. The former is common to both MetaItem and Attribute since the latter is a thin wrapper around the former. - Deletes functions that are unnecessary due to iterators. - Converts other standalone functions to use iterators and the generic AttrMetaMethods rather than allocating a lot of new vectors (e.g. the old code would have to allocate a new vector to use functions that operated on &[meta_item] on &[attribute].) - Moves the core algorithm of the #[cfg] matching to syntax::attr, similar to find_inline_attr and find_linkage_metas. This doesn't have much of an effect on the speed of #[cfg] stripping, despite hugely reducing the number of allocations performed; presumably most of the time is spent in the ast folder rather than doing attribute checks. Also fixes the Eq instance of MetaItem_ to correctly ignore spaces, so that `rustc --cfg 'foo(bar)'` now works.
2013-06-27Remove many shared pointersPhilipp Brüschweiler-2/+0
Mostly just low-haning fruit, i.e. function arguments that were @ even though & would work just as well. Reduces librustc.so size by 200k when compiling without -O, by 100k when compiling with -O.
2013-06-25great renaming propagation: syntaxCorey Richardson-8/+2
2013-06-07syntax: correct the modifications to deriving(Ord) so that it works.Huon Wilson-30/+13
2013-06-07syntax: rewrite deriving(Ord) to not require Eq.Huon Wilson-57/+59
lt and gt are implement directly in terms of the corresponding method on their elements, and le and ge are the negations of these.
2013-06-07syntax: move expand_generic_deriving to be a method on TraitDefHuon Wilson-11/+4
2013-05-22syntax: Change syntax extensions to expand to `std::foo` instead of `core::foo`Patrick Walton-8/+8
2013-05-22libextra: Rename the actual metadata names of libcore to libstd and libstd ↵Patrick Walton-0/+6
to libextra
2013-05-22syntax/ext: convert all AstBuilder methods to a uniform syntax.Huon Wilson-30/+24
2013-05-22syntax/ext: migrate build.rs functions to AstBuilder methods.Huon Wilson-20/+20
2013-05-22syntax/ext: modernise ext_ctxt to be CamelCase and use new.Huon Wilson-14/+14
2013-05-21syntax/ext: remove the ~str dependence of the deriving code.Huon Wilson-17/+17
2013-05-15auto merge of #6500 : kud1ing/rust/cleanup, r=bstriebors-8/+0
Fixes #6445
2013-05-15remove deriving_eq, deriving_iter_bytes, deriving_clone (deprecated in 0.6)Lenny222-8/+0
2013-05-14rustc: rename ast::self_ty and related fields to explicit_selfErick Tryzelaar-4/+4
2013-05-14syntax: Remove #[allow(vecs_implicitly_copyable)]Alex Crichton-6/+7
2013-05-09Use a specialized string interner to reduce the need for owned stringsBjörn Steinbrink-11/+11
&str can be turned into @~str on demand, using to_owned(), so for strings, we can create a specialized interner that accepts &str for intern() and find() but stores and returns @~str.
2013-05-07libsyntax: extend generic deriving code to handle almost all possible traits.Huon Wilson-39/+47
This adds support for static methods, and arguments of most types, traits with type parameters, methods with type parameters (and lifetimes for both), as well as making the code more robust to support deriving on types with lifetimes (i.e. 'self).
2013-04-12libsyntax: (maybe) fix deriving(TotalOrd) on windowsHuon Wilson-6/+6
2013-04-12libsyntax: short-circuit on non-matching variants in deriving code.Huon Wilson-41/+29
Allow a deriving instance using the generic code to short-circuit for any non-matching enum variants (grouping them all into a _ match), reducing the number of arms required. Use this to speed up the Eq & TotalEq implementations.
2013-04-12libsyntax: derive Clone, Eq, TotalEq, Ord, TotalOrd with the new generic ↵Huon Wilson-0/+329
deriving code. Closes #4269, #5588 and #5589.