about summary refs log tree commit diff
path: root/src/comp/util
AgeCommit message (Collapse)AuthorLines
2011-07-07rustc: Change lots of AST nodes to use interior vectorsPatrick Walton-8/+10
2011-07-06rustc: Make object methods into interior vectorsPatrick Walton-3/+4
2011-07-06rustc: Change constraints in types to use interior vectorsPatrick Walton-3/+3
2011-07-06rustc: Use interior vectors for tag type parametersPatrick Walton-3/+4
2011-07-06rustc: Revert the conversion to interior vectors due to heap corruptionPatrick Walton-11/+9
2011-07-06rustc: Make object methods into interior vectorsPatrick Walton-3/+4
2011-07-06rustc: Change constraints in types to use interior vectorsPatrick Walton-3/+3
2011-07-06rustc: Use interior vectors for tag type parametersPatrick Walton-3/+4
2011-07-06Remove temporary stdlib placeholders, use actual stdlib functionsMarijn Haverbeke-6/+5
(Possible now that a snapshot took place.)
2011-07-05Move everything syntax-related to syntax/, break deps on rest of compilerMarijn Haverbeke-149/+211
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-05Move pretty-printing 'modes' into a callback hookMarijn Haverbeke-1/+0
This way, the pretty-printer does not have to know about middle::ty. (This is a preparation for separating the AST functionality into a separate crate.)
2011-06-30rustc: Use interior vectors for tuple typesPatrick Walton-1/+1
2011-06-28Replace common::new_seq_hash with an adapter around std::smallintmapBrian Anderson-102/+0
It would be better to either convert ast_map to use smallintmap or make smallintmap and hashmap follow the same interface, but I don't feel up to it just now. Closes #585.
2011-06-26Add a very simple map implementation for sequential integer keysBrian Anderson-0/+103
Use it for the ast_map. Cuts 40% off the time spent prior to LLVM.
2011-06-22Compute typestate properly for moveTim Chevalier-0/+9
typestate now drops constraints correctly in the post-state of a move expression or a declaration whose op is a move. It doesn't yet drop constraints mentioning variables that get updated. To do this, I had to change typestate to use trit-vectors instead of bit-vectors, because for every constraint, there are three possible values: known-to-be-false (e.g. after x <- y, init(y) is known-to-be-false), known-to-be-true, and unknown. Before, we conflated known-to-be-false with unknown. But move requires them to be treated differently. Consider: (program a) (a1) x = 1; (a2) y <- x; (a3) log x; (program b) (b1) x = 1; (b2) y <- z; (b3) log x; With only two values, the postcondition of statement a2 for constraint init(x) is the same as that of b2: 0. But in (a2)'s postcondition, init(x) *must* be false, but in (b2)'s condition, it's just whatever it was in the postcondition of the preceding statement.
2011-06-21Move expr ids into the expr record typeMarijn Haverbeke-2/+2
This simplifies the tag variants a bit and makes expr_node_id obsolete.
2011-06-16Consistify ast::local.Paul Stansifer-2/+2
2011-06-16Refactor ast::item representationMarijn Haverbeke-20/+0
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-15Reformat source tree (minus a couple tests that are still grumpy).Graydon Hoare-143/+83
2011-06-15rustc: Make room in remaining AST item nodes for attributesBrian Anderson-6/+6
Issue #487
2011-06-15rustc: Make room in item_mod for metadataBrian Anderson-1/+1
Issue #487
2011-06-13Change decl to local in expr_for and expr_for_eachTim Chevalier-1/+1
Since the decl in a for or for-each loop must always be a local decl, I changed the AST to express this. Fewer potential match failures and "the impossible happened" error messages = yay!
2011-06-09rustc: Annotate vector and string literals in the AST with their uniqueness ↵Patrick Walton-2/+4
or lack thereof
2011-06-09Further support for predicate constraintsTim Chevalier-2/+33
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-01Redo typestate-related data structures to support predicate constraints. No ↵Tim Chevalier-0/+63
actual support yet, just infrastructure.
2011-05-31Now imports are not re-exported unless 'export' is explicitly used.Paul Stansifer-1/+1
2011-05-31Consolidate formatting functions a bit more.Graydon Hoare-98/+10
2011-05-31Fix utility printers to flush eof in common.rs.Graydon Hoare-0/+6
2011-05-31Improve handling of trailing comments.Graydon Hoare-0/+7
2011-05-31Add span to field to catch per-field comments in rec exprs.Graydon Hoare-1/+1
2011-05-31new pretty printerGraydon Hoare-7/+7
2011-05-31rustc: Remove unneeded type params from alt patternsBrian Anderson-3/+3
2011-05-26Remove unused importsTim Chevalier-1/+0
2011-05-26Remove residual uses of fold, and fold itself.Graydon Hoare-26/+18
2011-05-20Make controlflow part of a function typeTim Chevalier-0/+5
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-20rustc: Move the interner to a new module intended to be used for general ↵Patrick Walton-42/+44
data structures
2011-05-19remove now-unused ts field from annTim Chevalier-13/+2
2011-05-19add a bunch more logging thingsTim Chevalier-0/+35
2011-05-17rustc: Don't rebuild the AST when typechecking expressionsPatrick Walton-5/+11
2011-05-17rustc: Flatten annotationsPatrick Walton-11/+0
2011-05-17Finally rename std::_xxx to std::xxxMarijn Haverbeke-11/+11
Except for _task, which is still a keyword.
2011-05-16Merge remote branch 'origin/master' into HEADGraydon Hoare-189/+23
Conflicts: src/comp/middle/trans.rs
2011-05-16Rewrite everything to use [] instead of vec() in value position.Graydon Hoare-2/+2
2011-05-16Started adding support for return checking and non-returning function ↵Tim Chevalier-189/+23
annotations * Reorganized typestate into several modules. * Made typestate check that any function with a non-nil return type returns a value. For now, the check is a warning and not an error (see next item). * Added a "bot" type (prettyprinted as _|_), for constructs like be, ret, break, cont, and fail that don't locally return a value that can be inspected. "bot" is distinct from "nil". There is no concrete syntax for _|_, while the concrete syntax for the nil type is (). * Added support to the parser for a ! annotation on functions whose result type is _|_. Such a function is required to have either a fail or a call to another ! function that is reached in all control flow paths. The point of this annotation is to mark functions like unimpl() and span_err(), so that an alt with a call to err() in one case isn't a false positive for the return-value checker. I haven't actually annotated anything with it yet. * Random bugfixes: * * Fixed bug in trans::trans_binary that was throwing away the cleanups for nested subexpressions of an and or or (tests: box-inside-if and box-inside-if2). ** In typeck, unify the expected type arguments of a tag with the actual specified arguments.
2011-05-16rustc: Factor out the code that interns types into an "interner" data structurePatrick Walton-0/+42
2011-05-13rustc: Write nil types into the node type table wherever plain_ann() is usedPatrick Walton-5/+0
2011-05-12Downcase std modules again, move to :: for module dereferencingMarijn Haverbeke-114/+114
This should be a snapshot transition.
2011-05-12Ensure ann tags are actually kept around during typecheckingMarijn Haverbeke-3/+3
This way, the tag assigned by the parser stays with the node. I realize ann replacing is probably going away real soon, but I needed this now for moving the resolve defs out of the AST.
2011-05-10rustc: Number everything with an annotationPatrick Walton-1/+1
2011-05-09Alias-ify fold and its users, remove another 85kb.Graydon Hoare-3/+3