about summary refs log tree commit diff
path: root/src/comp/middle
AgeCommit message (Collapse)AuthorLines
2012-01-27Move various trans_ modules under a trans:: umbrella moduleMarijn Haverbeke-192/+181
Closes #1304
2012-01-27Stop passing spans to middle::trans functions that don't need themMarijn Haverbeke-220/+161
Removes a bunch of (eventually) unused arguments. Makes span passing to debuginfo explicit, instead of relying on the (usually incorrect) spans held in the contexts. Closes #1439
2012-01-27Use the method name 'unary-' for overloading negationMarijn Haverbeke-1/+1
It's less likely to clash with something than 'neg'. Issue #1520
2012-01-26Make re-exporting of impls workMarijn Haverbeke-82/+105
Closes #1438
2012-01-26Use operator names for operator methodsMarijn Haverbeke-28/+20
The methods used to implement operators now simply use the name of the operator itself, except for unary -, which is called min to not clash with binary -. Index is called []. Closes #1520
2012-01-26Fix small bug in iface self typesMarijn Haverbeke-1/+3
Issue #1661
2012-01-26Allow operator overloading of the indexing operatorMarijn Haverbeke-56/+81
The method `op_index` (which takes a single argument) is used for this. Issue #1520
2012-01-26First stab at operator overloadingMarijn Haverbeke-139/+240
When no built-in interpretation is found for one of the operators mentioned below, the typechecker will try to turn it into a method call with the name written next to it. For binary operators, the method will be called on the LHS with the RHS as only parameter. Binary: + op_add - op_sub * op_mul / op_div % op_rem & op_and | op_or ^ op_xor << op_shift_left >> op_shift_right >>> op_ashift_right Unary: - op_neg ! op_not Overloading of the indexing ([]) operator isn't finished yet. Issue #1520
2012-01-26Remove ty_native_fnMarijn Haverbeke-104/+32
It was being used as a clumsy synonym of ty_fn.
2012-01-25(FIX) Change encoder::encode_metadata to return a [u8] (which will become an ↵Kevin Cantu-1/+1
LLVM string)
2012-01-25Implement implicit self type parameters for ifacesMarijn Haverbeke-62/+86
Closes #1661
2012-01-25Rename tag to enum throughout the compilerMarijn Haverbeke-262/+246
This should reduce confusion of people trying to read the code.
2012-01-25Replacing str::unsafe_from_bytes with str::from_bytes (part 3)Kevin Cantu-1/+1
2012-01-23s/block()/fn()/gNiko Matsakis-22/+21
2012-01-23Check that the names mentioned in tag exports are actually types (or variants)Tim Chevalier-2/+58
Check that in export foo{}, foo is an enum type, and that in export foo{bar, quux}, foo is an enum type and bar and quux are variants belonging to foo.
2012-01-23Export all enum variants by default; new syntax for selectively exporting ↵Tim Chevalier-0/+2
variants See issue 1426 for details. Now, the semantics of "export t;" where t is a tag are to export all of t's variants as well. "export t{};" exports t but not its variants, while "export t{a, b, c};" exports only variants a, b, c of t. To do: - documentation - there's currently no checking that a, b, c are actually variants of t in the above example - there's also no checking that t is an enum type, in the second two examples above - change the modules listed in issue 1426 that should have the old export semantics to use the t{} syntax I deleted the test export-no-tag-variants since we're doing the opposite now, and other tests cover the same behavior.
2012-01-21wrap lineNiko Matsakis-1/+2
2012-01-21unify size_of, align_of into one call (metrics)Niko Matsakis-104/+346
create some new (xfail'd) tests looking at tag variant alignment
2012-01-21migrate size_of() and related funcs from trans into shapeNiko Matsakis-263/+268
2012-01-21issue #1352: change param order on vec::init_elt, putting block in final ↵Graham Fawcett-18/+18
position. To match the init_fn() and init_fn_mut() changes.
2012-01-21fix #1352: change param order on vec::init_fn (and vec::init_fn_mut), ↵Graham Fawcett-4/+4
putting block in final position.
2012-01-22rustc: Specify lint checks via crate attributesHaitao Li-2/+97
A crate attribute like `#[lint(no_ctypes)]` can now be used to turn off ctypes checking. Issue #1543
2012-01-21rustc: Always resolve reexported names from original defHaitao Li-22/+2
Issue #1501
2012-01-20Handle fail after return correctly in typestateTim Chevalier-4/+18
Previously, typestate would conclude that this function was correctly diverging: fn f() -> ! { ret; fail; } even though it always returns to the caller. It wasn't handling the i_diverge and i_return bits correctly in the fail case. Fixed it. Closes #897
2012-01-19Handle predicates that recurse in a check() expressionTim Chevalier-9/+10
typestate was using the enclosing function ID for the "this function returns" constraint, which meant confusion and panic in the case where a predicate p includes "check p()". Fixed it to use a fresh ID. Closes #933
2012-01-19Additional ; to , changes, disable "tag" and ";" in parser. Close #1430. ↵Graydon Hoare-5/+5
Close #1428.
2012-01-19rustc: ";" to "," in enumsPatrick Walton-163/+163
2012-01-19rustc: Remove trailing whitespacePatrick Walton-1/+1
2012-01-19Compute typestates for FRU exprs correctly, plus a bit of cleanupTim Chevalier-50/+36
The code in Issue 948 was causing typestate to diverge because it was using the prestate for the whole expression -- not the post- state for the fields list -- as the prestate for the record base expression. Fixed. Closes #948
2012-01-19Handle log expressions with a _|_-typed levelTim Chevalier-0/+6
If we have log(foo, quux) where foo:_|_, just translate foo and ignore the rest of the expression. Closes #1459
2012-01-19rustc: Fix long linesPatrick Walton-3/+4
2012-01-19rustc: "tag" -> "enum"Patrick Walton-109/+109
2012-01-19In trans, allow _|_-typed things to be the argument to failTim Chevalier-1/+1
Rationale: _|_-typed things diverge, so it's safe to use them in any context. Closes #1465
2012-01-19treat fn*() as fn&()Niko Matsakis-3/+3
This is not my ideal way of going about things. I'd prefer not to have expressions typed as fn*(), for example, but I couldn't get that to work together with inferring the modes of arguments and other corner cases.
2012-01-19rustc: Refactor lint check and avoid a segv faultHaitao Li-19/+7
The segv fault issue is #1566
2012-01-19rustc: Name the lint-style check module `lint`Haitao Li-59/+75
Issue #1543
2012-01-19rustc: Add a usage pass to collect one-off analysesHaitao Li-29/+59
This patch starts from move the analysis which checkes of probably incorrectly usage of `int|uint` in native fn. Issue #1543
2012-01-19Remove support for the '.' after a nullary tag in a patternTim Chevalier-48/+47
(Commit also includes lots of changes to remove '.'s that a git merge messed up, or else it was monkeys.)
2012-01-18Remove '.' after nullary tags in patternsTim Chevalier-724/+724
Does what it says on the tin. The next commit will remove support for this syntax.
2012-01-18remove align_mode and rewrite GEP_tup_like to align correctlyNiko Matsakis-96/+64
Although the old version of GEP_tup_like was incorrect in some cases, I do not believe we ever used it in an incorrect fashion. In particular, it could go wrong with extended index sequences like [0, 1, 3], but as near as I can tell we only ever use it with short sequences like [0, i].
2012-01-18correct use of GEP_tup_like in closure constrNiko Matsakis-28/+36
also, streamline type_is_tup_like() to the cases which actually work
2012-01-19rustc: Use integer from ctypes consistentlyHaitao Li-41/+48
2012-01-19Use ctypes in native function declarationsHaitao Li-89/+106
2012-01-19rustc: Warn when int or uint is used in a native type declHaitao Li-0/+29
Issue #1403
2012-01-17use 64-bit memset on 64-bit platforms. Fixes #1546. Fixes #843.Niko Matsakis-22/+12
Actually, we don't "fix" #843 so much as close it: as with memmove, we simply use an alignment of 1 with dynamically sized types.
2012-01-17roll back commit 1c7a62Niko Matsakis-16/+16
2012-01-17Merge pull request #1544 from kevina/issue-1393Graydon Hoare-4/+4
Minor cleanups to custom discriminator code.
2012-01-17encode variant names and have log print them out.Niko Matsakis-3/+16
2012-01-17Allow omission of the '.' after nullary tag patternsTim Chevalier-127/+327
This commit allows patterns like: alt x { some(_) { ... } none { } } without the '.' after none. The parser suspends judgment about whether a bare ident is a tag or a new bound variable; instead, the resolver disambiguates. This means that any code after resolution that pattern-matches on patterns needs to call pat_util::normalize_pat, which consults an environment to do this disambiguation. In addition, local variables are no longer allowed to shadow tag names, so this required changing some code (e.g. renaming variables named "mut", and renaming ast::sub to subtract). The parser currently accepts patterns with and without the '.'. Once the compiler and libraries are changed, it will no longer accept the '.'.
2012-01-17Use a memset upcall to zero things without static alignmentMarijn Haverbeke-16/+16
This fixes issues #843 and #1546. The cost of an upcall is unfortunate, though. I assume there must be a way to simply manually compute the pointer or size, using something akin to the formula in `align_to` in `rust_util.h`. I could not get this to work, unfortunately.