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/rustc.rc | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/comp/rustc.rc') diff --git a/src/comp/rustc.rc b/src/comp/rustc.rc index e15d1842..afa84711 100644 --- a/src/comp/rustc.rc +++ b/src/comp/rustc.rc @@ -39,6 +39,7 @@ mod pretty { mod util { mod common; + mod typestate_ann; } auth driver.rustc.main = impure; @@ -55,8 +56,10 @@ auth middle.trans.copy_any_self_to_alloca = impure; auth middle.trans.copy_args_to_allocas = impure; auth middle.trans.trans_block = impure; auth middle.trans.alloc_ty = impure; +auth middle.typestate_check.log_expr = impure; auth lib.llvm = unsafe; auth pretty.pprust = impure; +auth middle.typestate_check.find_pre_post_block = impure; mod lib { alt (target_os) { -- cgit v1.2.3