about summary refs log tree commit diff
path: root/src/comp/driver/rustc.rs
AgeCommit message (Collapse)AuthorLines
2011-05-16Fix get_os and get_archTim Chevalier-12/+17
get_os and get_arch were failing to return a value in the error case; they were also assuming that strings are indexed from 1. No idea how they ever worked, but anyway, fixed.
2011-05-16Started adding support for return checking and non-returning function ↵Tim Chevalier-2/+3
annotations * Reorganized typestate into several modules. * Made typestate check that any function with a non-nil return type returns a value. For now, the check is a warning and not an error (see next item). * Added a "bot" type (prettyprinted as _|_), for constructs like be, ret, break, cont, and fail that don't locally return a value that can be inspected. "bot" is distinct from "nil". There is no concrete syntax for _|_, while the concrete syntax for the nil type is (). * Added support to the parser for a ! annotation on functions whose result type is _|_. Such a function is required to have either a fail or a call to another ! function that is reached in all control flow paths. The point of this annotation is to mark functions like unimpl() and span_err(), so that an alt with a call to err() in one case isn't a false positive for the return-value checker. I haven't actually annotated anything with it yet. * Random bugfixes: * * Fixed bug in trans::trans_binary that was throwing away the cleanups for nested subexpressions of an and or or (tests: box-inside-if and box-inside-if2). ** In typeck, unify the expected type arguments of a tag with the actual specified arguments.
2011-05-16Replace --bitcode with the canonical --emit-llvmKelly Wilson-3/+3
2011-05-16Add automatic exe generation capabilities. Add --bitcode flag to generate ↵Kelly Wilson-2/+68
only an LLVM bitcode file.
2011-05-13rustc: lowercase the link and link::write modulesBrian Anderson-12/+12
2011-05-13Fix naming of libc that was mangled by recent module changesBrian Anderson-3/+3
It doesn't appear that rustc makes use of these strings so it didn't actually break anything yet.
2011-05-13Move capture checking into resolve.rsMarijn Haverbeke-3/+0
Drops capture.rs. The new algorithm also checks for captures function arguments and obj fields.
2011-05-13Change resolve to use walk instead of foldMarijn Haverbeke-4/+2
Possibly, at some point, we should add a state-passing variant of walk, or a wrapper that makes it easier to thread state. (See the repetetive pop_state_for_* functions in this commit.)
2011-05-12rustc: Pass a node type table around, unused as of yetPatrick Walton-2/+4
2011-05-12Add stats option and lazily emit glue.Graydon Hoare-0/+4
2011-05-12Downcase std modules again, move to :: for module dereferencingMarijn Haverbeke-130/+130
This should be a snapshot transition.
2011-05-12Keep resolve data in external hash table, rather than embedded defsMarijn Haverbeke-12/+14
One step closer to removing fold and having a single, immutable AST. Resolve still uses fold, because it has to detect and transform expr_field expressions. If we go through on our plan of moving to a different syntax for module dereferencing, the parser can spit out expr_field expressions, and resolve can move to walk. (I am truly sorry for the things I did in typestate_check.rs. I expect we'll want to change that to walk as well in the near future, at which point it should probably pass around a context record, which could hold the def_map.)
2011-05-11Give the lexer a session so that it can fail more informativelyBrian Anderson-1/+1
2011-05-11Use a const for crate-num-zero (ast.local_crate)Marijn Haverbeke-2/+2
2011-05-10rustc: Make -g not take an argumentPatrick Walton-1/+1
2011-05-10Add --time-llvm-passes.Graydon Hoare-2/+5
2011-05-06Rename std modules to be camelcasedMarijn Haverbeke-37/+37
(Have fun mergining your stuff with this.)
2011-05-06Ge the host triple using LLVM. Fix a few 'mutable' warnings also.Kelly Wilson-8/+26
2011-05-06Use #env to bake a git revision string into rustc's --version output.Graydon Hoare-4/+5
2011-05-05Add --help, --version and -v flags (not yet supporting GIT_REV env var, ↵Graydon Hoare-4/+23
waiting on snapshot).
2011-05-05rustc: Add a Link module; move crate writing to it to slim down trans slightlyPatrick Walton-14/+15
2011-05-04rustc: Detect the system root and allow the user to override if necessaryPatrick Walton-3/+20
2011-05-04Add a structure for passing option flags around the compiler, put it in ↵Graydon Hoare-51/+60
session, and use it.
2011-05-04Support new -g flag, only mangle glue names by type when it's passed.Graydon Hoare-10/+14
2011-05-03Start sketching --depend support in rustc.Graydon Hoare-0/+1
2011-05-02rustc: Time the Rust translation and LLVM passes separatelyPatrick Walton-3/+8
2011-05-01rustc: Preserve dots in input path when using an implicit output pathBrian Anderson-2/+2
This avoids outputing, e.g. /test.bc for ../test.rs
2011-04-29rustc: Temporarily add a switch and a corresponding makefile variable to ↵Patrick Walton-5/+12
disable typestate
2011-04-29rustc: Add a --time-passes optionPatrick Walton-13/+41
2011-04-29rustc: Remove the wrong-compiler warning; we're self-hosting now.Patrick Walton-12/+1
2011-04-28Enable typestate_checkTim Chevalier-2/+1
This was supposed to be in a previous commit. I don't know what happened.
2011-04-28Add a session field to ty_ctxt and change an err to span_errTim Chevalier-2/+2
I changed instantiate to print out a more helpful error message, which required passing it a session argument. To avoid threading extra arguments through a lot of functions, I added a session field to ty_ctxt.
2011-04-26Change rustc to use GetOpts rather than ad-hoc command-line parsingMarijn Haverbeke-124/+78
NOTE: all 'long' parameters now use a double dash, so --shared, rather than gcc-style -shared.
2011-04-25rustc: Add a -save-temps option to save bitcode and write output ↵Patrick Walton-5/+15
simultaneously; document command line switches
2011-04-25rustc: Pass a "type context" around instead of directly passing the type ↵Patrick Walton-3/+3
store; prep for removing type annotations
2011-04-21rustc: Pass a type store around, which does nothing yetPatrick Walton-3/+6
2011-04-19rustc: Add a -noverify optionPatrick Walton-5/+11
2011-04-19Remove effect system from src.Graydon Hoare-4/+4
2011-04-19replace error logging with log_err in stdlib and rustcMarijn Haverbeke-17/+16
2011-04-18Add a -c option.Rafael Ávila de Espíndola-0/+2
2011-04-18collect crate meta info and ext crate namesMarijn Haverbeke-1/+2
2011-04-15Add a -S option for producing assembly. I will move more of it toRafael Ávila de Espíndola-9/+12
rust once the necessary APIs are available in C.
2011-04-11Implement the "attempted dynamic environment-capture" error in rustc.Rafael Ávila de Espíndola-0/+2
2011-04-09Move to single-uint file-position representation.Marijn Haverbeke-3/+4
This makes passing them around cheaper. There is now a table (see front/codemap.rs) that is needed to transform such an uint into an actual filename/line/col location. Also cleans up the span building in the parser a bit.
2011-04-08add a -parse-only option to rustcMarijn Haverbeke-2/+9
(undocumented, only used for profiling the parser)
2011-04-07Add a very basic crate-dump utilityMarijn Haverbeke-2/+7
'rustc -ls [cratelib]' will now dump out a list of symbols defined by the crate, as well as a short description of what they are.
2011-04-07Add a -O option and change the Makefile to use it.Rafael Ávila de Espíndola-5/+11
2011-04-01Re-enable typestate_check in build, was lost during merge. Sorry.Graydon Hoare-1/+1
2011-04-01Comment out import for not-yet-compiling typestate_check.Graydon Hoare-1/+1
2011-04-01Started adding support for typestate checking.Tim Chevalier-2/+3
I added a new field to the ast "ann" type for typestate information. Currently, the field contains a record of a precondition bit vector and postcondition vector, but I tried to structure things so as to make it easy to change the representation of the typestate annotation type. I also had to add annotations to some syntactic forms that didn't have them before (fail, ret, be...), with all the boilerplate changes that that would imply. The main call to the typestate_check entry point is commented out and the actual pre-postcondition algorithm only has a few cases implemented, though the overall AST traversal is there. The rest of the typestate algorithm isn't implemented yet.