about summary refs log tree commit diff
path: root/src/comp/middle
AgeCommit message (Collapse)AuthorLines
2011-04-20Change trans.collect_items to use walk, not foldMarijn Haverbeke-127/+112
2011-04-20Integrate walk.rsMarijn Haverbeke-23/+29
2011-04-20Fix #335, log context needs to be a scope to capture cleanups.Graydon Hoare-1/+1
2011-04-19Small fast-path hack to ty.hash_ty and eq_ty.Graydon Hoare-0/+45
2011-04-19rustc: Add a -noverify optionPatrick Walton-6/+9
2011-04-19Add testcase for bootstrap blocker and fix for each result type to nil.Graydon Hoare-3/+4
2011-04-19rustc: Cache the results of type_of()Patrick Walton-0/+9
2011-04-19rustc: Use marijnh's stringifier for type hash and equality, since it's not ↵Patrick Walton-2/+9
sensitive to cnames
2011-04-19rustc: Make structured comparison glue instead of emitting it inlinePatrick Walton-196/+340
2011-04-19Handle nested items correctly in typestate_checkTim Chevalier-94/+750
Summary says it all. Actually, only nested objects and functions are handled, but that's better than before. The fold that I was using before to traverse a crate wasn't working correctly, because annotations have to reflect the number of local variables of the nearest enclosing function (in turn, because annotations are represented as bit vectors). The fold was traversing the AST in the wrong order, first filling in the annotations correctly, but then re-traversing them with the bit vector length for any outer nested functions, and so on. Remedying this required writing a lot of tedious boilerplate code because I scrapped the idea of using a fold altogether. I also made typestate_check handle unary, field, alt, and fail. Also, some miscellaneous changes: * added annotations to blocks in typeck * fix pprust so it can handle spawn * added more logging functions in util.common * fixed _vec.or * added maybe and from_maybe in option * removed fold_block field from ast_fold, since it was never used
2011-04-19Remove effect system from src.Graydon Hoare-35/+33
2011-04-19rustc: Allow glue to be emitted even for scalar types; this is necessary to ↵Patrick Walton-38/+33
support compare glue
2011-04-19rustc: Don't return "result" types from glue helper functions. This allows ↵Patrick Walton-46/+46
glue to fail.
2011-04-19rustc: Assert that each basic block isn't terminated before adding ↵Patrick Walton-1/+1
instructions to it
2011-04-19replace error logging with log_err in stdlib and rustcMarijn Haverbeke-44/+46
2011-04-19add log_err to rustcMarijn Haverbeke-21/+22
2011-04-19Add log_err to rustbootMarijn Haverbeke-1/+1
2011-04-18Boilerplate city, for anyone who wants it.Graydon Hoare-0/+471
2011-04-18rustc: Add an operation field to compare glue with ==, <=, and < modesPatrick Walton-9/+12
2011-04-18rustc: Create stub glue for structural comparisonPatrick Walton-23/+78
2011-04-18Update foregoing patches to leave rust_crate alone.Marijn Haverbeke-11/+11
Apparently it can't live in the main binary, since on non-Linux platforms, dynamics libs won't find symbols in the binary. This removes the crate_map pointer from rust_crate again, and instead passes it as an extra argument to rust_start. Rustboot doesn't pass this argument, but supposedly that's okay as long as we don't actually use it on that platform.
2011-04-18Add a -c option.Rafael Ávila de Espíndola-4/+26
2011-04-18Make log the log level configurable per moduleMarijn Haverbeke-27/+111
This overloads the meaning of RUST_LOG to also allow 'module.submodule' or 'module.somethingelse=2' forms. The first turn on all logging for a module (loglevel 3), the second sets its loglevel to 2. Log levels are: 0: Show only errors 1: Errors and warnings 2: Errors, warnings, and notes 3: Everything, including debug logging Right now, since we only have one 'log' operation, everything happens at level 1 (warning), so the only meaningful thing that can be done with the new RUST_LOG support is disable logging (=0) for some modules. TODOS: * Language support for logging at a specific level * Also add a log level field to tasks, query the current task as well as the current module before logging (log if one of them allows it) * Revise the C logging API to conform to this set-up (globals for per-module log level, query the task level before logging, stop using a global mask) Implementation notes: Crates now contain two extra data structures. A 'module map' that contains names and pointers to the module-log-level globals for each module in the crate that logs, and a 'crate map' that points at the crate's module map, as well as at the crate maps of all external crates it depends on. These are walked by the runtime (in rust_crate.cpp) to set the currect log levels based on RUST_LOG. These module log globals are allocated as-needed whenever a log expression is encountered, and their location is hard-coded into the logging code, which compares the current level to the log statement's level, and skips over all logging code when it is lower.
2011-04-18move rust_crate structure into the actual crate codeMarijn Haverbeke-4/+2
2011-04-18introduce local_ctxt in trans.rs to keep crate_ctxt globalMarijn Haverbeke-318/+333
This reduces crate_ctxt copying (which unfortunately did not result in a noticeable speedup), and makes the role of that type a bit more clear.
2011-04-15rustc: Capture type parameters into for-each blocks. Add a test case.Patrick Walton-2/+33
2011-04-15rustc: Use a regular vector instead of a hash table for type descriptorsPatrick Walton-14/+13
2011-04-15rustc: Remove the "boxed" check, and make the static_size_of_tag ↵Patrick Walton-33/+32
recursion-eliminating transformation deep
2011-04-15Add a -S option for producing assembly. I will move more of it toRafael Ávila de Espíndola-11/+23
rust once the necessary APIs are available in C.
2011-04-15rustc: Make fold_ty no longer use an object; introduce walk_tyPatrick Walton-115/+160
2011-04-14Work on destructors, not entirely functional yet (no tydesc integration).Graydon Hoare-7/+58
2011-04-14rustc: Use the unified result for the type of assignment expressionsPatrick Walton-1/+1
2011-04-14rustc: Perform type substitutions when recording localsPatrick Walton-1/+11
2011-04-14rustc: Remove generalize_ty. Instead, maintain an explicit type parameter ↵Patrick Walton-358/+522
substitution list.
2011-04-14rustc: Use union-find for variable substitutionPatrick Walton-48/+103
2011-04-13rm unused importTim Chevalier-1/+0
2011-04-13Make expr_while work in typestate_checkTim Chevalier-114/+91
Also did some refactoring in typestate_check. All test cases in compile-fail that involve uninitialized vars now fail correctly! (All eight of them, that is.)
2011-04-13Fix temporary-spilling logic in trans_args, uncomment most of lib-deque.rs ↵Graydon Hoare-1/+5
(which now passes on stage0).
2011-04-13Enable alias analysis and the function attributes pass.Rafael Ávila de Espíndola-4/+5
The C API extension is already upstream, we can drop the local copy once the bots are updated.
2011-04-12typestate_check can now handle expr_block, expr_if, and expr_binaryTim Chevalier-159/+351
(caveat for the latter: it assumes that binary operations are strict; a TODO is to detect or and and and correctly reflect that they're lazy in the second argument). I had to add an ann field to ast.block, resulting in the usual boilerplate changes. Test cases that currently work (if you uncomment the typestate pass in the driver) (all these are under test/compile-fail): fru-typestate ret-uninit use-uninit use-uninit-2 use-uninit-3
2011-04-12rustc: Switch to indices for type parametersPatrick Walton-363/+238
2011-04-12Further work on typestate. Handles expr_rec and expr_assign now.Tim Chevalier-228/+450
Also changed the ts_ann field on statements to be an ann instead, which explains most of the changes. As well, got rid of the "warning: no type for expression" error by filling in annotations for local decls in typeck (not sure whether this was my fault or not). Finally, in bitv, added a clone() function to copy a bit vector, and fixed is_true, is_false, and to_str to not be nonsense.
2011-04-12Make glue always pass-by-alias and rename "scalar_or_boxed" concept to ↵Graydon Hoare-48/+73
"immediate"
2011-04-12Tighten up condition on use of opaque_tag, remove blunt hammer of alias ↵Graydon Hoare-5/+20
arg-casting in trans_args.
2011-04-12Enable more optimizations.Rafael Ávila de Espíndola-6/+6
2011-04-11rustc: Factor out expr_ty() into expr_ann() and expr_ty()Patrick Walton-38/+45
2011-04-11Implement the "attempted dynamic environment-capture" error in rustc.Rafael Ávila de Espíndola-0/+118
2011-04-08rustc: Push down types for all expressions; add logic for recv and sendPatrick Walton-2/+26
2011-04-09Remove silly legacy glue-offset encoding, predicate runtime adjustments by ↵Graydon Hoare-42/+24
ABI. LLVM should inline most glue now.
2011-04-08rustc: Rename "demand" to "pushdown" in the typechecker and explain more ↵Patrick Walton-376/+409
clearly what it's for