about summary refs log tree commit diff
path: root/src/comp/middle
AgeCommit message (Collapse)AuthorLines
2011-07-06Remove temporary stdlib placeholders, use actual stdlib functionsMarijn Haverbeke-33/+33
(Possible now that a snapshot took place.)
2011-07-05Forwarding functions. Lots of progress toward #539, #540, #543.Lindsey Kuper-93/+473
2011-07-05Comments and cleanup.Lindsey Kuper-6/+13
2011-07-05Handle pattern-bound upvarsTim Chevalier-49/+162
If a closure inside a case alternative (for example, a for each loop) referenced a pattern-bound variable, this would cause an assertion failure in trans. Changed trans::collect_upvars to handle pattern-bound vars correctly. Incidentally, eliminated all direct uses of option::get in trans.
2011-07-05Handle fail inside a for-each loop properlyTim Chevalier-1/+5
2011-07-05handle fail inside a for loopTim Chevalier-1/+4
2011-07-05Handle fail as an argumentTim Chevalier-0/+8
2011-07-05Make type unification failures non-fatalBrian Anderson-16/+24
Add a failure checkpoint after the typechecking pass. There are still many fatal errors in typeck, but loosening up this one makes it easier to lean on the compiler when making changes to types. Issue #440.
2011-07-05Factor the ivec code a touch.Graydon Hoare-52/+40
2011-07-05Don't thread the local crate number through the sessionMarijn Haverbeke-6/+5
It's a constant, anyway.
2011-07-05Move everything syntax-related to syntax/, break deps on rest of compilerMarijn Haverbeke-1121/+224
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-04Switch the alias checking pass to use span_err instead of span_fatalMarijn Haverbeke-12/+13
It'll now spit out all problems it finds, and only abort after the whole pass has run.
2011-07-04Move the ids of pat AST nodes into their structMarijn Haverbeke-56/+44
Just like it was done with items and exprs. Simplifies some code.
2011-07-03Make use of demand::simple instead of manually checking fail expr type.Josh Matthews-11/+1
2011-07-03Make non-str fail expression a type checking failure instead of a ↵Josh Matthews-4/+19
translation one.
2011-07-03Handle fail as an argument; parse fail expressions unambiguouslyTim Chevalier-0/+5
An expression like: foo(1, fail, 2) was failing to parse, because the parser was interpreting the comma as the start of an expression that was an argument to fail, rather than recognizing that the fail here has no arguments Fixed this by using can_begin_expr to determine whether the next token after a fail token suggests that this is a nullary fail or a unary fail. In addition, when translating calls, check before translating each argument that the block still isn't terminated. This has the effect that if an argument list includes fail, the back-end won't keep trying to generate code for successive arguments and trip the !*terminated assertion.
2011-07-03Eliminate all direct calls to option::get() from typeckTim Chevalier-21/+55
This means fewer mysterious error messages.
2011-07-03Manipulate contexts correctly in trans_fail_exprTim Chevalier-7/+11
This fixes Issue #617
2011-07-02Generate code properly for calls with _|_ - typed argumentsTim Chevalier-19/+25
The code for translating a fail (for example) would call Unreachable(), which terminates the block; if a fail appeared as an argument, this would cause an LLVM assertion failure. Changed trans_call to handle this situation correctly.
2011-07-02Allow any string expression to be used with fail.Josh Matthews-15/+61
2011-07-01rustc: Fix memory corruption with ivectors-inside-ivectors by duplicating ↵Patrick Walton-2/+2
*first*, and *then* copying subtypes.
2011-07-01rustc: Move path_to_str to front::astPatrick Walton-16/+3
2011-07-01Revert "rustc: Change methods in ty::t to use interior vectors"Patrick Walton-38/+33
This reverts commit 6720ea760df41df82af880b593e5b6023608d6cd.
2011-07-01rustc: Change methods in ty::t to use interior vectorsPatrick Walton-33/+38
2011-07-01Remove the concept of crate directive let statements. Issue #604Brian Anderson-12/+0
2011-07-01Track def_ids of native types so that they can be distinguishedMarijn Haverbeke-26/+37
Closes #526
2011-07-01Allow dereferencing of single-variant, single-argument tag valuesMarijn Haverbeke-81/+141
(Using the * operator.) This makes tags more useful as nominal 'newtype' types, since you no longer have to copy out their contents (or construct a cumbersome boilerplate alt) to access them. I could have gone with a scheme where you could dereference individual arguments of an n-ary variant with ._0, ._1, etc, but opted not to, since we plan to move to a system where all variants are unary (or, I guess, nullary).
2011-07-01Do not store a tag num for single-variant tagsMarijn Haverbeke-119/+142
This is a preparation for tags-as-nominal-types. A tag that has only a single variant is now represented, at run-time, as simply a tuple of the variant's parameters, with the variant id left off.
2011-07-01Implement autoderef for function calls.Michael Sullivan-23/+51
This is important since we are going to be making functions noncopyable soon, which means we'll be seeing a lot of boxed functions. (*f)(...) is really just too heavyweight. Doing the autodereferencing was a very little bit tricky since trans_call works with an *lval* of the function whereas existing autoderef code was not for lvals.
2011-07-01Move autoderefed_ty to ty.rs and rename it type_autoderef.Michael Sullivan-14/+15
2011-06-30rustc: Duplicate heap data of interior vectors when passing them by valuePatrick Walton-1/+15
2011-06-30rustc: Remove unused variables from last commitPatrick Walton-2/+0
2011-06-30rustc: Change function argument types to interior vectorsPatrick Walton-65/+87
2011-06-30Get rid of remaining unused variablesTim Chevalier-6/+4
2011-06-30Don't warn about unused for-loop index variablesTim Chevalier-0/+4
2011-06-30Kill unused variablesTim Chevalier-68/+30
2011-06-30Warn for unused variablesTim Chevalier-69/+122
Modify typestate to check for unused variables and emit warnings where relevant. This exposed a (previously harmless) bug in collect_locals where outer functions had bit-vector entries for init constraints for variables declared in their inner nested functions. Fixing that required changing collect_locals to use visit instead of walk -- probably a good thing anyway.
2011-06-30rustc: Use interior vectors for record typesPatrick Walton-23/+20
2011-06-30rustc: Make mk_imm_tup() take an interior vectorPatrick Walton-48/+65
2011-06-30rustc: Use interior vectors for tuple typesPatrick Walton-18/+22
2011-06-30Added a nanosecond timer to time.rs, support for some floating point casts, ↵Eric Holk-1/+16
and a commandline-driven mode for pfib.rs
2011-06-30Move middle::attr to front::attrBrian Anderson-167/+0
2011-06-30Support type parameters in resourcesMarijn Haverbeke-63/+135
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-30Make calling resource destructors work cross-crateMarijn Haverbeke-25/+51
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-29Re-enable tidy (it was broken) and fix various non-tidy things.Graydon Hoare-3/+5
2011-06-29Remove workaround for a compiler bug that, I guess, got fixedTim Chevalier-14/+3
2011-06-29Add a runtime flag to enable/disable claims en masseTim Chevalier-6/+17
Now, if the environment variable CHECK_CLAIMS is set, then all claims turn into checks. Otherwise, claims are no-ops.
2011-06-29Write metadata for sythesized name/vers items to the crate's link attrBrian Anderson-0/+17
If the crate doesn't specify it's name or version, the defaults need to be exported in the crate metadata
2011-06-29Move the calculation of the crate name, vers and cmh to a single functionBrian Anderson-11/+4
2011-06-29Fix resource encoding bugs.Graydon Hoare-0/+1