about summary refs log tree commit diff
path: root/src/comp/middle/trans.rs
AgeCommit message (Collapse)AuthorLines
2012-01-27Move various trans_ modules under a trans:: umbrella moduleMarijn Haverbeke-5586/+0
Closes #1304
2012-01-27Stop passing spans to middle::trans functions that don't need themMarijn Haverbeke-160/+111
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-26Make re-exporting of impls workMarijn Haverbeke-2/+3
Closes #1438
2012-01-26Use operator names for operator methodsMarijn Haverbeke-14/+14
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-26Allow operator overloading of the indexing operatorMarijn Haverbeke-7/+15
The method `op_index` (which takes a single argument) is used for this. Issue #1520
2012-01-26First stab at operator overloadingMarijn Haverbeke-24/+66
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-11/+7
It was being used as a clumsy synonym of ty_fn.
2012-01-25Implement implicit self type parameters for ifacesMarijn Haverbeke-1/+1
Closes #1661
2012-01-25Rename tag to enum throughout the compilerMarijn Haverbeke-65/+62
This should reduce confusion of people trying to read the code.
2012-01-23s/block()/fn()/gNiko Matsakis-4/+4
2012-01-21unify size_of, align_of into one call (metrics)Niko Matsakis-2/+249
create some new (xfail'd) tests looking at tag variant alignment
2012-01-21migrate size_of() and related funcs from trans into shapeNiko Matsakis-249/+2
2012-01-21issue #1352: change param order on vec::init_elt, putting block in final ↵Graham Fawcett-2/+2
position. To match the init_fn() and init_fn_mut() changes.
2012-01-19rustc: ";" to "," in enumsPatrick Walton-14/+14
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-2/+2
2012-01-19rustc: "tag" -> "enum"Patrick Walton-19/+19
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-19Remove support for the '.' after a nullary tag in a patternTim Chevalier-15/+15
(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-151/+151
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-91/+57
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-0/+7
also, streamline type_is_tup_like() to the cases which actually work
2012-01-19rustc: Use integer from ctypes consistentlyHaitao Li-22/+24
2012-01-19Use ctypes in native function declarationsHaitao Li-28/+33
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-17Allow omission of the '.' after nullary tag patternsTim Chevalier-8/+16
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.
2012-01-16Remove misguided indirect return in trans_closureMarijn Haverbeke-8/+4
Closes #1528
2012-01-16Don't evaluate discriminator value constants when parsing.Kevin Atkinson-4/+13
Remove disr_val from ast::variant_ and always use ty::variant_info when the value is needed. Move what was done during parsing into other passes, primary typeck.rs. This move also correctly type checks the disr. value expression; thus, fixing rustc --pretty=typed when disr. values are used.
2012-01-13deprecate fn exprs and the fn() type, preferring fn@ and native fnNiko Matsakis-5/+5
2012-01-13Obj system? What obj system?Marijn Haverbeke-230/+69
Removes the obj system from the compiler. Closes #1484
2012-01-13Remove all remaining uses of objs from the compilerMarijn Haverbeke-5/+5
2012-01-12add tydescs into shape, rewrite walk_fn_contents()Niko Matsakis-5/+4
2012-01-12Make driver::session::session no longer an objectMarijn Haverbeke-32/+34
Rather, it is now a struct where properties like opts are accessed directly, and the error-reporting methods are part of a static impl (with the same name as the type).
2012-01-12Implement passing cast-to-vtable values as bounded paramsMarijn Haverbeke-18/+4
Closes #1492
2012-01-11Pass type with params intact as item_type for method calleesMarijn Haverbeke-5/+4
This prevents trans_args from optimizing out nil return types. The method might be generic, in which case it *will* write to a nil retptr.
2012-01-10Add support for casting enum-like tags to scalar values.Kevin Atkinson-1/+15
2012-01-10Support explicit discriminant numbers on tag variants.Kevin Atkinson-18/+10
Addresses issue #1393. For now disallow disr. values unless all variants use nullary contractors (i.e. "enum-like"). Disr. values are now encoded in the crate metadata, but only when it will differ from the inferred value based on the order.
2012-01-10rustc: Remove sret attributes from functionsBrian Anderson-5/+0
Something about the way we're using it is causing incorrect code generation. Closes #1343
2012-01-09Change all uses of 'when' in alt-patterns to 'if'Austin Seipp-1/+1
Issue #1396
2012-01-08First barely-working version of casting to ifaceMarijn Haverbeke-16/+28
Issue #1437
2012-01-06revert metricsNiko Matsakis-73/+91
2012-01-06plug leak: free shared type descrs recursively, as we ought toNiko Matsakis-1/+4
2012-01-06rejigger impl to have an opaque closure ptr rather thanNiko Matsakis-54/+14
opaque closure
2012-01-06collapse sizeof, alignof into metrics, pass along an instance if availNiko Matsakis-45/+65
2012-01-06make size_of and align_of take an optional valueNiko Matsakis-88/+92
2012-01-06Statically allocate static dictsMarijn Haverbeke-0/+1
Issue #1436
2012-01-05Use precise return type to allocate retslot in trans_argsMarijn Haverbeke-4/+11
Using type_of_or_i8 did, predictably, allocate an i8 for a type parameter, which leads to memory corruption and general confusion. Closes #1443
2012-01-05require a non-semi expr acting as a stmt to have unit return typeNiko Matsakis-1/+3