about summary refs log tree commit diff
path: root/src/comp/middle
AgeCommit message (Collapse)AuthorLines
2012-02-08deprecate old style box shape stringsNiko Matsakis-8/+3
2012-02-08Monomorphize resource and variant constructorsMarijn Haverbeke-76/+87
Issue #1736
2012-02-07Minor class-related tweaks to the ASTTim Chevalier-5/+6
2012-02-07Stop storing cmp glue in tydescsMarijn Haverbeke-44/+4
There's no such thing anymore, we can simply call upcalls.cmp_type.
2012-02-07Reuse monomorphized functions for different box typesMarijn Haverbeke-260/+225
The free glue for opaque boxes will pick the actual tydesc out of the box, and call its glue. Issue #1736
2012-02-06Handle built-in typenames in the resolve pass, rather than in parserMarijn Haverbeke-90/+154
Closes #1728 Comments out a section of debuginfo.rs. This code was already broken (only being called when --xg was passed, and only working on trivial programs).
2012-02-06Make ty::t type self-sufficientMarijn Haverbeke-945/+638
It is now no longer needed to have a ty::ctxt to get at the contents of a ty::t. The straight-forward approach of doing this, simply making ty::t a box type, unfortunately killed our compiler performance (~15% slower) through refcounting cost. Thus, this patch now represents ty::t as an unsafe pointer, assuming that the ty::ctxt, which holds these boxes alive, outlives any uses of the ty::t values. In the current compiler this trivially holds, but it is does of course add a new potential pitfall. ty::get takes a ty::t and returns a boxed representation of the type. I've changed calls to ty::struct(X) to do ty::get(X).struct. Type structs are full of vectors, and copying them every time we wanted to access them was a bit of a cost.
2012-02-06Make sure iface_methods are set before they are accessedMarijn Haverbeke-3/+18
Closes #1761
2012-02-06Self types for ifacesMarijn Haverbeke-145/+228
This allows a 'Name:' to appear in front of an iface declaration's name, which will cause 'Name' to refer to the self type (with the same number of type parameters as the iface has) in the method signatures of the iface. For example: iface F: functor<A> { fn fmap<B>(f: fn(A) -> B) -> F<B>; } Issue #1718
2012-02-05Merge remote-tracking branch 'erickt/master'Brian Anderson-4/+4
Conflicts: src/libcore/vec.rs src/libstd/getopts.rs
2012-02-05don't fail if inference is not completeNiko Matsakis-0/+1
2012-02-05resolve some merge failuresNiko Matsakis-9/+5
2012-02-05infer modes rather than overwriting with expected tyNiko Matsakis-120/+261
2012-02-03Beginnings of front-end support for classesTim Chevalier-3/+12
Added class support to the parser, prettyprinter, fold, and visit. (See Issue 1726.) This is WIP -- the test case is xfailed, and attempting to compile it will error out in resolve.
2012-02-03Don't rely on filename to get a file from the filemapKevin Atkinson-7/+7
as there may be more than one filemap with the same filename (in the case of stdin for instance). This involved storing a pointer to the filemap rather than the filename in location info such as codemap::pos.
2012-02-03Fix prefixing of logging paths with crate nameMarijn Haverbeke-3/+4
2012-02-03core: rename str::lteq to str::leTom Lee-1/+1
2012-02-03Clean up and update trans::ty_ctxt type definitionMarijn Haverbeke-66/+37
It had been messed up by the pretty-printer at some point, and was partially out of date.
2012-02-03Start on in-crate monomorphizingMarijn Haverbeke-125/+162
Adds a --monomorpize flag to rustc to turn it on. You probably don't want to use it yet, since it's broken in a whole bunch of ways, but it successfully monomorphizes simple generic functions called from within the crate. Issue #1736
2012-02-03Store item paths in ast_map, get rid of trans::local_ctxtMarijn Haverbeke-362/+344
The direct motivation for this was that the monomorphizer needs to be able to generate sane symbols for random items. The typechecker can probably also use this in the future to provide more useful error messages.
2012-02-03Remove experimental GC codeMarijn Haverbeke-167/+7
It's been sitting unused long enough to have bitrotted completely.
2012-02-02Fix assumption in mut.rs that op overloading breaksMarijn Haverbeke-4/+1
Closes #1733
2012-02-01Rename (again) str::unsafe::slice -> str::unsafe::slice_bytes andKevin Cantu-1/+1
str::unsafe::safe_slice -> str::unsafe::slice_bytes_safe_range
2012-02-01Propagating unsafe::slice 2Kevin Cantu-2/+2
2012-02-01make boxes self-describing (fixes #1493)" (take 2)Niko Matsakis-271/+282
this will be used to generate a new snapshot.
2012-02-01Revert "make boxes self-describing (fixes #1493)" until a newNiko Matsakis-282/+271
snapshot is prepared.
2012-02-01make boxes self-describing (fixes #1493)Niko Matsakis-271/+282
2012-02-01Remove support for native typesMarijn Haverbeke-79/+15
Issue #1673
2012-02-01Get rid of native types in LLVM moduleMarijn Haverbeke-125/+101
Code is still somewhat kludgy because we don't have 32-bit enums. Issue #1673
2012-01-31Change option::t to optionTim Chevalier-152/+152
Now that core exports "option" as a synonym for option::t, search-and- replace option::t with option. The only place that still refers to option::t are the modules in libcore that use option, because fixing this requires a new snapshot (forthcoming).
2012-01-31Don't compute pre- and postconditions for item_constsTim Chevalier-16/+1
Since item_consts can't refer to or modify local variables, they don't participate in typestate and thus get empty pre and postconditions by default. Closes #1660
2012-01-31Require alts to be exhaustiveTim Chevalier-285/+591
middle::check_alt does the work. Lots of changes to add default cases into alts that were previously inexhaustive.
2012-01-31Move walk_ty to stack closureMarijn Haverbeke-56/+32
2012-01-31Don't consider references to nullary tag variants lvals in kind.rsMarijn Haverbeke-1/+16
This allows us to express option::map with noncopyable type parameters, which makes sense, since the type params aren't being copied (none doesn't contain any).
2012-01-30Remove ternary operatorPaul Woolcock-14/+0
`expr_ternary`, `ternary_to_if`, and all parses & lexer definitions have been removed.
2012-01-30Change all ternary ops to if/then/elsePaul Woolcock-34/+79
All the files below had at least one instance of the ternary operator present in the source. All have been changed to the equivalent if/then/else expression.
2012-01-30Substitute type parameters more eagerlyMarijn Haverbeke-293/+190
This simplifies the typechecker a bit (no more ty_param_substs_opt_and_ty) and is needed for another experiment I'm playing with. I hope it also makes compilation faster (the bots will tell).
2012-01-30Revert self typesMarijn Haverbeke-81/+50
2012-01-30Remove trailing whitespace in debuginfo.rsMarijn Haverbeke-1/+1
2012-01-30Only build debuginfo blocks for blocks that appear in the program textMarijn Haverbeke-81/+104
I.e. a set of curly braces, not everything that creates a block context in the trans pass. Issue #1694
2012-01-29Fix mistake in previous commitMarijn Haverbeke-1/+2
2012-01-29Fix bug where resolve didn't descend method ty paramsMarijn Haverbeke-1/+1
Closes #1700
2012-01-28core: rename vec::position* functionsErick Tryzelaar-4/+4
Almost all of the vec functions that predicates don't have a corresponding function that takes a single element, so this commit renames the common fn usecase to be the default.
2012-01-28Merge remote-tracking branch 'mozilla/master'Josh Matthews-30/+56
2012-01-28Disable lexical block and function debug info caches to improve compilation ↵Josh Matthews-19/+18
time while #1694 is unfixed, and fix stack-exhaustion bug in block parent generation.
2012-01-27rustc: Make 'attempted access of field' error non-fatalBrian Anderson-1/+3
2012-01-27Merge remote-tracking branch 'killerswan/fixing_strings_2'Brian Anderson-2/+2
Conflicts: src/comp/driver/driver.rs src/comp/middle/trans/base.rs src/comp/syntax/parse/lexer.rs
2012-01-27Make occurs check in ty::fixup_vars more reliableMarijn Haverbeke-11/+19
It wouldn't detect cycles that went through several type vars before. Closes #1464
2012-01-27Allow moving out of mutable unsafe pointersMarijn Haverbeke-10/+12
This makes it possible to de-initialize values anywhere in memory, which is needed, for example, for a fast imlementation of vec::pop.
2012-01-27Properly check enum types for recursionMarijn Haverbeke-6/+20
Closes #742