From 3130348ee177f1716488b6caca6c7852fe47754c Mon Sep 17 00:00:00 2001 From: Tim Chevalier Date: Thu, 24 Mar 2011 12:12:04 -0700 Subject: Started adding support for typestate checking. 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. --- src/comp/driver/rustc.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/comp/driver') diff --git a/src/comp/driver/rustc.rs b/src/comp/driver/rustc.rs index 9ab21622..a1fdb387 100644 --- a/src/comp/driver/rustc.rs +++ b/src/comp/driver/rustc.rs @@ -8,6 +8,7 @@ import middle.trans; import middle.resolve; import middle.ty; import middle.typeck; +import middle.typestate_check; import util.common; import std.map.mk_hashmap; @@ -63,11 +64,11 @@ impure fn compile_input(session.session sess, auto crate = parse_input(sess, p, input); crate = creader.read_crates(sess, crate, library_search_paths); crate = resolve.resolve_crate(sess, crate); - auto typeck_result = typeck.check_crate(sess, crate); crate = typeck_result._0; auto type_cache = typeck_result._1; - + // FIXME: uncomment once typestate_check works + // crate = typestate_check.check_crate(crate); trans.trans_crate(sess, crate, type_cache, output, shared); } -- cgit v1.2.3