about summary refs log tree commit diff
path: root/src/comp/middle/tstate/ann.rs
AgeCommit message (Collapse)AuthorLines
2012-03-02Move src/comp to src/rustcGraydon Hoare-253/+0
2012-01-18Remove '.' after nullary tags in patternsTim Chevalier-1/+1
Does what it says on the tin. The next commit will remove support for this syntax.
2011-11-17remove compile-command from local variable blocksNiko Matsakis-1/+0
2011-10-07Give up on providing a by-value version of map, convert fold over toMarijn Haverbeke-2/+2
passing pointers by ref Issue #1008
2011-09-12Reformat for new mode syntax, step 1Marijn Haverbeke-32/+32
Long lines were fixed in a very crude way, as I'll be following up with another reformat in a bit.
2011-09-02Reformat. Issue #855Brian Anderson-2/+2
2011-08-27Convert the rest of rustc::middle to istrs. Issue #855Brian Anderson-2/+2
2011-07-27Reformat for new syntaxMarijn Haverbeke-73/+63
2011-07-13Prohibit trailing whitespace under 'tidy' script. Clean up all caught cases.Graydon Hoare-2/+2
2011-07-08Minor refactoringTim Chevalier-2/+6
2011-07-06rustc: Remove some unused references to std::vec from tstate::ann and ↵Patrick Walton-1/+0
tstate::auxiliary
2011-07-06rustc: Revert the conversion to interior vectors due to heap corruptionPatrick Walton-0/+1
2011-07-06rustc: Remove some unused references to std::vec from tstate::ann and ↵Patrick Walton-1/+0
tstate::auxiliary
2011-07-05Move everything syntax-related to syntax/, break deps on rest of compilerMarijn Haverbeke-1/+0
src/comp/syntax is currently just a sub-module of rustc, but it will, in the near future, be its own crate. This includes: - The AST data structure - The parser - The pretty-printer - Visit, walk, and fold - The syntax extension system - Some utility stuff that should be in the stdlib* *) Stdlib extensions currently require a snapshot before they can be used, and the win build is very broken right now. This is temporary and will be cleaned up when one of those problems goes away. A lot of code was moved by this patch, mostly towards a more organized layout. Some package paths did get longer, and I guess the new layout will take some getting used to. Sorry about that! Please try not to re-introduce any dependencies in syntax/ on any of the other src/comp/ subdirs.
2011-06-27Tests for while loops that may invalidate constraintsTim Chevalier-4/+15
Wrote some small test cases that use while loops and moves, to make sure the poststate for the loop body gets propagated into the new prestate and deinitialization gets reflected. Along with that, rewrite the code for intersecting states. I still find it dodgy, but I guess I'll continue trying to add more tests. Also, I'll probably feel better about it once I start formalizing the algorithm.
2011-06-24Invalidate constraints correctly after an assignment expressionTim Chevalier-8/+25
Modified typestate to throw away any constraints mentioning a variable on the LHS of an assignment, recv, assign_op, or on either side of a swap. Some code cleanup as well.
2011-06-24Remove uses of variable name 'res' from rustcMarijn Haverbeke-3/+3
This in preparation of making 'res' a keyword for defining resources. Please don't introduce too many new ones in the meantime...
2011-06-22Compute typestate properly for moveTim Chevalier-61/+69
typestate now drops constraints correctly in the post-state of a move expression or a declaration whose op is a move. It doesn't yet drop constraints mentioning variables that get updated. To do this, I had to change typestate to use trit-vectors instead of bit-vectors, because for every constraint, there are three possible values: known-to-be-false (e.g. after x <- y, init(y) is known-to-be-false), known-to-be-true, and unknown. Before, we conflated known-to-be-false with unknown. But move requires them to be treated differently. Consider: (program a) (a1) x = 1; (a2) y <- x; (a3) log x; (program b) (b1) x = 1; (b2) y <- z; (b3) log x; With only two values, the postcondition of statement a2 for constraint init(x) is the same as that of b2: 0. But in (a2)'s postcondition, init(x) *must* be false, but in (b2)'s condition, it's just whatever it was in the postcondition of the preceding statement.
2011-06-17Restructure the "checking" pass in typestateTim Chevalier-1/+9
I noticed that typestate was being lazier than it should be, because it was only checking typestate for statements and top-level expression (that is, the expression in a stmt_expr, but not any subexpressions). So I rewrote the checks in tstate/ck.rs to use walk, which exposed a few bugs in typestate that I fixed. Also added some more test cases for if-check.
2011-06-16Reformat a bunch of recent churn.Graydon Hoare-17/+22
2011-06-15Reformat source tree (minus a couple tests that are still grumpy).Graydon Hoare-97/+96
2011-06-09Start to check expr_check and expr_call constraints in typestateTim Chevalier-0/+5
Start writing the cases for expr_check and expr_call to take predicates into account, but this isn't working yet.
2011-05-20Correctly check that ! functions always divergeTim Chevalier-0/+7
Also make _|_ unify with any type.
2011-05-19Rewrite tstate.annotate to use walk instead of foldTim Chevalier-13/+23
and various other tidying in typestate
2011-05-17Finally rename std::_xxx to std::xxxMarijn Haverbeke-1/+1
Except for _task, which is still a keyword.
2011-05-16Started adding support for return checking and non-returning function ↵Tim Chevalier-0/+192
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.