Index: src/Common/PassVisitor.h
===================================================================
--- src/Common/PassVisitor.h	(revision d130fe87f4cdf82b08c0879a57d7bae53c7644a2)
+++ src/Common/PassVisitor.h	(revision ba54f7dba922f0df27eebfcc9c67f07969df7db4)
@@ -7,4 +7,6 @@
 #include "SynTree/Mutator.h"
 #include "SynTree/Visitor.h"
+
+#include "SymTab/Indexer.h"
 
 #include "SynTree/Initializer.h"
@@ -265,4 +267,23 @@
 
 	void set_visit_children( bool& ref ) { bool_ref * ptr = visit_children_impl(pass, 0); if(ptr) ptr->set( ref ); }
+
+	void indexerScopeEnter  ()                             { indexer_impl_enterScope  ( pass, 0       ); }
+	void indexerScopeLeave  ()                             { indexer_impl_leaveScope  ( pass, 0       ); }
+	void indexerAddId       ( DeclarationWithType * node ) { indexer_impl_addId       ( pass, 0, node ); }
+	void indexerAddType     ( NamedTypeDecl       * node ) { indexer_impl_addType     ( pass, 0, node ); }
+	void indexerAddStruct   ( const std::string   & id   ) { indexer_impl_addStruct   ( pass, 0, id   ); }
+	void indexerAddStruct   ( StructDecl          * node ) { indexer_impl_addStruct   ( pass, 0, node ); }
+	void indexerAddStructFwd( StructDecl          * node ) { indexer_impl_addStructFwd( pass, 0, node ); }
+	void indexerAddEnum     ( EnumDecl            * node ) { indexer_impl_addEnum     ( pass, 0, node ); }
+	void indexerAddUnion    ( const std::string   & id   ) { indexer_impl_addUnion    ( pass, 0, id   ); }
+	void indexerAddUnion    ( UnionDecl           * node ) { indexer_impl_addUnion    ( pass, 0, node ); }
+	void indexerAddUnionFwd ( UnionDecl           * node ) { indexer_impl_addUnionFwd ( pass, 0, node ); }
+	void indexerAddTrait    ( TraitDecl           * node ) { indexer_impl_addTrait    ( pass, 0, node ); }
+
+	template< typename TreeType, typename VisitorType >
+	friend inline void indexerScopedAccept( TreeType * tree, VisitorType &visitor );
+
+	template< typename TreeType, typename VisitorType >
+	friend inline void indexerScopedMutate( TreeType *& tree, VisitorType &visitor );
 };
 
@@ -296,5 +317,7 @@
 protected:
 	WithDeclsToAdd() = default;
-	~WithDeclsToAdd() = default;
+	~WithDeclsToAdd() {
+		assert( declsToAddBefore.empty() );
+	}
 
 public:
@@ -351,3 +374,12 @@
 };
 
+class WithIndexer {
+protected:
+	WithIndexer() {}
+	~WithIndexer() {}
+
+public:
+	SymTab::Indexer indexer;
+};
+
 #include "PassVisitor.impl.h"
Index: src/Common/PassVisitor.impl.h
===================================================================
--- src/Common/PassVisitor.impl.h	(revision d130fe87f4cdf82b08c0879a57d7bae53c7644a2)
+++ src/Common/PassVisitor.impl.h	(revision ba54f7dba922f0df27eebfcc9c67f07969df7db4)
@@ -101,4 +101,42 @@
 }
 
+template< typename Container, typename VisitorType >
+inline void maybeAccept( Container &container, VisitorType &visitor ) {
+	SemanticError errors;
+	for ( typename Container::iterator i = container.begin(); i != container.end(); ++i ) {
+		try {
+			if ( *i ) {
+				(*i)->accept( visitor );
+			}
+		} catch( SemanticError &e ) {
+			e.set_location( (*i)->location );
+			errors.append( e );
+		}
+	}
+	if ( ! errors.isEmpty() ) {
+		throw errors;
+	}
+}
+
+template< typename Container, typename MutatorType >
+inline void maybeMutateRef( Container &container, MutatorType &mutator ) {
+	SemanticError errors;
+	for ( typename Container::iterator i = container.begin(); i != container.end(); ++i ) {
+		try {
+			if ( *i ) {
+///		    *i = (*i)->acceptMutator( mutator );
+				*i = dynamic_cast< typename Container::value_type >( (*i)->acceptMutator( mutator ) );
+				assert( *i );
+			} // if
+		} catch( SemanticError &e ) {
+			e.set_location( (*i)->location );
+			errors.append( e );
+		} // try
+	} // for
+	if ( ! errors.isEmpty() ) {
+		throw errors;
+	} // if
+}
+
 template< typename pass_type >
 template< typename func_t >
@@ -230,48 +268,314 @@
 
 //------------------------------------------------------------------------------------------------------------------------------------------------------------------------
-
+//========================================================================================================================================================================
+//========================================================================================================================================================================
+//========================================================================================================================================================================
+//========================================================================================================================================================================
+//========================================================================================================================================================================
+//------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+
+
+//--------------------------------------------------------------------------
+// ObjectDecl
 template< typename pass_type >
 void PassVisitor< pass_type >::visit( ObjectDecl * node ) {
-	VISIT_BODY( node );
-}
-
+	VISIT_START( node );
+
+	indexerScopedAccept( node->type         , *this );
+	maybeAccept        ( node->init         , *this );
+	maybeAccept        ( node->bitfieldWidth, *this );
+
+	if ( node->name != "" ) {
+		indexerAddId( node );
+	}
+
+	VISIT_END( node );
+}
+
+template< typename pass_type >
+DeclarationWithType * PassVisitor< pass_type >::mutate( ObjectDecl * node ) {
+	MUTATE_START( node );
+
+	indexerScopedMutate( node->type         , *this );
+	maybeMutateRef     ( node->init         , *this );
+	maybeMutateRef     ( node->bitfieldWidth, *this );
+
+	if ( node->name != "" ) {
+		indexerAddId( node );
+	}
+
+	MUTATE_END( DeclarationWithType, node );
+}
+
+//--------------------------------------------------------------------------
+// FunctionDecl
 template< typename pass_type >
 void PassVisitor< pass_type >::visit( FunctionDecl * node ) {
-	VISIT_BODY( node );
-}
-
+	VISIT_START( node );
+
+	if ( node->name != "" ) {
+		indexerAddId( node );
+	}
+
+	{
+		auto guard = makeFuncGuard( [this]() { indexerScopeEnter(); }, [this]() { indexerScopeLeave(); } );
+		maybeAccept( node->type, *this );
+		maybeAccept( node->statements, *this );
+	}
+
+	VISIT_END( node );
+}
+
+template< typename pass_type >
+DeclarationWithType * PassVisitor< pass_type >::mutate( FunctionDecl * node ) {
+	MUTATE_START( node );
+
+	if ( node->name != "" ) {
+		indexerAddId( node );
+	}
+
+	{
+		auto guard = makeFuncGuard( [this]() { indexerScopeEnter(); }, [this]() { indexerScopeLeave(); } );
+		maybeMutateRef( node->type, *this );
+		maybeMutateRef( node->statements, *this );
+	}
+
+	MUTATE_END( DeclarationWithType, node );
+}
+
+//--------------------------------------------------------------------------
+// StructDecl
 template< typename pass_type >
 void PassVisitor< pass_type >::visit( StructDecl * node ) {
-	VISIT_BODY( node );
-}
-
+	VISIT_START( node );
+
+	// make up a forward declaration and add it before processing the members
+	// needs to be on the heap because addStruct saves the pointer
+	indexerAddStructFwd( node );
+
+	{
+		auto guard = makeFuncGuard( [this]() { indexerScopeEnter(); }, [this]() { indexerScopeLeave(); } );
+		maybeAccept( node->parameters, *this );
+		maybeAccept( node->members   , *this );
+	}
+
+	// this addition replaces the forward declaration
+	indexerAddStruct( node );
+
+	VISIT_END( node );
+}
+
+template< typename pass_type >
+Declaration * PassVisitor< pass_type >::mutate( StructDecl * node ) {
+	MUTATE_START( node );
+
+	// make up a forward declaration and add it before processing the members
+	// needs to be on the heap because addStruct saves the pointer
+	indexerAddStructFwd( node );
+
+	{
+		auto guard = makeFuncGuard( [this]() { indexerScopeEnter(); }, [this]() { indexerScopeLeave(); } );
+		maybeMutateRef( node->parameters, *this );
+		maybeMutateRef( node->members   , *this );
+	}
+
+	// this addition replaces the forward declaration
+	indexerAddStruct( node );
+
+	MUTATE_END( Declaration, node );
+}
+
+//--------------------------------------------------------------------------
+// UnionDecl
 template< typename pass_type >
 void PassVisitor< pass_type >::visit( UnionDecl * node ) {
-	VISIT_BODY( node );
-}
-
+	VISIT_START( node );
+
+	// make up a forward declaration and add it before processing the members
+	indexerAddUnionFwd( node );
+
+	{
+		auto guard = makeFuncGuard( [this]() { indexerScopeEnter(); }, [this]() { indexerScopeLeave(); } );
+		maybeAccept( node->parameters, *this );
+		maybeAccept( node->members   , *this );
+	}
+
+	indexerAddUnion( node );
+
+	VISIT_END( node );
+}
+
+template< typename pass_type >
+Declaration * PassVisitor< pass_type >::mutate( UnionDecl * node ) {
+	MUTATE_START( node );
+
+	// make up a forward declaration and add it before processing the members
+	indexerAddUnionFwd( node );
+
+	{
+		auto guard = makeFuncGuard( [this]() { indexerScopeEnter(); }, [this]() { indexerScopeLeave(); } );
+		maybeMutateRef( node->parameters, *this );
+		maybeMutateRef( node->members   , *this );
+	}
+
+	indexerAddUnion( node );
+
+	MUTATE_END( Declaration, node );
+}
+
+//--------------------------------------------------------------------------
+// EnumDecl
 template< typename pass_type >
 void PassVisitor< pass_type >::visit( EnumDecl * node ) {
-	VISIT_BODY( node );
-}
-
+	VISIT_START( node );
+
+	indexerAddEnum( node );
+
+	// unlike structs, contexts, and unions, enums inject their members into the global scope
+	maybeAccept( node->parameters, *this );
+	maybeAccept( node->members   , *this );
+
+	VISIT_END( node );
+}
+
+template< typename pass_type >
+Declaration * PassVisitor< pass_type >::mutate( EnumDecl * node ) {
+	MUTATE_START( node );
+
+	indexerAddEnum( node );
+
+	// unlike structs, contexts, and unions, enums inject their members into the global scope
+	maybeMutateRef( node->parameters, *this );
+	maybeMutateRef( node->members   , *this );
+
+	MUTATE_END( Declaration, node );
+}
+
+//--------------------------------------------------------------------------
+// TraitDecl
 template< typename pass_type >
 void PassVisitor< pass_type >::visit( TraitDecl * node ) {
-	VISIT_BODY( node );
-}
-
+	VISIT_START( node );
+
+	{
+		auto guard = makeFuncGuard( [this]() { indexerScopeEnter(); }, [this]() { indexerScopeLeave(); } );
+		maybeAccept( node->parameters, *this );
+		maybeAccept( node->members   , *this );
+	}
+
+	indexerAddTrait( node );
+
+	VISIT_END( node );
+}
+
+template< typename pass_type >
+Declaration * PassVisitor< pass_type >::mutate( TraitDecl * node ) {
+	MUTATE_START( node );
+
+	{
+		auto guard = makeFuncGuard( [this]() { indexerScopeEnter(); }, [this]() { indexerScopeLeave(); } );
+		maybeMutateRef( node->parameters, *this );
+		maybeMutateRef( node->members   , *this );
+	}
+
+	indexerAddTrait( node );
+
+	MUTATE_END( Declaration, node );
+}
+
+//--------------------------------------------------------------------------
+// TypeDecl
 template< typename pass_type >
 void PassVisitor< pass_type >::visit( TypeDecl * node ) {
-	VISIT_BODY( node );
-}
-
+	VISIT_START( node );
+
+	{
+		auto guard = makeFuncGuard( [this]() { indexerScopeEnter(); }, [this]() { indexerScopeLeave(); } );
+		maybeAccept( node->parameters, *this );
+		maybeAccept( node->base      , *this );
+	}
+
+	indexerAddType( node );
+
+	maybeAccept( node->assertions, *this );
+
+	indexerScopedAccept( node->init, *this );
+
+	VISIT_END( node );
+}
+
+template< typename pass_type >
+Declaration * PassVisitor< pass_type >::mutate( TypeDecl * node ) {
+	MUTATE_START( node );
+
+	{
+		auto guard = makeFuncGuard( [this]() { indexerScopeEnter(); }, [this]() { indexerScopeLeave(); } );
+		maybeMutateRef( node->parameters, *this );
+		maybeMutateRef( node->base      , *this );
+	}
+
+	indexerAddType( node );
+
+	maybeMutateRef( node->assertions, *this );
+
+	indexerScopedMutate( node->init, *this );
+
+	MUTATE_END( Declaration, node );
+}
+
+//--------------------------------------------------------------------------
+// TypedefDecl
 template< typename pass_type >
 void PassVisitor< pass_type >::visit( TypedefDecl * node ) {
-	VISIT_BODY( node );
-}
-
+	VISIT_START( node );
+
+	{
+		auto guard = makeFuncGuard( [this]() { indexerScopeEnter(); }, [this]() { indexerScopeLeave(); } );
+		maybeAccept( node->parameters, *this );
+		maybeAccept( node->base      , *this );
+	}
+
+	indexerAddType( node );
+
+	maybeAccept( node->assertions, *this );
+
+	VISIT_END( node );
+}
+
+template< typename pass_type >
+Declaration * PassVisitor< pass_type >::mutate( TypedefDecl * node ) {
+	MUTATE_START( node );
+
+	{
+		auto guard = makeFuncGuard( [this]() { indexerScopeEnter(); }, [this]() { indexerScopeLeave(); } );
+		maybeMutateRef     ( node->parameters, *this );
+		maybeMutateRef( node->base      , *this );
+	}
+
+	indexerAddType( node );
+
+	maybeMutateRef( node->assertions, *this );
+
+	MUTATE_END( Declaration, node );
+}
+
+//--------------------------------------------------------------------------
+// AsmDecl
 template< typename pass_type >
 void PassVisitor< pass_type >::visit( AsmDecl * node ) {
-	VISIT_BODY( node );
+	VISIT_START( node );
+
+	maybeAccept( node->stmt, *this );
+
+	VISIT_END( node );
+}
+
+template< typename pass_type >
+AsmDecl * PassVisitor< pass_type >::mutate( AsmDecl * node ) {
+	MUTATE_START( node );
+
+	maybeMutateRef( node->stmt, *this );
+
+	MUTATE_END( AsmDecl, node );
 }
 
@@ -281,9 +585,9 @@
 void PassVisitor< pass_type >::visit( CompoundStmt * node ) {
 	VISIT_START( node );
-	call_beginScope();
-
-	visitStatementList( node->get_kids() );
-
-	call_endScope();
+	{
+		auto guard1 = makeFuncGuard( [this]() { indexerScopeEnter(); }, [this]() { indexerScopeLeave(); } );
+		auto guard2 = makeFuncGuard( [this]() { call_beginScope();   }, [this]() { call_endScope();     } );
+		visitStatementList( node->kids );
+	}
 	VISIT_END( node );
 }
@@ -292,9 +596,9 @@
 CompoundStmt * PassVisitor< pass_type >::mutate( CompoundStmt * node ) {
 	MUTATE_START( node );
-	call_beginScope();
-
-	mutateStatementList( node->get_kids() );
-
-	call_endScope();
+	{
+		auto guard1 = makeFuncGuard( [this]() { indexerScopeEnter(); }, [this]() { indexerScopeLeave(); } );
+		auto guard2 = makeFuncGuard( [this]() { call_beginScope();   }, [this]() { call_endScope();     } );
+		mutateStatementList( node->kids );
+	}
 	MUTATE_END( CompoundStmt, node );
 }
@@ -306,5 +610,5 @@
 	VISIT_START( node );
 
-	visitExpression( node->get_expr() );
+	visitExpression( node->expr );
 
 	VISIT_END( node );
@@ -315,5 +619,5 @@
 	MUTATE_START( node );
 
-	node->set_expr( mutateExpression( node->get_expr() ) );
+	node->expr = mutateExpression( node->expr );
 
 	MUTATE_END( Statement, node );
@@ -338,7 +642,7 @@
 	VISIT_START( node );
 
-	visitExpression( node->get_condition() );
-	node->set_thenPart ( visitStatement( node->get_thenPart() ) );
-	node->set_elsePart ( visitStatement( node->get_elsePart() ) );
+	visitExpression( node->condition );
+	node->thenPart = visitStatement( node->thenPart );
+	node->elsePart = visitStatement( node->elsePart );
 
 	VISIT_END( node );
@@ -348,9 +652,10 @@
 Statement * PassVisitor< pass_type >::mutate( IfStmt * node ) {
 	MUTATE_START( node );
-
-	node->set_condition( mutateExpression( node->get_condition() ) );
-	node->set_thenPart ( mutateStatement ( node->get_thenPart()  ) );
-	node->set_elsePart ( mutateStatement ( node->get_elsePart()  ) );
-
+	{
+		auto guard = makeFuncGuard( [this]() { indexerScopeEnter(); }, [this]() { indexerScopeLeave(); } );
+		node->condition = mutateExpression( node->condition );
+		node->thenPart  = mutateStatement ( node->thenPart  );
+		node->elsePart  = mutateStatement ( node->elsePart  );
+	}
 	MUTATE_END( Statement, node );
 }
@@ -362,6 +667,6 @@
 	VISIT_START( node );
 
-	visitExpression( node->get_condition() );
-	node->set_body( visitStatement( node->get_body() ) );
+	visitExpression( node->condition );
+	node->body = visitStatement( node->body );
 
 	VISIT_END( node );
@@ -372,6 +677,6 @@
 	MUTATE_START( node );
 
-	node->set_condition( mutateExpression( node->get_condition() ) );
-	node->set_body( mutateStatement( node->get_body() ) );
+	node->condition = mutateExpression( node->condition );
+	node->body      = mutateStatement ( node->body      );
 
 	MUTATE_END( Statement, node );
@@ -383,10 +688,11 @@
 void PassVisitor< pass_type >::visit( ForStmt * node ) {
 	VISIT_START( node );
-
-	acceptAll( node->get_initialization(), *this );
-	visitExpression( node->get_condition() );
-	visitExpression( node->get_increment() );
-	node->set_body( visitStatement( node->get_body() ) );
-
+	{
+		auto guard = makeFuncGuard( [this]() { indexerScopeEnter(); }, [this]() { indexerScopeLeave(); } );
+		maybeAccept( node->initialization, *this );
+		visitExpression( node->condition );
+		visitExpression( node->increment );
+		node->body = visitStatement( node->body );
+	}
 	VISIT_END( node );
 }
@@ -395,10 +701,11 @@
 Statement * PassVisitor< pass_type >::mutate( ForStmt * node ) {
 	MUTATE_START( node );
-
-	mutateAll( node->get_initialization(), *this );
-	node->set_condition( mutateExpression( node->get_condition() ) );
-	node->set_increment( mutateExpression( node->get_increment() ) );
-	node->set_body( mutateStatement( node->get_body() ) );
-
+	{
+		auto guard = makeFuncGuard( [this]() { indexerScopeEnter(); }, [this]() { indexerScopeLeave(); } );
+		maybeMutateRef( node->initialization, *this );
+		node->condition = mutateExpression( node->condition );
+		node->increment = mutateExpression( node->increment );
+		node->body      = mutateStatement ( node->body      );
+	}
 	MUTATE_END( Statement, node );
 }
@@ -410,6 +717,6 @@
 	VISIT_START( node );
 
-	visitExpression( node->get_condition() );
-	visitStatementList( node->get_statements() );
+	visitExpression   ( node->condition  );
+	visitStatementList( node->statements );
 
 	VISIT_END( node );
@@ -420,6 +727,6 @@
 	MUTATE_START( node );
 
-	node->set_condition( mutateExpression( node->get_condition() ) );
-	mutateStatementList( node->get_statements() );
+	node->condition = mutateExpression( node->condition );
+	mutateStatementList( node->statements );
 
 	MUTATE_END( Statement, node );
@@ -432,6 +739,6 @@
 	VISIT_START( node );
 
-	visitExpression( node->get_condition() );
-	visitStatementList( node->get_statements() );
+	visitExpression   ( node->condition );
+	visitStatementList( node->stmts     );
 
 	VISIT_END( node );
@@ -442,6 +749,6 @@
 	MUTATE_START( node );
 
-	node->set_condition(  mutateExpression( node->get_condition() ) );
-	mutateStatementList( node->get_statements() );
+	node->condition = mutateExpression( node->condition );
+	mutateStatementList( node->stmts );
 
 	MUTATE_END( Statement, node );
@@ -466,5 +773,5 @@
 	VISIT_START( node );
 
-	visitExpression( node->get_expr() );
+	visitExpression( node->expr );
 
 	VISIT_END( node );
@@ -475,5 +782,5 @@
 	MUTATE_START( node );
 
-	node->set_expr( mutateExpression( node->get_expr() ) );
+	node->expr = mutateExpression( node->expr );
 
 	MUTATE_END( Statement, node );
@@ -499,7 +806,7 @@
 	VISIT_START( node );
 
-	maybeAccept( node->get_block(), *this );
-	acceptAll( node->get_catchers(), *this );
-	maybeAccept( node->get_finally(), *this );
+	maybeAccept( node->block       , *this );
+	maybeAccept( node->handlers    , *this );
+	maybeAccept( node->finallyBlock, *this );
 
 	VISIT_END( node );
@@ -510,7 +817,7 @@
 	MUTATE_START( node );
 
-	node->set_block(  maybeMutate( node->get_block(), *this ) );
-	mutateAll( node->get_catchers(), *this );
-	node->set_finally( maybeMutate( node->get_finally(), *this ) );
+	maybeMutateRef( node->block       , *this );
+	maybeMutateRef( node->handlers    , *this );
+	maybeMutateRef( node->finallyBlock, *this );
 
 	MUTATE_END( Statement, node );
@@ -522,9 +829,10 @@
 void PassVisitor< pass_type >::visit( CatchStmt * node ) {
 	VISIT_START( node );
-
-	maybeAccept( node->get_decl(), *this );
-	node->set_cond( visitExpression( node->get_cond() ) );
-	node->set_body( visitStatement( node->get_body() ) );
-
+	{
+		auto guard = makeFuncGuard( [this]() { indexerScopeEnter(); }, [this]() { indexerScopeLeave(); } );
+		maybeAccept( node->decl, *this );
+		node->cond = visitExpression( node->cond );
+		node->body = visitStatement ( node->body );
+	}
 	VISIT_END( node );
 }
@@ -533,9 +841,10 @@
 Statement * PassVisitor< pass_type >::mutate( CatchStmt * node ) {
 	MUTATE_START( node );
-
-	node->set_decl( maybeMutate( node->get_decl(), *this ) );
-	node->set_cond( mutateExpression( node->get_cond() ) );
-	node->set_body( mutateStatement( node->get_body() ) );
-
+	{
+		auto guard = makeFuncGuard( [this]() { indexerScopeEnter(); }, [this]() { indexerScopeLeave(); } );
+		maybeMutateRef( node->decl, *this );
+		node->cond = mutateExpression( node->cond );
+		node->body = mutateStatement ( node->body );
+	}
 	MUTATE_END( Statement, node );
 }
@@ -605,10 +914,23 @@
 template< typename pass_type >
 void PassVisitor< pass_type >::visit( ApplicationExpr * node ) {
-	VISIT_BODY( node );
+	VISIT_START( node );
+
+	indexerScopedAccept( node->result  , *this );
+	maybeAccept        ( node->function, *this );
+	maybeAccept        ( node->args    , *this );
+
+	VISIT_END( node );
 }
 
 template< typename pass_type >
 Expression * PassVisitor< pass_type >::mutate( ApplicationExpr * node ) {
-	MUTATE_BODY( Expression, node );
+	MUTATE_START( node );
+
+	indexerScopedMutate( node->env     , *this );
+	indexerScopedMutate( node->result  , *this );
+	maybeMutateRef     ( node->function, *this );
+	maybeMutateRef     ( node->args    , *this );
+
+	MUTATE_END( Expression, node );
 }
 
@@ -620,7 +942,7 @@
 
 	// maybeAccept( node->get_env(), *this );
-	maybeAccept( node->get_result(), *this );
-
-	for ( auto expr : node->get_args() ) {
+	indexerScopedAccept( node->result, *this );
+
+	for ( auto expr : node->args ) {
 		visitExpression( expr );
 	}
@@ -633,8 +955,8 @@
 	MUTATE_START( node );
 
-	node->set_env( maybeMutate( node->get_env(), *this ) );
-	node->set_result( maybeMutate( node->get_result(), *this ) );
-
-	for ( auto& expr : node->get_args() ) {
+	indexerScopedMutate( node->env   , *this );
+	indexerScopedMutate( node->result, *this );
+
+	for ( auto& expr : node->args ) {
 		expr = mutateExpression( expr );
 	}
@@ -643,146 +965,692 @@
 }
 
+//--------------------------------------------------------------------------
+// NameExpr
 template< typename pass_type >
 void PassVisitor< pass_type >::visit( NameExpr * node ) {
-	VISIT_BODY( node );
-}
-
+	VISIT_START( node );
+
+	indexerScopedAccept( node->result, *this );
+
+	VISIT_END( node );
+}
+
+template< typename pass_type >
+Expression * PassVisitor< pass_type >::mutate( NameExpr * node ) {
+	MUTATE_START( node );
+
+	indexerScopedMutate( node->env   , *this );
+	indexerScopedMutate( node->result, *this );
+
+	MUTATE_END( Expression, node );
+}
+
+//--------------------------------------------------------------------------
+// CastExpr
 template< typename pass_type >
 void PassVisitor< pass_type >::visit( CastExpr * node ) {
-	VISIT_BODY( node );
-}
-
+	VISIT_START( node );
+
+	indexerScopedAccept( node->result, *this );
+	maybeAccept        ( node->arg   , *this );
+
+	VISIT_END( node );
+}
+
+template< typename pass_type >
+Expression * PassVisitor< pass_type >::mutate( CastExpr * node ) {
+	MUTATE_START( node );
+
+	indexerScopedMutate( node->env   , *this );
+	indexerScopedMutate( node->result, *this );
+	maybeMutateRef     ( node->arg   , *this );
+
+	MUTATE_END( Expression, node );
+}
+
+//--------------------------------------------------------------------------
+// VirtualCastExpr
 template< typename pass_type >
 void PassVisitor< pass_type >::visit( VirtualCastExpr * node ) {
-	VISIT_BODY( node );
-}
-
+	VISIT_START( node );
+
+	indexerScopedAccept( node->result, *this );
+	maybeAccept( node->arg, *this );
+
+	VISIT_END( node );
+}
+
+template< typename pass_type >
+Expression * PassVisitor< pass_type >::mutate( VirtualCastExpr * node ) {
+	MUTATE_START( node );
+
+	indexerScopedMutate( node->env   , *this );
+	indexerScopedMutate( node->result, *this );
+	maybeMutateRef     ( node->arg   , *this );
+
+	MUTATE_END( Expression, node );
+}
+
+//--------------------------------------------------------------------------
+// AddressExpr
 template< typename pass_type >
 void PassVisitor< pass_type >::visit( AddressExpr * node ) {
-	VISIT_BODY( node );
-}
-
+	VISIT_START( node );
+
+	indexerScopedAccept( node->result, *this );
+	maybeAccept        ( node->arg   , *this );
+
+	VISIT_END( node );
+}
+
+template< typename pass_type >
+Expression * PassVisitor< pass_type >::mutate( AddressExpr * node ) {
+	MUTATE_START( node );
+
+	indexerScopedMutate( node->env   , *this );
+	indexerScopedMutate( node->result, *this );
+	maybeMutateRef     ( node->arg   , *this );
+
+	MUTATE_END( Expression, node );
+}
+
+//--------------------------------------------------------------------------
+// LabelAddressExpr
 template< typename pass_type >
 void PassVisitor< pass_type >::visit( LabelAddressExpr * node ) {
-	VISIT_BODY( node );
-}
-
+	VISIT_START( node );
+
+	indexerScopedAccept( node->result, *this );
+
+	VISIT_END( node );
+}
+
+template< typename pass_type >
+Expression * PassVisitor< pass_type >::mutate( LabelAddressExpr * node ) {
+	MUTATE_START( node );
+
+	indexerScopedMutate( node->env   , *this );
+	indexerScopedMutate( node->result, *this );
+
+	MUTATE_END( Expression, node );
+}
+
+//--------------------------------------------------------------------------
+// UntypedMemberExpr
 template< typename pass_type >
 void PassVisitor< pass_type >::visit( UntypedMemberExpr * node ) {
-	VISIT_BODY( node );
-}
-
+	VISIT_START( node );
+
+	indexerScopedAccept( node->result   , *this );
+	maybeAccept        ( node->aggregate, *this );
+	maybeAccept        ( node->member   , *this );
+
+	VISIT_END( node );
+}
+
+template< typename pass_type >
+Expression * PassVisitor< pass_type >::mutate( UntypedMemberExpr * node ) {
+	MUTATE_START( node );
+
+	indexerScopedMutate( node->env      , *this );
+	indexerScopedMutate( node->result   , *this );
+	maybeMutateRef     ( node->aggregate, *this );
+	maybeMutateRef     ( node->member   , *this );
+
+	MUTATE_END( Expression, node );
+}
+
+//--------------------------------------------------------------------------
+// MemberExpr
 template< typename pass_type >
 void PassVisitor< pass_type >::visit( MemberExpr * node ) {
-	VISIT_BODY( node );
-}
-
+	VISIT_START( node );
+
+	indexerScopedAccept( node->result   , *this );
+	maybeAccept        ( node->aggregate, *this );
+
+	VISIT_END( node );
+}
+
+template< typename pass_type >
+Expression * PassVisitor< pass_type >::mutate( MemberExpr * node ) {
+	MUTATE_START( node );
+
+	indexerScopedMutate( node->env      , *this );
+	indexerScopedMutate( node->result   , *this );
+	maybeMutateRef     ( node->aggregate, *this );
+
+	MUTATE_END( Expression, node );
+}
+
+//--------------------------------------------------------------------------
+// VariableExpr
 template< typename pass_type >
 void PassVisitor< pass_type >::visit( VariableExpr * node ) {
-	VISIT_BODY( node );
-}
-
+	VISIT_START( node );
+
+	indexerScopedAccept( node->result, *this );
+
+	VISIT_END( node );
+}
+
+template< typename pass_type >
+Expression * PassVisitor< pass_type >::mutate( VariableExpr * node ) {
+	MUTATE_START( node );
+
+	indexerScopedMutate( node->env   , *this );
+	indexerScopedMutate( node->result, *this );
+
+	MUTATE_END( Expression, node );
+}
+
+//--------------------------------------------------------------------------
+// ConstantExpr
 template< typename pass_type >
 void PassVisitor< pass_type >::visit( ConstantExpr * node ) {
-	VISIT_BODY( node );
-}
-
+	VISIT_START( node );
+
+	indexerScopedAccept( node->result   , *this );
+	maybeAccept        ( &node->constant, *this );
+
+	VISIT_END( node );
+}
+
+template< typename pass_type >
+Expression * PassVisitor< pass_type >::mutate( ConstantExpr * node ) {
+	MUTATE_START( node );
+
+	indexerScopedMutate( node->env   , *this );
+	indexerScopedMutate( node->result, *this );
+	node->constant = *maybeMutate( &node->constant, *this );
+
+	MUTATE_END( Expression, node );
+}
+
+//--------------------------------------------------------------------------
+// SizeofExpr
 template< typename pass_type >
 void PassVisitor< pass_type >::visit( SizeofExpr * node ) {
-	VISIT_BODY( node );
-}
-
+	VISIT_START( node );
+
+	indexerScopedAccept( node->result, *this );
+	if ( node->get_isType() ) {
+		maybeAccept( node->type, *this );
+	} else {
+		maybeAccept( node->expr, *this );
+	}
+
+	VISIT_END( node );
+}
+
+template< typename pass_type >
+Expression * PassVisitor< pass_type >::mutate( SizeofExpr * node ) {
+	MUTATE_START( node );
+
+	indexerScopedMutate( node->env   , *this );
+	indexerScopedMutate( node->result, *this );
+	if ( node->get_isType() ) {
+		maybeMutateRef( node->type, *this );
+	} else {
+		maybeMutateRef( node->expr, *this );
+	}
+
+	MUTATE_END( Expression, node );
+}
+
+//--------------------------------------------------------------------------
+// AlignofExpr
 template< typename pass_type >
 void PassVisitor< pass_type >::visit( AlignofExpr * node ) {
-	VISIT_BODY( node );
-}
-
+	VISIT_START( node );
+
+	indexerScopedAccept( node->result, *this );
+	if ( node->get_isType() ) {
+		maybeAccept( node->type, *this );
+	} else {
+		maybeAccept( node->expr, *this );
+	}
+
+	VISIT_END( node );
+}
+
+template< typename pass_type >
+Expression * PassVisitor< pass_type >::mutate( AlignofExpr * node ) {
+	MUTATE_START( node );
+
+	indexerScopedMutate( node->env   , *this );
+	indexerScopedMutate( node->result, *this );
+	if ( node->get_isType() ) {
+		maybeMutateRef( node->type, *this );
+	} else {
+		maybeMutateRef( node->expr, *this );
+	}
+
+	MUTATE_END( Expression, node );
+}
+
+//--------------------------------------------------------------------------
+// UntypedOffsetofExpr
 template< typename pass_type >
 void PassVisitor< pass_type >::visit( UntypedOffsetofExpr * node ) {
-	VISIT_BODY( node );
-}
-
+	VISIT_START( node );
+
+	indexerScopedAccept( node->result, *this );
+	maybeAccept        ( node->type  , *this );
+
+	VISIT_END( node );
+}
+
+template< typename pass_type >
+Expression * PassVisitor< pass_type >::mutate( UntypedOffsetofExpr * node ) {
+	MUTATE_START( node );
+
+	indexerScopedMutate( node->env   , *this );
+	indexerScopedMutate( node->result, *this );
+	maybeMutateRef     ( node->type  , *this );
+
+	MUTATE_END( Expression, node );
+}
+
+//--------------------------------------------------------------------------
+// OffsetofExpr
 template< typename pass_type >
 void PassVisitor< pass_type >::visit( OffsetofExpr * node ) {
-	VISIT_BODY( node );
-}
-
+	VISIT_START( node );
+
+	indexerScopedAccept( node->result, *this );
+	maybeAccept        ( node->type  , *this );
+	maybeAccept        ( node->member, *this );
+
+	VISIT_END( node );
+}
+
+template< typename pass_type >
+Expression * PassVisitor< pass_type >::mutate( OffsetofExpr * node ) {
+	MUTATE_START( node );
+
+	indexerScopedMutate( node->env   , *this );
+	indexerScopedMutate( node->result, *this );
+	maybeMutateRef     ( node->type  , *this );
+	maybeMutateRef     ( node->member, *this );
+
+	MUTATE_END( Expression, node );
+}
+
+//--------------------------------------------------------------------------
+// OffsetPackExpr
 template< typename pass_type >
 void PassVisitor< pass_type >::visit( OffsetPackExpr * node ) {
-	VISIT_BODY( node );
-}
-
+	VISIT_START( node );
+
+	indexerScopedAccept( node->result, *this );
+	maybeAccept        ( node->type  , *this );
+
+	VISIT_END( node );
+}
+
+template< typename pass_type >
+Expression * PassVisitor< pass_type >::mutate( OffsetPackExpr * node ) {
+	MUTATE_START( node );
+
+	indexerScopedMutate( node->env   , *this );
+	indexerScopedMutate( node->result, *this );
+	maybeMutateRef     ( node->type  , *this );
+
+	MUTATE_END( Expression, node );
+}
+
+//--------------------------------------------------------------------------
+// AttrExpr
 template< typename pass_type >
 void PassVisitor< pass_type >::visit( AttrExpr * node ) {
-	VISIT_BODY( node );
-}
-
+	VISIT_START( node );
+
+	indexerScopedAccept( node->result, *this );
+	if ( node->get_isType() ) {
+		maybeAccept( node->type, *this );
+	} else {
+		maybeAccept( node->expr, *this );
+	}
+
+	VISIT_END( node );
+}
+
+template< typename pass_type >
+Expression * PassVisitor< pass_type >::mutate( AttrExpr * node ) {
+	MUTATE_START( node );
+
+	indexerScopedMutate( node->env   , *this );
+	indexerScopedMutate( node->result, *this );
+	if ( node->get_isType() ) {
+		maybeMutateRef( node->type, *this );
+	} else {
+		maybeMutateRef( node->expr, *this );
+	}
+
+	MUTATE_END( Expression, node );
+}
+
+//--------------------------------------------------------------------------
+// LogicalExpr
 template< typename pass_type >
 void PassVisitor< pass_type >::visit( LogicalExpr * node ) {
-	VISIT_BODY( node );
-}
-
+	VISIT_START( node );
+
+	indexerScopedAccept( node->result, *this );
+	maybeAccept        ( node->arg1  , *this );
+	maybeAccept        ( node->arg2  , *this );
+
+	VISIT_END( node );
+}
+
+template< typename pass_type >
+Expression * PassVisitor< pass_type >::mutate( LogicalExpr * node ) {
+	MUTATE_START( node );
+
+	indexerScopedMutate( node->env   , *this );
+	indexerScopedMutate( node->result, *this );
+	maybeMutateRef     ( node->arg1  , *this );
+	maybeMutateRef     ( node->arg2  , *this );
+
+	MUTATE_END( Expression, node );
+}
+
+//--------------------------------------------------------------------------
+// ConditionalExpr
 template< typename pass_type >
 void PassVisitor< pass_type >::visit( ConditionalExpr * node ) {
-	VISIT_BODY( node );
-}
-
+	VISIT_START( node );
+
+	indexerScopedAccept( node->result, *this );
+	maybeAccept        ( node->arg1  , *this );
+	maybeAccept        ( node->arg2  , *this );
+	maybeAccept        ( node->arg3  , *this );
+
+	VISIT_END( node );
+}
+
+template< typename pass_type >
+Expression * PassVisitor< pass_type >::mutate( ConditionalExpr * node ) {
+	MUTATE_START( node );
+
+	indexerScopedMutate( node->env   , *this );
+	indexerScopedMutate( node->result, *this );
+	maybeMutateRef     ( node->arg1  , *this );
+	maybeMutateRef     ( node->arg2  , *this );
+	maybeMutateRef     ( node->arg3  , *this );
+
+	MUTATE_END( Expression, node );
+}
+
+//--------------------------------------------------------------------------
+// CommaExpr
 template< typename pass_type >
 void PassVisitor< pass_type >::visit( CommaExpr * node ) {
-	VISIT_BODY( node );
-}
-
+	VISIT_START( node );
+
+	indexerScopedAccept( node->result, *this );
+	maybeAccept        ( node->arg1  , *this );
+	maybeAccept        ( node->arg2  , *this );
+
+	VISIT_END( node );
+}
+
+template< typename pass_type >
+Expression * PassVisitor< pass_type >::mutate( CommaExpr * node ) {
+	MUTATE_START( node );
+
+	indexerScopedMutate( node->env   , *this );
+	indexerScopedMutate( node->result, *this );
+	maybeMutateRef     ( node->arg1  , *this );
+	maybeMutateRef     ( node->arg2  , *this );
+
+	MUTATE_END( Expression, node );
+}
+
+//--------------------------------------------------------------------------
+// TypeExpr
 template< typename pass_type >
 void PassVisitor< pass_type >::visit( TypeExpr * node ) {
-	VISIT_BODY( node );
-}
-
+	VISIT_START( node );
+
+	indexerScopedAccept( node->result, *this );
+	maybeAccept        ( node->type, *this );
+
+	VISIT_END( node );
+}
+
+template< typename pass_type >
+Expression * PassVisitor< pass_type >::mutate( TypeExpr * node ) {
+	MUTATE_START( node );
+
+	indexerScopedMutate( node->env   , *this );
+	indexerScopedMutate( node->result, *this );
+	maybeMutateRef     ( node->type  , *this );
+
+	MUTATE_END( Expression, node );
+}
+
+//--------------------------------------------------------------------------
+// AsmExpr
 template< typename pass_type >
 void PassVisitor< pass_type >::visit( AsmExpr * node ) {
-	VISIT_BODY( node );
-}
-
+	VISIT_START( node );
+
+	indexerScopedAccept( node->result    , *this );
+	maybeAccept        ( node->inout     , *this );
+	maybeAccept        ( node->constraint, *this );
+	maybeAccept        ( node->operand   , *this );
+
+	VISIT_END( node );
+}
+
+template< typename pass_type >
+Expression * PassVisitor< pass_type >::mutate( AsmExpr * node ) {
+	MUTATE_START( node );
+
+	indexerScopedMutate( node->env       , *this );
+	indexerScopedMutate( node->result    , *this );
+	maybeMutateRef     ( node->inout     , *this );
+	maybeMutateRef     ( node->constraint, *this );
+	maybeMutateRef     ( node->operand   , *this );
+
+	MUTATE_END( Expression, node );
+}
+
+//--------------------------------------------------------------------------
+// ImplicitCopyCtorExpr
 template< typename pass_type >
 void PassVisitor< pass_type >::visit( ImplicitCopyCtorExpr * node ) {
-	VISIT_BODY( node );
-}
-
+	VISIT_START( node );
+
+	indexerScopedAccept( node->result     , *this );
+	maybeAccept        ( node->callExpr   , *this );
+	maybeAccept        ( node->tempDecls  , *this );
+	maybeAccept        ( node->returnDecls, *this );
+	maybeAccept        ( node->dtors      , *this );
+
+	VISIT_END( node );
+}
+
+template< typename pass_type >
+Expression * PassVisitor< pass_type >::mutate( ImplicitCopyCtorExpr * node ) {
+	MUTATE_START( node );
+
+	indexerScopedMutate( node->env        , *this );
+	indexerScopedMutate( node->result     , *this );
+	maybeMutateRef     ( node->callExpr   , *this );
+	maybeMutateRef     ( node->tempDecls  , *this );
+	maybeMutateRef     ( node->returnDecls, *this );
+	maybeMutateRef     ( node->dtors      , *this );
+
+	MUTATE_END( Expression, node );
+}
+
+//--------------------------------------------------------------------------
+// ConstructorExpr
 template< typename pass_type >
 void PassVisitor< pass_type >::visit( ConstructorExpr * node ) {
-	VISIT_BODY( node );
-}
-
+	VISIT_START( node );
+
+	indexerScopedAccept( node->result  , *this );
+	maybeAccept        ( node->callExpr, *this );
+
+	VISIT_END( node );
+}
+
+template< typename pass_type >
+Expression * PassVisitor< pass_type >::mutate( ConstructorExpr * node ) {
+	MUTATE_START( node );
+
+	indexerScopedMutate( node->env     , *this );
+	indexerScopedMutate( node->result  , *this );
+	maybeMutateRef     ( node->callExpr, *this );
+
+	MUTATE_END( Expression, node );
+}
+
+//--------------------------------------------------------------------------
+// CompoundLiteralExpr
 template< typename pass_type >
 void PassVisitor< pass_type >::visit( CompoundLiteralExpr * node ) {
-	VISIT_BODY( node );
-}
-
+	VISIT_START( node );
+
+	indexerScopedAccept( node->result     , *this );
+	maybeAccept        ( node->initializer, *this );
+
+	VISIT_END( node );
+}
+
+template< typename pass_type >
+Expression * PassVisitor< pass_type >::mutate( CompoundLiteralExpr * node ) {
+	MUTATE_START( node );
+
+	indexerScopedMutate( node->env        , *this );
+	indexerScopedMutate( node->result     , *this );
+	maybeMutateRef     ( node->initializer, *this );
+
+	MUTATE_END( Expression, node );
+}
+
+//--------------------------------------------------------------------------
+// RangeExpr
 template< typename pass_type >
 void PassVisitor< pass_type >::visit( RangeExpr * node ) {
-	VISIT_BODY( node );
-}
-
+	VISIT_START( node );
+
+	indexerScopedAccept( node->result, *this );
+	maybeAccept        ( node->low   , *this );
+	maybeAccept        ( node->high  , *this );
+
+	VISIT_END( node );
+}
+
+template< typename pass_type >
+Expression * PassVisitor< pass_type >::mutate( RangeExpr * node ) {
+	MUTATE_START( node );
+
+	indexerScopedMutate( node->env   , *this );
+	indexerScopedMutate( node->result, *this );
+	maybeMutateRef     ( node->low   , *this );
+	maybeMutateRef     ( node->high  , *this );
+
+	MUTATE_END( Expression, node );
+}
+
+//--------------------------------------------------------------------------
+// UntypedTupleExpr
 template< typename pass_type >
 void PassVisitor< pass_type >::visit( UntypedTupleExpr * node ) {
-	VISIT_BODY( node );
-}
-
+	VISIT_START( node );
+
+	indexerScopedAccept( node->result, *this );
+	maybeAccept        ( node->exprs , *this );
+
+	VISIT_END( node );
+}
+
+template< typename pass_type >
+Expression * PassVisitor< pass_type >::mutate( UntypedTupleExpr * node ) {
+	MUTATE_START( node );
+
+	indexerScopedMutate( node->env   , *this );
+	indexerScopedMutate( node->result, *this );
+	maybeMutateRef     ( node->exprs , *this );
+
+	MUTATE_END( Expression, node );
+}
+
+//--------------------------------------------------------------------------
+// TupleExpr
 template< typename pass_type >
 void PassVisitor< pass_type >::visit( TupleExpr * node ) {
-	VISIT_BODY( node );
-}
-
+	VISIT_START( node );
+
+	indexerScopedAccept( node->result, *this );
+	maybeAccept          ( node->exprs , *this );
+
+	VISIT_END( node );
+}
+
+template< typename pass_type >
+Expression * PassVisitor< pass_type >::mutate( TupleExpr * node ) {
+	MUTATE_START( node );
+
+	indexerScopedMutate( node->env   , *this );
+	indexerScopedMutate( node->result, *this );
+	maybeMutateRef     ( node->exprs , *this );
+
+	MUTATE_END( Expression, node );
+}
+
+//--------------------------------------------------------------------------
+// TupleIndexExpr
 template< typename pass_type >
 void PassVisitor< pass_type >::visit( TupleIndexExpr * node ) {
-	VISIT_BODY( node );
-}
-
+	VISIT_START( node );
+
+	indexerScopedAccept( node->result, *this );
+	maybeAccept        ( node->tuple , *this );
+
+	VISIT_END( node );
+}
+
+template< typename pass_type >
+Expression * PassVisitor< pass_type >::mutate( TupleIndexExpr * node ) {
+	MUTATE_START( node );
+
+	indexerScopedMutate( node->env   , *this );
+	indexerScopedMutate( node->result, *this );
+	maybeMutateRef     ( node->tuple , *this );
+
+	MUTATE_END( Expression, node );
+}
+
+//--------------------------------------------------------------------------
+// TupleAssignExpr
 template< typename pass_type >
 void PassVisitor< pass_type >::visit( TupleAssignExpr * node ) {
-	VISIT_BODY( node );
-}
-
-//--------------------------------------------------------------------------
-// UntypedExpr
+	VISIT_START( node );
+
+	indexerScopedAccept( node->result  , *this );
+	maybeAccept        ( node->stmtExpr, *this );
+
+	VISIT_END( node );
+}
+
+template< typename pass_type >
+Expression * PassVisitor< pass_type >::mutate( TupleAssignExpr * node ) {
+	MUTATE_START( node );
+
+	indexerScopedMutate( node->env     , *this );
+	indexerScopedMutate( node->result  , *this );
+	maybeMutateRef     ( node->stmtExpr, *this );
+
+	MUTATE_END( Expression, node );
+}
+
+//--------------------------------------------------------------------------
+// StmtExpr
 template< typename pass_type >
 void PassVisitor< pass_type >::visit( StmtExpr * node ) {
@@ -794,5 +1662,8 @@
 	ValueGuardPtr< std::list< Statement* > > oldAfterStmts ( get_afterStmts () );
 
-	Visitor::visit( node );
+	indexerScopedAccept( node->result     , *this );
+	maybeAccept        ( node->statements , *this );
+	maybeAccept        ( node->returnDecls, *this );
+	maybeAccept        ( node->dtors      , *this );
 
 	VISIT_END( node );
@@ -808,12 +1679,33 @@
 	ValueGuardPtr< std::list< Statement* > > oldAfterStmts ( get_afterStmts () );
 
-	Mutator::mutate( node );
-
-	MUTATE_END( Expression, node );
-}
-
+	indexerScopedMutate( node->result     , *this );
+	maybeMutateRef     ( node->statements , *this );
+	maybeMutateRef     ( node->returnDecls, *this );
+	maybeMutateRef     ( node->dtors      , *this );
+
+	MUTATE_END( Expression, node );
+}
+
+//--------------------------------------------------------------------------
+// UniqueExpr
 template< typename pass_type >
 void PassVisitor< pass_type >::visit( UniqueExpr * node ) {
-	VISIT_BODY( node );
+	VISIT_START( node );
+
+	indexerScopedAccept( node->result, *this );
+	maybeAccept        ( node->expr  , *this );
+
+	VISIT_END( node );
+}
+
+template< typename pass_type >
+Expression * PassVisitor< pass_type >::mutate( UniqueExpr * node ) {
+	MUTATE_START( node );
+
+	indexerScopedMutate( node->env   , *this );
+	indexerScopedMutate( node->result, *this );
+	maybeMutateRef     ( node->expr  , *this );
+
+	MUTATE_END( Expression, node );
 }
 
@@ -848,14 +1740,70 @@
 }
 
+//--------------------------------------------------------------------------
+// StructInstType
 template< typename pass_type >
 void PassVisitor< pass_type >::visit( StructInstType * node ) {
-	VISIT_BODY( node );
-}
-
+	VISIT_START( node );
+
+	indexerAddStruct( node->name );
+
+	{
+		auto guard = makeFuncGuard( [this]() { indexerScopeEnter(); }, [this]() { indexerScopeLeave(); } );
+		maybeAccept( node->forall    , *this );
+		maybeAccept( node->parameters, *this );
+	}
+
+	VISIT_END( node );
+}
+
+template< typename pass_type >
+Type * PassVisitor< pass_type >::mutate( StructInstType * node ) {
+	MUTATE_START( node );
+
+	indexerAddStruct( node->name );
+
+	{
+		auto guard = makeFuncGuard( [this]() { indexerScopeEnter(); }, [this]() { indexerScopeLeave(); } );
+		maybeMutateRef( node->forall    , *this );
+		maybeMutateRef( node->parameters, *this );
+	}
+
+	MUTATE_END( Type, node );
+}
+
+//--------------------------------------------------------------------------
+// UnionInstType
 template< typename pass_type >
 void PassVisitor< pass_type >::visit( UnionInstType * node ) {
-	VISIT_BODY( node );
-}
-
+	VISIT_START( node );
+
+	indexerAddStruct( node->name );
+
+	{
+		auto guard = makeFuncGuard( [this]() { indexerScopeEnter(); }, [this]() { indexerScopeLeave(); } );
+		maybeAccept( node->forall    , *this );
+		maybeAccept( node->parameters, *this );
+	}
+
+	VISIT_END( node );
+}
+
+template< typename pass_type >
+Type * PassVisitor< pass_type >::mutate( UnionInstType * node ) {
+	MUTATE_START( node );
+
+	indexerAddStruct( node->name );
+
+	{
+		auto guard = makeFuncGuard( [this]() { indexerScopeEnter(); }, [this]() { indexerScopeLeave(); } );
+		maybeMutateRef( node->forall    , *this );
+		maybeMutateRef( node->parameters, *this );
+	}
+
+	MUTATE_END( Type, node );
+}
+
+//--------------------------------------------------------------------------
+// EnumInstType
 template< typename pass_type >
 void PassVisitor< pass_type >::visit( EnumInstType * node ) {
@@ -864,8 +1812,32 @@
 
 template< typename pass_type >
+Type * PassVisitor< pass_type >::mutate( EnumInstType * node ) {
+	MUTATE_BODY( Type, node );
+}
+
+//--------------------------------------------------------------------------
+// TraitInstType
+template< typename pass_type >
 void PassVisitor< pass_type >::visit( TraitInstType * node ) {
-	VISIT_BODY( node );
-}
-
+	VISIT_START( node );
+
+	maybeAccept( node->forall    , *this );
+	maybeAccept( node->parameters, *this );
+
+	VISIT_END( node );
+}
+
+template< typename pass_type >
+Type * PassVisitor< pass_type >::mutate( TraitInstType * node ) {
+	MUTATE_START( node );
+
+	maybeMutateRef( node->forall    , *this );
+	maybeMutateRef( node->parameters, *this );
+
+	MUTATE_END( Type, node );
+}
+
+//--------------------------------------------------------------------------
+// TypeInstType
 template< typename pass_type >
 void PassVisitor< pass_type >::visit( TypeInstType * node ) {
@@ -904,5 +1876,5 @@
 
 //--------------------------------------------------------------------------
-// UntypedExpr
+// SingleInit
 template< typename pass_type >
 void PassVisitor< pass_type >::visit( SingleInit * node ) {
@@ -944,195 +1916,4 @@
 
 //---------------------------------------------------------------------------------------------------------------
-
-template< typename pass_type >
-DeclarationWithType * PassVisitor< pass_type >::mutate( ObjectDecl * node ) {
-	MUTATE_BODY( DeclarationWithType, node );
-}
-
-template< typename pass_type >
-DeclarationWithType * PassVisitor< pass_type >::mutate( FunctionDecl * node ) {
-	MUTATE_BODY( DeclarationWithType, node );
-}
-
-template< typename pass_type >
-Declaration * PassVisitor< pass_type >::mutate( StructDecl * node ) {
-	MUTATE_BODY( Declaration, node );
-}
-
-template< typename pass_type >
-Declaration * PassVisitor< pass_type >::mutate( UnionDecl * node ) {
-	MUTATE_BODY( Declaration, node );
-}
-
-template< typename pass_type >
-Declaration * PassVisitor< pass_type >::mutate( EnumDecl * node ) {
-	MUTATE_BODY( Declaration, node );
-}
-
-template< typename pass_type >
-Declaration * PassVisitor< pass_type >::mutate( TraitDecl * node ) {
-	MUTATE_BODY( Declaration, node );
-}
-
-template< typename pass_type >
-Declaration * PassVisitor< pass_type >::mutate( TypeDecl * node ) {
-	MUTATE_BODY( Declaration, node );
-}
-
-template< typename pass_type >
-Declaration * PassVisitor< pass_type >::mutate( TypedefDecl * node ) {
-	MUTATE_BODY( Declaration, node );
-}
-
-template< typename pass_type >
-AsmDecl * PassVisitor< pass_type >::mutate( AsmDecl * node ) {
-	MUTATE_BODY( AsmDecl, node );
-}
-
-template< typename pass_type >
-Expression * PassVisitor< pass_type >::mutate( NameExpr * node ) {
-	MUTATE_BODY( Expression, node );
-}
-
-template< typename pass_type >
-Expression * PassVisitor< pass_type >::mutate( AddressExpr * node ) {
-	MUTATE_BODY( Expression, node );
-}
-
-template< typename pass_type >
-Expression * PassVisitor< pass_type >::mutate( LabelAddressExpr * node ) {
-	MUTATE_BODY( Expression, node );
-}
-
-template< typename pass_type >
-Expression * PassVisitor< pass_type >::mutate( CastExpr * node ) {
-	MUTATE_BODY( Expression, node );
-}
-
-template< typename pass_type >
-Expression * PassVisitor< pass_type >::mutate( VirtualCastExpr * node ) {
-	MUTATE_BODY( Expression, node );
-}
-
-template< typename pass_type >
-Expression * PassVisitor< pass_type >::mutate( UntypedMemberExpr * node ) {
-	MUTATE_BODY( Expression, node );
-}
-
-template< typename pass_type >
-Expression * PassVisitor< pass_type >::mutate( MemberExpr * node ) {
-	MUTATE_BODY( Expression, node );
-}
-
-template< typename pass_type >
-Expression * PassVisitor< pass_type >::mutate( VariableExpr * node ) {
-	MUTATE_BODY( Expression, node );
-}
-
-template< typename pass_type >
-Expression * PassVisitor< pass_type >::mutate( ConstantExpr * node ) {
-	MUTATE_BODY( Expression, node );
-}
-
-template< typename pass_type >
-Expression * PassVisitor< pass_type >::mutate( SizeofExpr * node ) {
-	MUTATE_BODY( Expression, node );
-}
-
-template< typename pass_type >
-Expression * PassVisitor< pass_type >::mutate( AlignofExpr * node ) {
-	MUTATE_BODY( Expression, node );
-}
-
-template< typename pass_type >
-Expression * PassVisitor< pass_type >::mutate( UntypedOffsetofExpr * node ) {
-	MUTATE_BODY( Expression, node );
-}
-
-template< typename pass_type >
-Expression * PassVisitor< pass_type >::mutate( OffsetofExpr * node ) {
-	MUTATE_BODY( Expression, node );
-}
-
-template< typename pass_type >
-Expression * PassVisitor< pass_type >::mutate( OffsetPackExpr * node ) {
-	MUTATE_BODY( Expression, node );
-}
-
-template< typename pass_type >
-Expression * PassVisitor< pass_type >::mutate( AttrExpr * node ) {
-	MUTATE_BODY( Expression, node );
-}
-
-template< typename pass_type >
-Expression * PassVisitor< pass_type >::mutate( LogicalExpr * node ) {
-	MUTATE_BODY( Expression, node );
-}
-
-template< typename pass_type >
-Expression * PassVisitor< pass_type >::mutate( ConditionalExpr * node ) {
-	MUTATE_BODY( Expression, node );
-}
-
-template< typename pass_type >
-Expression * PassVisitor< pass_type >::mutate( CommaExpr * node ) {
-	MUTATE_BODY( Expression, node );
-}
-
-template< typename pass_type >
-Expression * PassVisitor< pass_type >::mutate( TypeExpr * node ) {
-	MUTATE_BODY( Expression, node );
-}
-
-template< typename pass_type >
-Expression * PassVisitor< pass_type >::mutate( AsmExpr * node ) {
-	MUTATE_BODY( Expression, node );
-}
-
-template< typename pass_type >
-Expression * PassVisitor< pass_type >::mutate( ImplicitCopyCtorExpr * node ) {
-	MUTATE_BODY( Expression, node );
-}
-
-template< typename pass_type >
-Expression * PassVisitor< pass_type >::mutate( ConstructorExpr * node ) {
-	MUTATE_BODY( Expression, node );
-}
-
-template< typename pass_type >
-Expression * PassVisitor< pass_type >::mutate( CompoundLiteralExpr * node ) {
-	MUTATE_BODY( Expression, node );
-}
-
-template< typename pass_type >
-Expression * PassVisitor< pass_type >::mutate( RangeExpr * node ) {
-	MUTATE_BODY( Expression, node );
-}
-
-template< typename pass_type >
-Expression * PassVisitor< pass_type >::mutate( UntypedTupleExpr * node ) {
-	MUTATE_BODY( Expression, node );
-}
-
-template< typename pass_type >
-Expression * PassVisitor< pass_type >::mutate( TupleExpr * node ) {
-	MUTATE_BODY( Expression, node );
-}
-
-template< typename pass_type >
-Expression * PassVisitor< pass_type >::mutate( TupleIndexExpr * node ) {
-	MUTATE_BODY( Expression, node );
-}
-
-template< typename pass_type >
-Expression * PassVisitor< pass_type >::mutate( TupleAssignExpr * node ) {
-	MUTATE_BODY( Expression, node );
-}
-
-template< typename pass_type >
-Expression * PassVisitor< pass_type >::mutate( UniqueExpr * node ) {
-	MUTATE_BODY( Expression, node );
-}
-
 template< typename pass_type >
 Type * PassVisitor< pass_type >::mutate( VoidType * node ) {
@@ -1166,24 +1947,4 @@
 
 template< typename pass_type >
-Type * PassVisitor< pass_type >::mutate( StructInstType * node ) {
-	MUTATE_BODY( Type, node );
-}
-
-template< typename pass_type >
-Type * PassVisitor< pass_type >::mutate( UnionInstType * node ) {
-	MUTATE_BODY( Type, node );
-}
-
-template< typename pass_type >
-Type * PassVisitor< pass_type >::mutate( EnumInstType * node ) {
-	MUTATE_BODY( Type, node );
-}
-
-template< typename pass_type >
-Type * PassVisitor< pass_type >::mutate( TraitInstType * node ) {
-	MUTATE_BODY( Type, node );
-}
-
-template< typename pass_type >
 Type * PassVisitor< pass_type >::mutate( TypeInstType * node ) {
 	MUTATE_BODY( Type, node );
Index: src/Common/PassVisitor.proto.h
===================================================================
--- src/Common/PassVisitor.proto.h	(revision d130fe87f4cdf82b08c0879a57d7bae53c7644a2)
+++ src/Common/PassVisitor.proto.h	(revision ba54f7dba922f0df27eebfcc9c67f07969df7db4)
@@ -41,5 +41,4 @@
 };
 
-
 class bool_ref {
 public:
@@ -59,4 +58,27 @@
 	bool * m_ref;
 };
+
+template< typename TreeType, typename VisitorType >
+inline void indexerScopedAccept( TreeType * tree, VisitorType & visitor ) {
+	auto guard = makeFuncGuard(
+		[&visitor]() { visitor.indexerScopeEnter(); },
+		[&visitor]() { visitor.indexerScopeLeave(); }
+	);
+	maybeAccept( tree, visitor );
+}
+
+template< typename TreeType, typename MutatorType >
+inline void indexerScopedMutate( TreeType *& tree, MutatorType & mutator ) {
+	auto guard = makeFuncGuard(
+		[&mutator]() { mutator.indexerScopeEnter(); },
+		[&mutator]() { mutator.indexerScopeLeave(); }
+	);
+	tree = maybeMutate( tree, mutator );
+}
+
+template< typename TreeType, typename MutatorType >
+inline void maybeMutateRef( TreeType *& tree, MutatorType & mutator ) {
+	tree = maybeMutate( tree, mutator );
+}
 
 //-------------------------------------------------------------------------------------------------------------------------------------------------------------------------
@@ -93,4 +115,5 @@
 static inline void postvisit_impl( __attribute__((unused)) pass_type& pass, __attribute__((unused)) node_type * node, __attribute__((unused)) long unused ) {}
 
+//---------------------------------------------------------
 // Mutate
 template<typename pass_type, typename node_type>
@@ -111,4 +134,5 @@
 static inline return_type postmutate_impl( __attribute__((unused)) pass_type& pass, node_type * node, __attribute__((unused)) long unused ) { return node; }
 
+//---------------------------------------------------------
 // Begin/End scope
 template<typename pass_type>
@@ -129,4 +153,5 @@
 static inline void end_scope_impl( __attribute__((unused)) pass_type& pass, __attribute__((unused)) long unused ) {}
 
+//---------------------------------------------------------
 // Fields
 #define FIELD_PTR( type, name )                                                                                                        \
@@ -145,2 +170,78 @@
 FIELD_PTR( at_cleanup_t, at_cleanup )
 FIELD_PTR( PassVisitor<pass_type> * const, visitor )
+
+//---------------------------------------------------------
+// Indexer
+template<typename pass_type>
+static inline auto indexer_impl_enterScope( pass_type & pass, int ) -> decltype( pass.indexer.enterScope(), void() ) {
+	pass.indexer.enterScope();
+}
+
+template<typename pass_type>
+static inline auto indexer_impl_enterScope( pass_type &, int ) {}
+
+template<typename pass_type>
+static inline auto indexer_impl_leaveScope( pass_type & pass, int ) -> decltype( pass.indexer.leaveScope(), void() ) {
+	pass.indexer.leaveScope();
+}
+
+template<typename pass_type>
+static inline auto indexer_impl_leaveScope( pass_type &, int ) {}
+
+
+#define INDEXER_FUNC( func, type )                                                                                             \
+template<typename pass_type>                                                                                                   \
+static inline auto indexer_impl_##func ( pass_type & pass, int, type arg ) -> decltype( pass.indexer.func( arg ), void() ) {   \
+	pass.indexer.func( arg );                                                                                                \
+}                                                                                                                              \
+                                                                                                                               \
+template<typename pass_type>                                                                                                   \
+static inline void indexer_impl_##func ( pass_type &, long, type ) {}                                                          \
+
+INDEXER_FUNC( addId     , DeclarationWithType * );
+INDEXER_FUNC( addType   , NamedTypeDecl *       );
+INDEXER_FUNC( addStruct , StructDecl *          );
+INDEXER_FUNC( addEnum   , EnumDecl *            );
+INDEXER_FUNC( addUnion  , UnionDecl *           );
+INDEXER_FUNC( addTrait  , TraitDecl *           );
+
+
+template<typename pass_type>
+static inline auto indexer_impl_addStructFwd( pass_type & pass, int, StructDecl * decl ) -> decltype( pass.indexer.addStruct( decl ), void() ) {
+	StructDecl * fwd = new StructDecl( decl->name );
+	cloneAll( decl->parameters, fwd->parameters );
+	pass.indexer.addStruct( fwd );
+}
+
+template<typename pass_type>
+static inline auto indexer_impl_addStructFwd( pass_type &, int, StructDecl * ) {}
+
+template<typename pass_type>
+static inline auto indexer_impl_addUnionFwd( pass_type & pass, int, UnionDecl * decl ) -> decltype( pass.indexer.addUnion( decl ), void() ) {
+	UnionDecl * fwd = new UnionDecl( decl->name );
+	cloneAll( decl->parameters, fwd->parameters );
+	pass.indexer.addUnion( fwd );
+}
+
+template<typename pass_type>
+static inline auto indexer_impl_addUnionFwd( pass_type &, int, UnionDecl * ) {}
+
+template<typename pass_type>
+static inline auto indexer_impl_addStruct( pass_type & pass, int, const std::string & str ) -> decltype( pass.indexer.addStruct( str ), void() ) {
+	if ( ! pass.indexer.lookupStruct( str ) ) {
+		pass.indexer.addStruct( str );
+	}
+}
+
+template<typename pass_type>
+static inline auto indexer_impl_addStruct( pass_type &, int, const std::string & ) {}
+
+template<typename pass_type>
+static inline auto indexer_impl_addUnion( pass_type & pass, int, const std::string & str ) -> decltype( pass.indexer.addUnion( str ), void() ) {
+	if ( ! pass.indexer.lookupUnion( str ) ) {
+		pass.indexer.addUnion( str );
+	}
+}
+
+template<typename pass_type>
+static inline auto indexer_impl_addUnion( pass_type &, int, const std::string & ) {}
Index: src/Common/utility.h
===================================================================
--- src/Common/utility.h	(revision d130fe87f4cdf82b08c0879a57d7bae53c7644a2)
+++ src/Common/utility.h	(revision ba54f7dba922f0df27eebfcc9c67f07969df7db4)
@@ -277,4 +277,23 @@
 	~ValueGuardPtr() { if( ref ) *ref = old; }
 };
+
+template< typename aT >
+struct FuncGuard {
+	aT m_after;
+
+	template< typename bT >
+	FuncGuard( bT before, aT after ) : m_after( after ) {
+		before();
+	}
+
+	~FuncGuard() {
+		m_after();
+	}
+};
+
+template< typename bT, typename aT >
+FuncGuard<aT> makeFuncGuard( bT && before, aT && after ) {
+	return FuncGuard<aT>( std::forward<bT>(before), std::forward<aT>(after) );
+}
 
 template< typename T >
Index: src/Concurrency/Keywords.cc
===================================================================
--- src/Concurrency/Keywords.cc	(revision d130fe87f4cdf82b08c0879a57d7bae53c7644a2)
+++ src/Concurrency/Keywords.cc	(revision ba54f7dba922f0df27eebfcc9c67f07969df7db4)
@@ -259,5 +259,5 @@
 	//=============================================================================================
 	void ConcurrentSueKeyword::postvisit(StructDecl * decl) {
-		if( decl->get_name() == type_name && decl->has_body() ) {
+		if( decl->name == type_name && decl->body ) {
 			assert( !type_decl );
 			type_decl = decl;
@@ -270,5 +270,5 @@
 
 	void ConcurrentSueKeyword::handle( StructDecl * decl ) {
-		if( ! decl->has_body() ) return;
+		if( ! decl->body ) return;
 
 		if( !type_decl ) throw SemanticError( context_error, decl );
@@ -418,9 +418,9 @@
 	void MutexKeyword::postvisit(StructDecl* decl) {
 
-		if( decl->get_name() == "monitor_desc" ) {
+		if( decl->name == "monitor_desc" ) {
 			assert( !monitor_decl );
 			monitor_decl = decl;
 		}
-		else if( decl->get_name() == "monitor_guard_t" ) {
+		else if( decl->name == "monitor_guard_t" ) {
 			assert( !guard_decl );
 			guard_decl = decl;
@@ -524,5 +524,5 @@
 	//=============================================================================================
 	void ThreadStarter::postvisit(FunctionDecl * decl) {
-		if( ! CodeGen::isConstructor(decl->get_name()) ) return;
+		if( ! CodeGen::isConstructor(decl->name) ) return;
 
 		DeclarationWithType * param = decl->get_functionType()->get_parameters().front();
Index: src/Concurrency/Waitfor.cc
===================================================================
--- src/Concurrency/Waitfor.cc	(revision ba54f7dba922f0df27eebfcc9c67f07969df7db4)
+++ src/Concurrency/Waitfor.cc	(revision ba54f7dba922f0df27eebfcc9c67f07969df7db4)
@@ -0,0 +1,414 @@
+//
+// Cforall Version 1.0.0 Copyright (C) 2016 University of Waterloo
+//
+// The contents of this file are covered under the licence agreement in the
+// file "LICENCE" distributed with Cforall.
+//
+// Waitfor.cc --
+//
+// Author           : Thierry Delisle
+// Created On       : Mon Aug 28 11:06:52 2017
+// Last Modified By :
+// Last Modified On :
+// Update Count     : 5
+//
+
+#include "Concurrency/Keywords.h"
+
+#include <cassert>                 // for assert
+#include <string>                  // for string, operator==
+
+using namespace std::string_literals;
+
+#include "Common/PassVisitor.h"    // for PassVisitor
+#include "Common/SemanticError.h"  // for SemanticError
+#include "Common/utility.h"        // for deleteAll, map_range
+#include "CodeGen/OperatorTable.h" // for isConstructor
+#include "InitTweak/InitTweak.h"   // for getPointerBase
+#include "Parser/LinkageSpec.h"    // for Cforall
+#include "SymTab/AddVisit.h"       // for acceptAndAdd
+#include "SynTree/Constant.h"      // for Constant
+#include "SynTree/Declaration.h"   // for StructDecl, FunctionDecl, ObjectDecl
+#include "SynTree/Expression.h"    // for VariableExpr, ConstantExpr, Untype...
+#include "SynTree/Initializer.h"   // for SingleInit, ListInit, Initializer ...
+#include "SynTree/Label.h"         // for Label
+#include "SynTree/Statement.h"     // for CompoundStmt, DeclStmt, ExprStmt
+#include "SynTree/Type.h"          // for StructInstType, Type, PointerType
+#include "SynTree/Visitor.h"       // for Visitor, acceptAll
+
+class Attribute;
+/*
+void foo() {
+	while( true ) {
+		when( a < 1 ) waitfor( f, a ) { bar(); }
+		or timeout( swagl() );
+		or waitfor( g, a ) { baz(); }
+		or waitfor( ^?{}, a ) { break; }
+		or waitfor( ^?{} ) { break; }
+	}
+}
+
+void f(int i, float f, A & mutex b, struct foo *  );
+void f(int );
+
+
+                      |  |
+                      |  |
+			    |  |
+                      |  |
+                      |  |
+                    \ |  | /
+                     \    /
+                      \  /
+                       \/
+
+
+void foo() {
+	while( true ) {
+
+		acceptable_t acceptables[3];
+		if( a < 1 ) {
+			acceptables[0].func = f;
+			acceptables[0].mon = a;
+		}
+		acceptables[1].func = g;
+		acceptables[1].mon = a;
+
+		acceptables[2].func = f;
+		acceptables[2].mon = a;
+		acceptables[2].is_dtor = true;
+
+		int ret = waitfor_internal( acceptables, swagl() );
+
+		switch( ret ) {
+			case 0:
+			{
+				bar();
+			}
+			case 1:
+			{
+				baz();
+			}
+			case 2:
+				signal(a);
+				{
+					break;
+				}
+		}
+	}
+}*/
+
+namespace Concurrency {
+
+	namespace {
+		const std::list<Label> noLabels;
+		const std::list< Attribute * > noAttributes;
+		Type::StorageClasses noStorage;
+		Type::Qualifiers noQualifiers;
+	}
+
+	//=============================================================================================
+	// Pass declarations
+	//=============================================================================================
+
+	class GenerateWaitForPass final : public WithStmtsToAdd {
+	  public:
+
+		void premutate( FunctionDecl * decl );
+		void premutate( StructDecl   * decl );
+
+		Statement * postmutate( WaitForStmt * stmt );
+
+		static void generate( std::list< Declaration * > & translationUnit ) {
+			PassVisitor< GenerateWaitForPass > impl;
+			acceptAll( translationUnit, impl );
+		}
+
+		ObjectDecl * declare( unsigned long count, CompoundStmt * stmt );
+		ObjectDecl * declMon( WaitForStmt::Clause & clause, CompoundStmt * stmt );
+		void         init( ObjectDecl * acceptables, int index, WaitForStmt::Clause & clause, CompoundStmt * stmt );
+		Expression * init_timeout( Expression *& time, Expression *& time_cond, bool has_else, Expression *& else_cond, CompoundStmt * stmt );
+		Expression * call();
+		void choose();
+
+		static void implement( std::list< Declaration * > & translationUnit ) {
+			PassVisitor< GenerateWaitForPass > impl;
+			mutateAll( translationUnit, impl );
+		}
+
+
+	  private:
+	  	FunctionDecl        * decl_waitfor    = nullptr;
+		StructDecl          * decl_acceptable = nullptr;
+		StructDecl          * decl_monitor    = nullptr;
+		DeclarationWithType * decl_m_func     = nullptr;
+		DeclarationWithType * decl_m_count    = nullptr;
+		DeclarationWithType * decl_m_monitors = nullptr;
+		DeclarationWithType * decl_m_isdtor   = nullptr;
+
+		static std::unique_ptr< Type > generic_func;
+
+		UniqueName namer_mon = "__monitors_"s;
+		UniqueName namer_acc = "__acceptables_"s;
+		UniqueName namer_tim = "__timeout_"s;
+	};
+
+	//=============================================================================================
+	// General entry routine
+	//=============================================================================================
+	void generateWaitFor( std::list< Declaration * > & translationUnit ) {
+		GenerateWaitForPass	::implement( translationUnit );
+	}
+
+	//=============================================================================================
+	// Generic helper routine
+	//=============================================================================================
+
+	namespace {
+		Expression * makeOpIndex( DeclarationWithType * array, unsigned long index ) {
+			return new ApplicationExpr(
+				new NameExpr( "?[?]" ),
+				{
+					new VariableExpr( array ),
+					new ConstantExpr( Constant::from_ulong( index ) )
+				}
+			);
+		}
+
+		Expression * makeOpAssign( Expression * lhs, Expression * rhs ) {
+			return new ApplicationExpr(
+					new NameExpr( "?=?" ),
+					{ lhs, rhs }
+			);
+		}
+
+		Expression * makeOpMember( Expression * sue, DeclarationWithType * mem ) {
+			return new MemberExpr( mem, sue );
+		}
+
+		Statement * makeAccStatement( DeclarationWithType * object, unsigned long index, DeclarationWithType * member, Expression * value ) {
+			return new ExprStmt(
+				noLabels,
+				makeOpAssign(
+					makeOpMember(
+						makeOpIndex(
+							object,
+							index
+						),
+						member
+					),
+					value
+				)
+			);
+		}
+
+		Expression * safeCond( Expression * expr, bool ifnull = true ) {
+			if( expr ) return expr;
+
+			return new ConstantExpr( Constant::from_bool( ifnull ) );
+		}
+	};
+
+
+	//=============================================================================================
+	// Generate waitfor implementation
+	//=============================================================================================
+
+	void GenerateWaitForPass::premutate( FunctionDecl * decl) {
+		if( decl->name != "__accept_internal" ) return;
+
+		decl_waitfor = decl;
+	}
+
+	void GenerateWaitForPass::premutate( StructDecl   * decl ) {
+		if( ! decl->body ) return;
+
+		if( decl->name == "__acceptable_t" ) {
+			assert( !decl_acceptable );
+			decl_acceptable = decl;
+			for( Declaration * field : decl_acceptable->members ) {
+				     if( field->name == "func"    ) decl_m_func     = strict_dynamic_cast< DeclarationWithType * >( field );
+				else if( field->name == "count"   ) decl_m_count    = strict_dynamic_cast< DeclarationWithType * >( field );
+				else if( field->name == "monitor" ) decl_m_monitors = strict_dynamic_cast< DeclarationWithType * >( field );
+				else if( field->name == "is_dtor" ) decl_m_isdtor   = strict_dynamic_cast< DeclarationWithType * >( field );
+			}
+
+		}
+		else if( decl->name == "monitor_desc" ) {
+			assert( !decl_monitor );
+			decl_monitor = decl;
+		}
+	}
+
+	Statement * GenerateWaitForPass::postmutate( WaitForStmt * waitfor ) {
+		return waitfor;
+
+		if( !decl_monitor || !decl_acceptable ) throw SemanticError( "waitfor keyword requires monitors to be in scope, add #include <monitor>", waitfor );
+
+		CompoundStmt * stmt = new CompoundStmt( noLabels );
+
+		ObjectDecl * acceptables = declare( waitfor->clauses.size(), stmt );
+
+		int index = 0;
+		for( auto & clause : waitfor->clauses ) {
+			init( acceptables, index, clause, stmt );
+
+			index++;
+		}
+
+		Expression * timeout = init_timeout(
+			waitfor->timeout.time,
+			waitfor->timeout.condition,
+			waitfor->orelse .statement,
+			waitfor->orelse .condition,
+			stmt
+		);
+
+		// Expression * result  = call( acceptables, timeout, orelse, stmt );
+
+		// choose( waitfor, result );
+
+		return stmt;
+	}
+
+	ObjectDecl * GenerateWaitForPass::declare( unsigned long count, CompoundStmt * stmt )
+	{
+		ObjectDecl * acceptables = new ObjectDecl(
+			namer_acc.newName(),
+			noStorage,
+			LinkageSpec::Cforall,
+			nullptr,
+			new ArrayType(
+				noQualifiers,
+				new StructInstType(
+					noQualifiers,
+					decl_acceptable
+				),
+				new ConstantExpr( Constant::from_ulong( count ) ),
+				false,
+				false
+			),
+			nullptr
+		);
+
+		stmt->push_back( new DeclStmt( noLabels, acceptables) );
+
+		return acceptables;
+	}
+
+	ObjectDecl * GenerateWaitForPass::declMon( WaitForStmt::Clause & clause, CompoundStmt * stmt ) {
+
+		ObjectDecl * mon = new ObjectDecl(
+			namer_mon.newName(),
+			noStorage,
+			LinkageSpec::Cforall,
+			nullptr,
+			new ArrayType(
+				noQualifiers,
+				new StructInstType(
+					noQualifiers,
+					decl_monitor
+				),
+				new ConstantExpr( Constant::from_ulong( clause.target.arguments.size() ) ),
+				false,
+				false
+			),
+			new ListInit(
+				map_range < std::list<Initializer*> > ( clause.target.arguments, [this](Expression * expr ){
+					return new SingleInit( expr );
+				})
+			)
+		);
+
+		stmt->push_back( new DeclStmt( noLabels, mon) );
+
+		return mon;
+	}
+
+	void GenerateWaitForPass::init( ObjectDecl * acceptables, int index, WaitForStmt::Clause & clause, CompoundStmt * stmt ) {
+
+		ObjectDecl * monitors = declMon( clause, stmt );
+
+		CompoundStmt * compound = new CompoundStmt( noLabels );
+		compound->push_back( makeAccStatement( acceptables, index, decl_m_func    , clause.target.function ) );
+		compound->push_back( makeAccStatement( acceptables, index, decl_m_count   , new ConstantExpr( Constant::from_ulong( clause.target.arguments.size() ) ) ) );
+		compound->push_back( makeAccStatement( acceptables, index, decl_m_monitors, new VariableExpr( monitors ) ) );
+		compound->push_back( makeAccStatement( acceptables, index, decl_m_isdtor  , new ConstantExpr( Constant::from_bool( true ) ) ) );
+
+		stmt->push_back( new IfStmt(
+			noLabels,
+			safeCond( clause.condition ),
+			compound,
+			nullptr
+		));
+
+		clause.target.function = nullptr;
+		clause.target.arguments.empty();
+		clause.condition = nullptr;
+	}
+
+	Expression * GenerateWaitForPass::init_timeout(
+		Expression *& time,
+		Expression *& time_cond,
+		bool has_else,
+		Expression *& else_cond,
+		CompoundStmt * stmt
+	) {
+		ObjectDecl * timeout = new ObjectDecl(
+			namer_tim.newName(),
+			noStorage,
+			LinkageSpec::Cforall,
+			nullptr,
+			new BasicType(
+				noQualifiers,
+				BasicType::LongLongUnsignedInt
+			),
+			new SingleInit(
+				new ConstantExpr( Constant::from_int( -1 ) )
+			)
+		);
+
+		stmt->push_back( new DeclStmt( noLabels, timeout ) );
+
+		if( time ) {
+			stmt->push_back( new IfStmt(
+				noLabels,
+				safeCond( else_cond ),
+				new ExprStmt(
+					noLabels,
+					makeOpAssign(
+						new VariableExpr( timeout ),
+						time
+					)
+				),
+				nullptr
+			));
+
+			time = time_cond = nullptr;
+		}
+
+		if( has_else ) {
+			stmt->push_back( new IfStmt(
+				noLabels,
+				safeCond( else_cond ),
+				new ExprStmt(
+					noLabels,
+					makeOpAssign(
+						new VariableExpr( timeout ),
+						new ConstantExpr( Constant::from_ulong( 0 ) )
+					)
+				),
+				nullptr
+			));
+
+			else_cond = nullptr;
+		}
+
+		return new VariableExpr( timeout );
+	}
+};
+
+// Local Variables: //
+// mode: c //
+// tab-width: 4 //
+// End: //
Index: src/Concurrency/Waitfor.h
===================================================================
--- src/Concurrency/Waitfor.h	(revision ba54f7dba922f0df27eebfcc9c67f07969df7db4)
+++ src/Concurrency/Waitfor.h	(revision ba54f7dba922f0df27eebfcc9c67f07969df7db4)
@@ -0,0 +1,30 @@
+//
+// Cforall Version 1.0.0 Copyright (C) 2016 University of Waterloo
+//
+// The contents of this file are covered under the licence agreement in the
+// file "LICENCE" distributed with Cforall.
+//
+// Waitfor.h --
+//
+// Author           : Thierry Delisle
+// Created On       : Mon Aug 28 11:03:31 2017
+// Last Modified By :
+// Last Modified On :
+// Update Count     : 1
+//
+
+#pragma once
+
+#include <list>  // for list
+
+class Declaration;
+
+namespace Concurrency {
+	void generateWaitFor( std::list< Declaration * > & translationUnit );
+};
+
+// Local Variables: //
+// tab-width: 4 //
+// mode: c++ //
+// compile-command: "make install" //
+// End: //
Index: src/Concurrency/module.mk
===================================================================
--- src/Concurrency/module.mk	(revision d130fe87f4cdf82b08c0879a57d7bae53c7644a2)
+++ src/Concurrency/module.mk	(revision ba54f7dba922f0df27eebfcc9c67f07969df7db4)
@@ -6,13 +6,14 @@
 ## file "LICENCE" distributed with Cforall.
 ##
-## module.mk -- 
+## module.mk --
 ##
 ## Author           : Thierry Delisle
 ## Created On       : Mon Mar 13 12:48:40 2017
-## Last Modified By : 
-## Last Modified On : 
+## Last Modified By :
+## Last Modified On :
 ## Update Count     : 0
 ###############################################################################
 
-SRC += Concurrency/Keywords.cc 
+SRC += Concurrency/Keywords.cc \
+       Concurrency/Waitfor.cc
 
Index: src/GenPoly/Box.cc
===================================================================
--- src/GenPoly/Box.cc	(revision d130fe87f4cdf82b08c0879a57d7bae53c7644a2)
+++ src/GenPoly/Box.cc	(revision ba54f7dba922f0df27eebfcc9c67f07969df7db4)
@@ -15,5 +15,5 @@
 
 #include <algorithm>                     // for mismatch
-#include <cassert>                       // for assert, safe_dynamic_cast
+#include <cassert>                       // for assert, strict_dynamic_cast
 #include <iostream>                      // for operator<<, stringstream
 #include <list>                          // for list, list<>::iterator, _Lis...
@@ -1305,5 +1305,5 @@
 
 		DeclarationWithType * Pass2::mutate( FunctionDecl *functionDecl ) {
-			functionDecl = safe_dynamic_cast< FunctionDecl * > ( handleDecl( functionDecl ) );
+			functionDecl = strict_dynamic_cast< FunctionDecl * > ( handleDecl( functionDecl ) );
 			FunctionType * ftype = functionDecl->get_functionType();
 			if ( ! ftype->get_returnVals().empty() && functionDecl->get_statements() ) {
@@ -1384,5 +1384,5 @@
 			// move polymorphic return type to parameter list
 			if ( isDynRet( funcType ) ) {
-				ObjectDecl *ret = safe_dynamic_cast< ObjectDecl* >( funcType->get_returnVals().front() );
+				ObjectDecl *ret = strict_dynamic_cast< ObjectDecl* >( funcType->get_returnVals().front() );
 				ret->set_type( new PointerType( Type::Qualifiers(), ret->get_type() ) );
 				funcType->get_parameters().push_front( ret );
Index: src/GenPoly/InstantiateGeneric.cc
===================================================================
--- src/GenPoly/InstantiateGeneric.cc	(revision d130fe87f4cdf82b08c0879a57d7bae53c7644a2)
+++ src/GenPoly/InstantiateGeneric.cc	(revision ba54f7dba922f0df27eebfcc9c67f07969df7db4)
@@ -459,5 +459,5 @@
 			Declaration * member = *std::next( aggr->members.begin(), memberIndex );
 			assertf( member->name == memberExpr->member->name, "Instantiation has different member order than the generic type. %s / %s", toString( member ).c_str(), toString( memberExpr->member ).c_str() );
-			DeclarationWithType * field = safe_dynamic_cast< DeclarationWithType * >( member );
+			DeclarationWithType * field = strict_dynamic_cast< DeclarationWithType * >( member );
 			MemberExpr * ret = new MemberExpr( field, memberExpr->aggregate->clone() );
 			std::swap( ret->env, memberExpr->env );
Index: src/GenPoly/Lvalue.cc
===================================================================
--- src/GenPoly/Lvalue.cc	(revision d130fe87f4cdf82b08c0879a57d7bae53c7644a2)
+++ src/GenPoly/Lvalue.cc	(revision ba54f7dba922f0df27eebfcc9c67f07969df7db4)
@@ -14,5 +14,5 @@
 //
 
-#include <cassert>                       // for safe_dynamic_cast
+#include <cassert>                       // for strict_dynamic_cast
 #include <string>                        // for string
 
Index: src/InitTweak/FixInit.cc
===================================================================
--- src/InitTweak/FixInit.cc	(revision d130fe87f4cdf82b08c0879a57d7bae53c7644a2)
+++ src/InitTweak/FixInit.cc	(revision ba54f7dba922f0df27eebfcc9c67f07969df7db4)
@@ -17,5 +17,5 @@
 #include <stddef.h>                    // for NULL
 #include <algorithm>                   // for set_difference, copy_if
-#include <cassert>                     // for assert, safe_dynamic_cast
+#include <cassert>                     // for assert, strict_dynamic_cast
 #include <iostream>                    // for operator<<, ostream, basic_ost...
 #include <iterator>                    // for insert_iterator, back_inserter
@@ -424,5 +424,5 @@
 			// arrays are not copy constructed, so this should always be an ExprStmt
 			ImplicitCtorDtorStmt * stmt = genCtorDtor( fname, var, cpArg );
-			ExprStmt * exprStmt = safe_dynamic_cast< ExprStmt * >( stmt->get_callStmt() );
+			ExprStmt * exprStmt = strict_dynamic_cast< ExprStmt * >( stmt->get_callStmt() );
 			Expression * untyped = exprStmt->get_expr();
 
@@ -532,5 +532,5 @@
 				assert( ! body->get_kids().empty() );
 				// must be an ExprStmt, otherwise it wouldn't have a result
-				ExprStmt * last = safe_dynamic_cast< ExprStmt * >( body->get_kids().back() );
+				ExprStmt * last = strict_dynamic_cast< ExprStmt * >( body->get_kids().back() );
 				last->set_expr( makeCtorDtor( "?{}", ret, last->get_expr() ) );
 
@@ -566,5 +566,5 @@
 			CP_CTOR_PRINT( std::cerr << "FixCopyCtors: " << impCpCtorExpr << std::endl; )
 
-			impCpCtorExpr = safe_dynamic_cast< ImplicitCopyCtorExpr * >( Parent::mutate( impCpCtorExpr ) );
+			impCpCtorExpr = strict_dynamic_cast< ImplicitCopyCtorExpr * >( Parent::mutate( impCpCtorExpr ) );
 			std::list< ObjectDecl * > & tempDecls = impCpCtorExpr->get_tempDecls();
 			std::list< ObjectDecl * > & returnDecls = impCpCtorExpr->get_returnDecls();
@@ -627,5 +627,5 @@
 				stmt = stmt->acceptMutator( *this );
 			} // for
-			// stmtExpr = safe_dynamic_cast< StmtExpr * >( Parent::mutate( stmtExpr ) );
+			// stmtExpr = strict_dynamic_cast< StmtExpr * >( Parent::mutate( stmtExpr ) );
 			assert( stmtExpr->get_result() );
 			Type * result = stmtExpr->get_result();
@@ -791,5 +791,5 @@
 						}
 					} else {
-						ImplicitCtorDtorStmt * implicit = safe_dynamic_cast< ImplicitCtorDtorStmt * > ( ctor );
+						ImplicitCtorDtorStmt * implicit = strict_dynamic_cast< ImplicitCtorDtorStmt * > ( ctor );
 						ExprStmt * ctorStmt = dynamic_cast< ExprStmt * >( implicit->get_callStmt() );
 						ApplicationExpr * ctorCall = nullptr;
@@ -996,5 +996,5 @@
 				FunctionType * type = function->get_functionType();
 				assert( ! type->get_parameters().empty() );
-				thisParam = safe_dynamic_cast< ObjectDecl * >( type->get_parameters().front() );
+				thisParam = strict_dynamic_cast< ObjectDecl * >( type->get_parameters().front() );
 				Type * thisType = getPointerBase( thisParam->get_type() );
 				StructInstType * structType = dynamic_cast< StructInstType * >( thisType );
@@ -1166,5 +1166,5 @@
 
 		Expression* MutatingResolver::mutate( UntypedExpr *untypedExpr ) {
-			return safe_dynamic_cast< ApplicationExpr * >( ResolvExpr::findVoidExpression( untypedExpr, indexer ) );
+			return strict_dynamic_cast< ApplicationExpr * >( ResolvExpr::findVoidExpression( untypedExpr, indexer ) );
 		}
 
@@ -1179,5 +1179,5 @@
 
 			// xxx - this can be TupleAssignExpr now. Need to properly handle this case.
-			ApplicationExpr * callExpr = safe_dynamic_cast< ApplicationExpr * > ( ctorExpr->get_callExpr() );
+			ApplicationExpr * callExpr = strict_dynamic_cast< ApplicationExpr * > ( ctorExpr->get_callExpr() );
 			TypeSubstitution * env = ctorExpr->get_env();
 			ctorExpr->set_callExpr( nullptr );
Index: src/InitTweak/GenInit.cc
===================================================================
--- src/InitTweak/GenInit.cc	(revision d130fe87f4cdf82b08c0879a57d7bae53c7644a2)
+++ src/InitTweak/GenInit.cc	(revision ba54f7dba922f0df27eebfcc9c67f07969df7db4)
@@ -17,5 +17,5 @@
 #include <stddef.h>                // for NULL
 #include <algorithm>               // for any_of
-#include <cassert>                 // for assert, safe_dynamic_cast, assertf
+#include <cassert>                 // for assert, strict_dynamic_cast, assertf
 #include <iterator>                // for back_inserter, inserter, back_inse...
 #include <list>                    // for _List_iterator, list
@@ -255,5 +255,5 @@
 		SymTab::genImplicitCall( srcParam, new VariableExpr( objDecl ), fname, back_inserter( stmts ), objDecl );
 		assert( stmts.size() <= 1 );
-		return stmts.size() == 1 ? safe_dynamic_cast< ImplicitCtorDtorStmt * >( stmts.front() ) : nullptr;
+		return stmts.size() == 1 ? strict_dynamic_cast< ImplicitCtorDtorStmt * >( stmts.front() ) : nullptr;
 	}
 
Index: src/InitTweak/InitTweak.cc
===================================================================
--- src/InitTweak/InitTweak.cc	(revision d130fe87f4cdf82b08c0879a57d7bae53c7644a2)
+++ src/InitTweak/InitTweak.cc	(revision ba54f7dba922f0df27eebfcc9c67f07969df7db4)
@@ -1,5 +1,5 @@
 #include <stddef.h>                // for NULL
 #include <algorithm>               // for find, all_of
-#include <cassert>                 // for assertf, assert, safe_dynamic_cast
+#include <cassert>                 // for assertf, assert, strict_dynamic_cast
 #include <iostream>                // for ostream, cerr, endl
 #include <iterator>                // for back_insert_iterator, back_inserter
@@ -414,6 +414,6 @@
 			std::list< Statement * > & stmts = tupleExpr->get_stmtExpr()->get_statements()->get_kids();
 			assertf( ! stmts.empty(), "TupleAssignExpr somehow has no statements." );
-			ExprStmt * stmt = safe_dynamic_cast< ExprStmt * >( stmts.back() );
-			TupleExpr * tuple = safe_dynamic_cast< TupleExpr * >( stmt->get_expr() );
+			ExprStmt * stmt = strict_dynamic_cast< ExprStmt * >( stmts.back() );
+			TupleExpr * tuple = strict_dynamic_cast< TupleExpr * >( stmt->get_expr() );
 			assertf( ! tuple->get_exprs().empty(), "TupleAssignExpr somehow has empty tuple expr." );
 			return getCallArg( tuple->get_exprs().front(), pos );
Index: src/Makefile.in
===================================================================
--- src/Makefile.in	(revision d130fe87f4cdf82b08c0879a57d7bae53c7644a2)
+++ src/Makefile.in	(revision ba54f7dba922f0df27eebfcc9c67f07969df7db4)
@@ -159,4 +159,5 @@
 	CodeTools/driver_cfa_cpp-TrackLoc.$(OBJEXT) \
 	Concurrency/driver_cfa_cpp-Keywords.$(OBJEXT) \
+	Concurrency/driver_cfa_cpp-Waitfor.$(OBJEXT) \
 	Common/driver_cfa_cpp-SemanticError.$(OBJEXT) \
 	Common/driver_cfa_cpp-UniqueName.$(OBJEXT) \
@@ -490,6 +491,6 @@
 	CodeGen/OperatorTable.cc CodeTools/DeclStats.cc \
 	CodeTools/TrackLoc.cc Concurrency/Keywords.cc \
-	Common/SemanticError.cc Common/UniqueName.cc \
-	Common/DebugMalloc.cc Common/Assert.cc \
+	Concurrency/Waitfor.cc Common/SemanticError.cc \
+	Common/UniqueName.cc Common/DebugMalloc.cc Common/Assert.cc \
 	ControlStruct/LabelGenerator.cc ControlStruct/LabelFixer.cc \
 	ControlStruct/MLEMutator.cc ControlStruct/Mutate.cc \
@@ -663,4 +664,7 @@
 	@: > Concurrency/$(DEPDIR)/$(am__dirstamp)
 Concurrency/driver_cfa_cpp-Keywords.$(OBJEXT):  \
+	Concurrency/$(am__dirstamp) \
+	Concurrency/$(DEPDIR)/$(am__dirstamp)
+Concurrency/driver_cfa_cpp-Waitfor.$(OBJEXT):  \
 	Concurrency/$(am__dirstamp) \
 	Concurrency/$(DEPDIR)/$(am__dirstamp)
@@ -995,4 +999,5 @@
 @AMDEP_TRUE@@am__include@ @am__quote@Common/$(DEPDIR)/driver_cfa_cpp-UniqueName.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@Concurrency/$(DEPDIR)/driver_cfa_cpp-Keywords.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@Concurrency/$(DEPDIR)/driver_cfa_cpp-Waitfor.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@ControlStruct/$(DEPDIR)/driver_cfa_cpp-ExceptTranslate.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@ControlStruct/$(DEPDIR)/driver_cfa_cpp-ForExprMutator.Po@am__quote@
@@ -1263,4 +1268,18 @@
 @am__fastdepCXX_FALSE@	$(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o Concurrency/driver_cfa_cpp-Keywords.obj `if test -f 'Concurrency/Keywords.cc'; then $(CYGPATH_W) 'Concurrency/Keywords.cc'; else $(CYGPATH_W) '$(srcdir)/Concurrency/Keywords.cc'; fi`
 
+Concurrency/driver_cfa_cpp-Waitfor.o: Concurrency/Waitfor.cc
+@am__fastdepCXX_TRUE@	$(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT Concurrency/driver_cfa_cpp-Waitfor.o -MD -MP -MF Concurrency/$(DEPDIR)/driver_cfa_cpp-Waitfor.Tpo -c -o Concurrency/driver_cfa_cpp-Waitfor.o `test -f 'Concurrency/Waitfor.cc' || echo '$(srcdir)/'`Concurrency/Waitfor.cc
+@am__fastdepCXX_TRUE@	$(AM_V_at)$(am__mv) Concurrency/$(DEPDIR)/driver_cfa_cpp-Waitfor.Tpo Concurrency/$(DEPDIR)/driver_cfa_cpp-Waitfor.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(AM_V_CXX)source='Concurrency/Waitfor.cc' object='Concurrency/driver_cfa_cpp-Waitfor.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o Concurrency/driver_cfa_cpp-Waitfor.o `test -f 'Concurrency/Waitfor.cc' || echo '$(srcdir)/'`Concurrency/Waitfor.cc
+
+Concurrency/driver_cfa_cpp-Waitfor.obj: Concurrency/Waitfor.cc
+@am__fastdepCXX_TRUE@	$(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT Concurrency/driver_cfa_cpp-Waitfor.obj -MD -MP -MF Concurrency/$(DEPDIR)/driver_cfa_cpp-Waitfor.Tpo -c -o Concurrency/driver_cfa_cpp-Waitfor.obj `if test -f 'Concurrency/Waitfor.cc'; then $(CYGPATH_W) 'Concurrency/Waitfor.cc'; else $(CYGPATH_W) '$(srcdir)/Concurrency/Waitfor.cc'; fi`
+@am__fastdepCXX_TRUE@	$(AM_V_at)$(am__mv) Concurrency/$(DEPDIR)/driver_cfa_cpp-Waitfor.Tpo Concurrency/$(DEPDIR)/driver_cfa_cpp-Waitfor.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	$(AM_V_CXX)source='Concurrency/Waitfor.cc' object='Concurrency/driver_cfa_cpp-Waitfor.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@	$(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o Concurrency/driver_cfa_cpp-Waitfor.obj `if test -f 'Concurrency/Waitfor.cc'; then $(CYGPATH_W) 'Concurrency/Waitfor.cc'; else $(CYGPATH_W) '$(srcdir)/Concurrency/Waitfor.cc'; fi`
+
 Common/driver_cfa_cpp-SemanticError.o: Common/SemanticError.cc
 @am__fastdepCXX_TRUE@	$(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT Common/driver_cfa_cpp-SemanticError.o -MD -MP -MF Common/$(DEPDIR)/driver_cfa_cpp-SemanticError.Tpo -c -o Common/driver_cfa_cpp-SemanticError.o `test -f 'Common/SemanticError.cc' || echo '$(srcdir)/'`Common/SemanticError.cc
Index: src/Parser/DeclarationNode.cc
===================================================================
--- src/Parser/DeclarationNode.cc	(revision d130fe87f4cdf82b08c0879a57d7bae53c7644a2)
+++ src/Parser/DeclarationNode.cc	(revision ba54f7dba922f0df27eebfcc9c67f07969df7db4)
@@ -14,5 +14,5 @@
 //
 
-#include <cassert>                 // for assert, assertf, safe_dynamic_cast
+#include <cassert>                 // for assert, assertf, strict_dynamic_cast
 #include <iterator>                // for back_insert_iterator
 #include <list>                    // for list
@@ -1027,5 +1027,5 @@
 
 	if ( asmStmt ) {
-		return new AsmDecl( safe_dynamic_cast<AsmStmt *>( asmStmt->build() ) );
+		return new AsmDecl( strict_dynamic_cast<AsmStmt *>( asmStmt->build() ) );
 	} // if
 
Index: src/Parser/StatementNode.cc
===================================================================
--- src/Parser/StatementNode.cc	(revision d130fe87f4cdf82b08c0879a57d7bae53c7644a2)
+++ src/Parser/StatementNode.cc	(revision ba54f7dba922f0df27eebfcc9c67f07969df7db4)
@@ -14,5 +14,5 @@
 //
 
-#include <cassert>                 // for assert, safe_dynamic_cast, assertf
+#include <cassert>                 // for assert, strict_dynamic_cast, assertf
 #include <list>                    // for list
 #include <memory>                  // for unique_ptr
@@ -57,5 +57,5 @@
 	// find end of list and maintain previous pointer
 	for ( StatementNode * curr = prev; curr != nullptr; curr = (StatementNode *)curr->get_next() ) {
-		StatementNode *node = safe_dynamic_cast< StatementNode * >(curr);
+		StatementNode *node = strict_dynamic_cast< StatementNode * >(curr);
 		assert( dynamic_cast< CaseStmt * >(node->stmt.get()) );
 		prev = curr;
@@ -106,6 +106,6 @@
 		for ( Statement * stmt : init ) {
 			// build the && of all of the declared variables compared against 0
-			DeclStmt * declStmt = safe_dynamic_cast< DeclStmt * >( stmt );
-			DeclarationWithType * dwt = safe_dynamic_cast< DeclarationWithType * >( declStmt->decl );
+			DeclStmt * declStmt = strict_dynamic_cast< DeclStmt * >( stmt );
+			DeclarationWithType * dwt = strict_dynamic_cast< DeclarationWithType * >( declStmt->decl );
 			Expression * nze = notZeroExpr( new VariableExpr( dwt ) );
 			cond = cond ? new LogicalExpr( cond, nze, true ) : nze;
@@ -202,5 +202,5 @@
 	std::list< CatchStmt * > branches;
 	buildMoveList< CatchStmt, StatementNode >( catch_stmt, branches );
-	CompoundStmt *tryBlock = safe_dynamic_cast< CompoundStmt * >(maybeMoveBuild< Statement >(try_stmt));
+	CompoundStmt *tryBlock = strict_dynamic_cast< CompoundStmt * >(maybeMoveBuild< Statement >(try_stmt));
 	FinallyStmt *finallyBlock = dynamic_cast< FinallyStmt * >(maybeMoveBuild< Statement >(finally_stmt) );
 	return new TryStmt( noLabels, tryBlock, branches, finallyBlock );
Index: src/ResolvExpr/AlternativeFinder.cc
===================================================================
--- src/ResolvExpr/AlternativeFinder.cc	(revision d130fe87f4cdf82b08c0879a57d7bae53c7644a2)
+++ src/ResolvExpr/AlternativeFinder.cc	(revision ba54f7dba922f0df27eebfcc9c67f07969df7db4)
@@ -15,5 +15,5 @@
 
 #include <algorithm>               // for copy
-#include <cassert>                 // for safe_dynamic_cast, assert, assertf
+#include <cassert>                 // for strict_dynamic_cast, assert, assertf
 #include <iostream>                // for operator<<, cerr, ostream, endl
 #include <iterator>                // for back_insert_iterator, back_inserter
@@ -336,7 +336,7 @@
 
 	Cost computeApplicationConversionCost( Alternative &alt, const SymTab::Indexer &indexer ) {
-		ApplicationExpr *appExpr = safe_dynamic_cast< ApplicationExpr* >( alt.expr );
-		PointerType *pointer = safe_dynamic_cast< PointerType* >( appExpr->get_function()->get_result() );
-		FunctionType *function = safe_dynamic_cast< FunctionType* >( pointer->get_base() );
+		ApplicationExpr *appExpr = strict_dynamic_cast< ApplicationExpr* >( alt.expr );
+		PointerType *pointer = strict_dynamic_cast< PointerType* >( appExpr->get_function()->get_result() );
+		FunctionType *function = strict_dynamic_cast< FunctionType* >( pointer->get_base() );
 
 		Cost convCost = Cost::zero;
@@ -494,5 +494,5 @@
 			Cost cost = Cost::zero;
 			std::list< Expression * > newExprs;
-			ObjectDecl * obj = safe_dynamic_cast< ObjectDecl * >( formal );
+			ObjectDecl * obj = strict_dynamic_cast< ObjectDecl * >( formal );
 			if ( ! instantiateArgument( obj->get_type(), obj->get_init(), actualExpr, actualEnd, openVars, resultEnv, resultNeed, resultHave, indexer, cost, back_inserter( newExprs ) ) ) {
 				deleteAll( newExprs );
@@ -787,7 +787,7 @@
 
 			PRINT(
-				ApplicationExpr *appExpr = safe_dynamic_cast< ApplicationExpr* >( withFunc->expr );
-				PointerType *pointer = safe_dynamic_cast< PointerType* >( appExpr->get_function()->get_result() );
-				FunctionType *function = safe_dynamic_cast< FunctionType* >( pointer->get_base() );
+				ApplicationExpr *appExpr = strict_dynamic_cast< ApplicationExpr* >( withFunc->expr );
+				PointerType *pointer = strict_dynamic_cast< PointerType* >( appExpr->get_function()->get_result() );
+				FunctionType *function = strict_dynamic_cast< FunctionType* >( pointer->get_base() );
 				std::cerr << "Case +++++++++++++ " << appExpr->get_function() << std::endl;
 				std::cerr << "formals are:" << std::endl;
Index: src/ResolvExpr/CastCost.cc
===================================================================
--- src/ResolvExpr/CastCost.cc	(revision d130fe87f4cdf82b08c0879a57d7bae53c7644a2)
+++ src/ResolvExpr/CastCost.cc	(revision ba54f7dba922f0df27eebfcc9c67f07969df7db4)
@@ -46,5 +46,5 @@
 			} else if ( ( namedType = indexer.lookupType( destAsTypeInst->get_name() ) ) ) {
 				// all typedefs should be gone by this point
-				TypeDecl *type = safe_dynamic_cast< TypeDecl* >( namedType );
+				TypeDecl *type = strict_dynamic_cast< TypeDecl* >( namedType );
 				if ( type->get_base() ) {
 					return castCost( src, type->get_base(), indexer, env ) + Cost::safe;
Index: src/ResolvExpr/CommonType.cc
===================================================================
--- src/ResolvExpr/CommonType.cc	(revision d130fe87f4cdf82b08c0879a57d7bae53c7644a2)
+++ src/ResolvExpr/CommonType.cc	(revision ba54f7dba922f0df27eebfcc9c67f07969df7db4)
@@ -14,5 +14,5 @@
 //
 
-#include <cassert>                       // for safe_dynamic_cast
+#include <cassert>                       // for strict_dynamic_cast
 #include <map>                           // for _Rb_tree_const_iterator
 #include <utility>                       // for pair
@@ -100,7 +100,7 @@
 			// special case where one type has a reference depth of 1 larger than the other
 			if ( diff > 0 ) {
-				return handleReference( safe_dynamic_cast<ReferenceType *>( type1 ), type2, widenFirst, widenSecond, indexer, env, openVars );
+				return handleReference( strict_dynamic_cast<ReferenceType *>( type1 ), type2, widenFirst, widenSecond, indexer, env, openVars );
 			} else if ( diff < 0 ) {
-				return handleReference( safe_dynamic_cast<ReferenceType *>( type2 ), type1, widenSecond, widenFirst, indexer, env, openVars );
+				return handleReference( strict_dynamic_cast<ReferenceType *>( type2 ), type1, widenSecond, widenFirst, indexer, env, openVars );
 			}
 			// otherwise, both are reference types of the same depth and this is handled by the CommonType visitor.
@@ -114,5 +114,5 @@
 				if ( TypeInstType *inst = dynamic_cast< TypeInstType* >( type2 ) ) {
 					if ( NamedTypeDecl *nt = indexer.lookupType( inst->get_name() ) ) {
-						TypeDecl *type = safe_dynamic_cast< TypeDecl* >( nt );
+						TypeDecl *type = strict_dynamic_cast< TypeDecl* >( nt );
 						if ( type->get_base() ) {
 							Type::Qualifiers tq1 = type1->get_qualifiers(), tq2 = type2->get_qualifiers();
@@ -301,5 +301,5 @@
 			NamedTypeDecl *nt = indexer.lookupType( inst->get_name() );
 			if ( nt ) {
-				TypeDecl *type = safe_dynamic_cast< TypeDecl* >( nt );
+				TypeDecl *type = strict_dynamic_cast< TypeDecl* >( nt );
 				if ( type->get_base() ) {
 					Type::Qualifiers tq1 = inst->get_qualifiers(), tq2 = type2->get_qualifiers();
Index: src/ResolvExpr/ConversionCost.cc
===================================================================
--- src/ResolvExpr/ConversionCost.cc	(revision d130fe87f4cdf82b08c0879a57d7bae53c7644a2)
+++ src/ResolvExpr/ConversionCost.cc	(revision ba54f7dba922f0df27eebfcc9c67f07969df7db4)
@@ -95,10 +95,10 @@
 		if ( diff > 0 ) {
 			// TODO: document this
-			Cost cost = convertToReferenceCost( safe_dynamic_cast< ReferenceType * >( src )->get_base(), dest, diff-1, indexer, env, func );
+			Cost cost = convertToReferenceCost( strict_dynamic_cast< ReferenceType * >( src )->get_base(), dest, diff-1, indexer, env, func );
 			cost.incReference();
 			return cost;
 		} else if ( diff < -1 ) {
 			// TODO: document this
-			Cost cost = convertToReferenceCost( src, safe_dynamic_cast< ReferenceType * >( dest )->get_base(), diff+1, indexer, env, func );
+			Cost cost = convertToReferenceCost( src, strict_dynamic_cast< ReferenceType * >( dest )->get_base(), diff+1, indexer, env, func );
 			cost.incReference();
 			return cost;
Index: src/ResolvExpr/CurrentObject.cc
===================================================================
--- src/ResolvExpr/CurrentObject.cc	(revision d130fe87f4cdf82b08c0879a57d7bae53c7644a2)
+++ src/ResolvExpr/CurrentObject.cc	(revision ba54f7dba922f0df27eebfcc9c67f07969df7db4)
@@ -286,5 +286,5 @@
 				for ( InitAlternative & alt : ret ) {
 					PRINT( std::cerr << "iterating and adding designators" << std::endl; )
-					alt.designation->get_designators().push_front( new VariableExpr( safe_dynamic_cast< ObjectDecl * >( *curMember ) ) );
+					alt.designation->get_designators().push_front( new VariableExpr( strict_dynamic_cast< ObjectDecl * >( *curMember ) ) );
 					// need to substitute for generic types, so that casts are to concrete types
 					PRINT( std::cerr << "  type is: " << alt.type; )
@@ -346,5 +346,5 @@
 				for ( InitAlternative & alt : ret ) {
 					PRINT( std::cerr << "iterating and adding designators" << std::endl; )
-					alt.designation->get_designators().push_front( new VariableExpr( safe_dynamic_cast< ObjectDecl * >( *curMember ) ) );
+					alt.designation->get_designators().push_front( new VariableExpr( strict_dynamic_cast< ObjectDecl * >( *curMember ) ) );
 				}
 			}
Index: src/ResolvExpr/Resolver.cc
===================================================================
--- src/ResolvExpr/Resolver.cc	(revision d130fe87f4cdf82b08c0879a57d7bae53c7644a2)
+++ src/ResolvExpr/Resolver.cc	(revision ba54f7dba922f0df27eebfcc9c67f07969df7db4)
@@ -15,5 +15,5 @@
 
 #include <stddef.h>                      // for NULL
-#include <cassert>                       // for safe_dynamic_cast, assert
+#include <cassert>                       // for strict_dynamic_cast, assert
 #include <memory>                        // for allocator, allocator_traits<...
 #include <tuple>                         // for get
@@ -342,5 +342,5 @@
 			CastExpr * castExpr = new CastExpr( caseStmt->get_condition(), initAlts.front().type->clone() );
 			Expression * newExpr = findSingleExpression( castExpr, *this );
-			castExpr = safe_dynamic_cast< CastExpr * >( newExpr );
+			castExpr = strict_dynamic_cast< CastExpr * >( newExpr );
 			caseStmt->set_condition( castExpr->get_arg() );
 			castExpr->set_arg( nullptr );
@@ -398,5 +398,5 @@
 		Parent::enterScope();
 		Visitor::visit( catchStmt );
-		
+
 		if ( catchStmt->get_cond() ) {
 			Expression * wrapped = new CastExpr(
@@ -423,5 +423,5 @@
 		UntypedInitExpr * untyped = new UntypedInitExpr( singleInit->get_value(), currentObject.getOptions() );
 		Expression * newExpr = findSingleExpression( untyped, *this );
-		InitExpr * initExpr = safe_dynamic_cast< InitExpr * >( newExpr );
+		InitExpr * initExpr = strict_dynamic_cast< InitExpr * >( newExpr );
 
 		// move cursor to the object that is actually initialized
@@ -445,5 +445,5 @@
 					if ( isCharType( pt->get_base() ) ) {
 						// strip cast if we're initializing a char[] with a char *, e.g.  char x[] = "hello";
-						CastExpr *ce = safe_dynamic_cast< CastExpr * >( newExpr );
+						CastExpr *ce = strict_dynamic_cast< CastExpr * >( newExpr );
 						newExpr = ce->get_arg();
 						ce->set_arg( nullptr );
Index: src/SymTab/Autogen.cc
===================================================================
--- src/SymTab/Autogen.cc	(revision d130fe87f4cdf82b08c0879a57d7bae53c7644a2)
+++ src/SymTab/Autogen.cc	(revision ba54f7dba922f0df27eebfcc9c67f07969df7db4)
@@ -18,5 +18,5 @@
 #include <cstddef>                 // for NULL
 #include <algorithm>               // for count_if
-#include <cassert>                 // for safe_dynamic_cast, assert, assertf
+#include <cassert>                 // for strict_dynamic_cast, assert, assertf
 #include <iterator>                // for back_insert_iterator, back_inserter
 #include <list>                    // for list, _List_iterator, list<>::iter...
@@ -248,6 +248,6 @@
 		// parameters) are using in the variable exprs
 		assert( ftype->get_parameters().size() == 2 );
-		ObjectDecl * dstParam = safe_dynamic_cast< ObjectDecl * >( ftype->get_parameters().front() );
-		ObjectDecl * srcParam = safe_dynamic_cast< ObjectDecl * >( ftype->get_parameters().back() );
+		ObjectDecl * dstParam = strict_dynamic_cast< ObjectDecl * >( ftype->get_parameters().front() );
+		ObjectDecl * srcParam = strict_dynamic_cast< ObjectDecl * >( ftype->get_parameters().back() );
 
 		VariableExpr * assignVarExpr = new VariableExpr( assignDecl );
@@ -305,5 +305,5 @@
 
 		// assign to destination
-		Expression *dstselect = new MemberExpr( field, new CastExpr( new VariableExpr( dstParam ), safe_dynamic_cast< ReferenceType* >( dstParam->get_type() )->get_base()->clone() ) );
+		Expression *dstselect = new MemberExpr( field, new CastExpr( new VariableExpr( dstParam ), strict_dynamic_cast< ReferenceType* >( dstParam->get_type() )->get_base()->clone() ) );
 		genImplicitCall( srcParam, dstselect, func->get_name(), back_inserter( func->get_statements()->get_kids() ), field, forward );
 	}
@@ -442,5 +442,5 @@
 				FunctionType * assignType = dcl->get_functionType();
 				assert( assignType->get_parameters().size() == 2 );
-				ObjectDecl * srcParam = safe_dynamic_cast< ObjectDecl * >( assignType->get_parameters().back() );
+				ObjectDecl * srcParam = strict_dynamic_cast< ObjectDecl * >( assignType->get_parameters().back() );
 				dcl->get_statements()->get_kids().push_back( new ReturnStmt( noLabels, new VariableExpr( srcParam ) ) );
 			}
@@ -493,6 +493,6 @@
 		FunctionType * ftype = funcDecl->get_functionType();
 		assert( ftype->get_parameters().size() == 2 );
-		ObjectDecl * dstParam = safe_dynamic_cast< ObjectDecl * >( ftype->get_parameters().front() );
-		ObjectDecl * srcParam = safe_dynamic_cast< ObjectDecl * >( ftype->get_parameters().back() );
+		ObjectDecl * dstParam = strict_dynamic_cast< ObjectDecl * >( ftype->get_parameters().front() );
+		ObjectDecl * srcParam = strict_dynamic_cast< ObjectDecl * >( ftype->get_parameters().back() );
 
 		makeUnionFieldsAssignment( srcParam, dstParam, back_inserter( funcDecl->get_statements()->get_kids() ) );
@@ -657,5 +657,5 @@
 				FunctionType * assignType = dcl->type;
 				assert( assignType->parameters.size() == 2 );
-				ObjectDecl * srcParam = safe_dynamic_cast< ObjectDecl * >( assignType->parameters.back() );
+				ObjectDecl * srcParam = strict_dynamic_cast< ObjectDecl * >( assignType->parameters.back() );
 				dcl->statements->kids.push_back( new ReturnStmt( noLabels, new VariableExpr( srcParam ) ) );
 			}
@@ -735,5 +735,5 @@
 
 	Type * AutogenTupleRoutines::mutate( TupleType * tupleType ) {
-		tupleType = safe_dynamic_cast< TupleType * >( Parent::mutate( tupleType ) );
+		tupleType = strict_dynamic_cast< TupleType * >( Parent::mutate( tupleType ) );
 		std::string mangleName = SymTab::Mangler::mangleType( tupleType );
 		if ( seenTuples.find( mangleName ) != seenTuples.end() ) return tupleType;
@@ -803,5 +803,5 @@
 	CompoundStmt * AutogenTupleRoutines::mutate( CompoundStmt *compoundStmt ) {
 		seenTuples.beginScope();
-		compoundStmt = safe_dynamic_cast< CompoundStmt * >( Parent::mutate( compoundStmt ) );
+		compoundStmt = strict_dynamic_cast< CompoundStmt * >( Parent::mutate( compoundStmt ) );
 		seenTuples.endScope();
 		return compoundStmt;
Index: src/SymTab/Indexer.cc
===================================================================
--- src/SymTab/Indexer.cc	(revision d130fe87f4cdf82b08c0879a57d7bae53c7644a2)
+++ src/SymTab/Indexer.cc	(revision ba54f7dba922f0df27eebfcc9c67f07969df7db4)
@@ -16,5 +16,5 @@
 #include "Indexer.h"
 
-#include <cassert>                 // for assert, safe_dynamic_cast
+#include <cassert>                 // for assert, strict_dynamic_cast
 #include <iostream>                // for operator<<, basic_ostream, ostream
 #include <string>                  // for string, operator<<, operator!=
Index: src/SymTab/Validate.cc
===================================================================
--- src/SymTab/Validate.cc	(revision d130fe87f4cdf82b08c0879a57d7bae53c7644a2)
+++ src/SymTab/Validate.cc	(revision ba54f7dba922f0df27eebfcc9c67f07969df7db4)
@@ -493,5 +493,5 @@
 		std::list< DeclarationWithType * > asserts;
 		for ( Declaration * decl : inst->baseTrait->members ) {
-			asserts.push_back( safe_dynamic_cast<DeclarationWithType *>( decl->clone() ) );
+			asserts.push_back( strict_dynamic_cast<DeclarationWithType *>( decl->clone() ) );
 		}
 		// substitute trait decl parameters for instance parameters
@@ -537,5 +537,5 @@
 		// need to carry over the 'sized' status of each decl in the instance
 		for ( auto p : group_iterate( traitDecl->get_parameters(), traitInst->get_parameters() ) ) {
-			TypeExpr * expr = safe_dynamic_cast< TypeExpr * >( std::get<1>(p) );
+			TypeExpr * expr = strict_dynamic_cast< TypeExpr * >( std::get<1>(p) );
 			if ( TypeInstType * inst = dynamic_cast< TypeInstType * >( expr->get_type() ) ) {
 				TypeDecl * formalDecl = std::get<0>(p);
@@ -897,5 +897,5 @@
 			for ( size_t i = 0; paramIter != params->end(); ++paramIter, ++i ) {
 				if ( i < args.size() ) {
-					TypeExpr * expr = safe_dynamic_cast< TypeExpr * >( *std::next( args.begin(), i ) );
+					TypeExpr * expr = strict_dynamic_cast< TypeExpr * >( *std::next( args.begin(), i ) );
 					sub.add( (*paramIter)->get_name(), expr->get_type()->clone() );
 				} else if ( i == args.size() ) {
@@ -967,5 +967,5 @@
 		if ( retVals.size() > 1 ) {
 			// generate a single return parameter which is the tuple of all of the return values
-			TupleType * tupleType = safe_dynamic_cast< TupleType * >( ResolvExpr::extractResultType( ftype ) );
+			TupleType * tupleType = strict_dynamic_cast< TupleType * >( ResolvExpr::extractResultType( ftype ) );
 			// ensure return value is not destructed by explicitly creating an empty ListInit node wherein maybeConstruct is false.
 			ObjectDecl * newRet = new ObjectDecl( "", Type::StorageClasses(), LinkageSpec::Cforall, 0, tupleType, new ListInit( std::list<Initializer*>(), noDesignators, false ) );
Index: src/SynTree/AddressExpr.cc
===================================================================
--- src/SynTree/AddressExpr.cc	(revision d130fe87f4cdf82b08c0879a57d7bae53c7644a2)
+++ src/SynTree/AddressExpr.cc	(revision ba54f7dba922f0df27eebfcc9c67f07969df7db4)
@@ -47,5 +47,5 @@
 		} else {
 			// taking address of non-lvalue -- must be a reference, loses one layer of reference
-			ReferenceType * refType = safe_dynamic_cast< ReferenceType * >( arg->get_result() );
+			ReferenceType * refType = strict_dynamic_cast< ReferenceType * >( arg->get_result() );
 			set_result( addrType( refType->get_base() ) );
 		}
Index: src/SynTree/ApplicationExpr.cc
===================================================================
--- src/SynTree/ApplicationExpr.cc	(revision d130fe87f4cdf82b08c0879a57d7bae53c7644a2)
+++ src/SynTree/ApplicationExpr.cc	(revision ba54f7dba922f0df27eebfcc9c67f07969df7db4)
@@ -14,5 +14,5 @@
 //
 
-#include <cassert>               // for safe_dynamic_cast, assert
+#include <cassert>               // for strict_dynamic_cast, assert
 #include <list>                  // for list
 #include <map>                   // for _Rb_tree_const_iterator, map, map<>:...
@@ -50,6 +50,6 @@
 
 ApplicationExpr::ApplicationExpr( Expression *funcExpr, const std::list<Expression *> & args ) : function( funcExpr ), args( args ) {
-	PointerType *pointer = safe_dynamic_cast< PointerType* >( funcExpr->get_result() );
-	FunctionType *function = safe_dynamic_cast< FunctionType* >( pointer->get_base() );
+	PointerType *pointer = strict_dynamic_cast< PointerType* >( funcExpr->get_result() );
+	FunctionType *function = strict_dynamic_cast< FunctionType* >( pointer->get_base() );
 
 	set_result( ResolvExpr::extractResultType( function ) );
Index: src/SynTree/CompoundStmt.cc
===================================================================
--- src/SynTree/CompoundStmt.cc	(revision d130fe87f4cdf82b08c0879a57d7bae53c7644a2)
+++ src/SynTree/CompoundStmt.cc	(revision ba54f7dba922f0df27eebfcc9c67f07969df7db4)
@@ -14,5 +14,5 @@
 //
 
-#include <cassert>                    // for assert, safe_dynamic_cast
+#include <cassert>                    // for assert, strict_dynamic_cast
 #include <list>                       // for list, _List_const_iterator, lis...
 #include <ostream>                    // for operator<<, ostream, basic_ostream
@@ -52,7 +52,7 @@
 		Statement * origStmt = *origit++;
 		if ( DeclStmt * declStmt = dynamic_cast< DeclStmt * >( s ) ) {
-			DeclStmt * origDeclStmt = safe_dynamic_cast< DeclStmt * >( origStmt );
+			DeclStmt * origDeclStmt = strict_dynamic_cast< DeclStmt * >( origStmt );
 			if ( DeclarationWithType * dwt = dynamic_cast< DeclarationWithType * > ( declStmt->get_decl() ) ) {
-				DeclarationWithType * origdwt = safe_dynamic_cast< DeclarationWithType * > ( origDeclStmt->get_decl() );
+				DeclarationWithType * origdwt = strict_dynamic_cast< DeclarationWithType * > ( origDeclStmt->get_decl() );
 				assert( dwt->get_name() == origdwt->get_name() );
 				declMap[ origdwt ] = dwt;
Index: src/SynTree/Constant.cc
===================================================================
--- src/SynTree/Constant.cc	(revision d130fe87f4cdf82b08c0879a57d7bae53c7644a2)
+++ src/SynTree/Constant.cc	(revision ba54f7dba922f0df27eebfcc9c67f07969df7db4)
@@ -14,5 +14,5 @@
 //
 
-#include <cassert>   // for safe_dynamic_cast, assertf
+#include <cassert>   // for strict_dynamic_cast, assertf
 #include <iostream>  // for operator<<, ostream, basic_ostream
 #include <string>    // for to_string, string, char_traits, operator<<
@@ -58,10 +58,10 @@
 
 unsigned long long Constant::get_ival() const {
-	assertf( safe_dynamic_cast<BasicType*>(type)->isInteger(), "Attempt to retrieve ival from non-integer constant." );
+	assertf( strict_dynamic_cast<BasicType*>(type)->isInteger(), "Attempt to retrieve ival from non-integer constant." );
 	return val.ival;
 }
 
 double Constant::get_dval() const {
-	assertf( ! safe_dynamic_cast<BasicType*>(type)->isInteger(), "Attempt to retrieve dval from integer constant." );
+	assertf( ! strict_dynamic_cast<BasicType*>(type)->isInteger(), "Attempt to retrieve dval from integer constant." );
 	return val.dval;
 }
Index: src/SynTree/Declaration.h
===================================================================
--- src/SynTree/Declaration.h	(revision d130fe87f4cdf82b08c0879a57d7bae53c7644a2)
+++ src/SynTree/Declaration.h	(revision ba54f7dba922f0df27eebfcc9c67f07969df7db4)
@@ -157,6 +157,6 @@
 	virtual ~FunctionDecl();
 
-	Type * get_type() const;
-	virtual void set_type(Type *);
+	Type * get_type() const { return type; }
+	virtual void set_type(Type * t) { type = strict_dynamic_cast< FunctionType* >( t ); }
 
 	FunctionType * get_functionType() const { return type; }
Index: src/SynTree/Expression.h
===================================================================
--- src/SynTree/Expression.h	(revision d130fe87f4cdf82b08c0879a57d7bae53c7644a2)
+++ src/SynTree/Expression.h	(revision ba54f7dba922f0df27eebfcc9c67f07969df7db4)
@@ -86,4 +86,6 @@
   public:
 	Expression * function;
+	std::list<Expression *> args;
+	InferredParams inferParams;
 
 	ApplicationExpr( Expression * function, const std::list<Expression *> & args = std::list< Expression * >() );
@@ -100,8 +102,4 @@
 	virtual Expression * acceptMutator( Mutator & m ) { return m.mutate( this ); }
 	virtual void print( std::ostream & os, int indent = 0 ) const;
-
-  private:
-	std::list<Expression *> args;
-	InferredParams inferParams;
 };
 
Index: src/SynTree/FunctionDecl.cc
===================================================================
--- src/SynTree/FunctionDecl.cc	(revision d130fe87f4cdf82b08c0879a57d7bae53c7644a2)
+++ src/SynTree/FunctionDecl.cc	(revision ba54f7dba922f0df27eebfcc9c67f07969df7db4)
@@ -44,13 +44,4 @@
 	delete type;
 	delete statements;
-}
-
-Type * FunctionDecl::get_type() const {
-	return type;
-}
-
-void FunctionDecl::set_type( Type *t ) {
-	type = dynamic_cast< FunctionType* >( t );
-	assert( type );
 }
 
Index: src/SynTree/Statement.h
===================================================================
--- src/SynTree/Statement.h	(revision d130fe87f4cdf82b08c0879a57d7bae53c7644a2)
+++ src/SynTree/Statement.h	(revision ba54f7dba922f0df27eebfcc9c67f07969df7db4)
@@ -155,4 +155,5 @@
   public:
 	Expression * condition;
+	std::list<Statement *> statements;
 
 	SwitchStmt( std::list<Label> labels, Expression *condition, std::list<Statement *> &statements );
@@ -170,6 +171,5 @@
 	virtual SwitchStmt *clone() const { return new SwitchStmt( *this ); }
 	virtual void print( std::ostream &os, int indent = 0 ) const;
-  private:
-	std::list<Statement *> statements;
+
 };
 
@@ -327,7 +327,7 @@
 class TryStmt : public Statement {
   public:
-	CompoundStmt *block;
+	CompoundStmt * block;
 	std::list<CatchStmt *> handlers;
-	FinallyStmt *finallyBlock;
+	FinallyStmt * finallyBlock;
 
 	TryStmt( std::list<Label> labels, CompoundStmt *tryBlock, std::list<CatchStmt *> &handlers, FinallyStmt *finallyBlock = 0 );
Index: src/SynTree/TupleExpr.cc
===================================================================
--- src/SynTree/TupleExpr.cc	(revision d130fe87f4cdf82b08c0879a57d7bae53c7644a2)
+++ src/SynTree/TupleExpr.cc	(revision ba54f7dba922f0df27eebfcc9c67f07969df7db4)
@@ -14,5 +14,5 @@
 //
 
-#include <cassert>              // for assert, safe_dynamic_cast, assertf
+#include <cassert>              // for assert, strict_dynamic_cast, assertf
 #include <iterator>             // for next
 #include <list>                 // for list, _List_iterator
@@ -64,5 +64,5 @@
 
 TupleIndexExpr::TupleIndexExpr( Expression * tuple, unsigned int index ) : tuple( tuple ), index( index )  {
-	TupleType * type = safe_dynamic_cast< TupleType * >( tuple->get_result() );
+	TupleType * type = strict_dynamic_cast< TupleType * >( tuple->get_result() );
 	assertf( type->size() > index, "TupleIndexExpr index out of bounds: tuple size %d, requested index %d in expr %s", type->size(), index, toString( tuple ).c_str() );
 	set_result( (*std::next( type->get_types().begin(), index ))->clone() );
Index: src/SynTree/Visitor.h
===================================================================
--- src/SynTree/Visitor.h	(revision d130fe87f4cdf82b08c0879a57d7bae53c7644a2)
+++ src/SynTree/Visitor.h	(revision ba54f7dba922f0df27eebfcc9c67f07969df7db4)
@@ -148,31 +148,4 @@
 }
 
-template< typename Container, typename VisitorType >
-void acceptAllFold( Container &container, VisitorType &visitor, VisitorType &around ) {
-	SemanticError errors;
-	for ( typename Container::iterator i = container.begin(); i != container.end(); ++i ) {
-		try {
-			if ( *i ) {
-				VisitorType *v = new VisitorType;
-				(*i)->accept( *v );
-
-				typename Container::iterator nxt = i; nxt++; // forward_iterator
-				if ( nxt == container.end() )
-					visitor += *v;
-				else
-					visitor += *v + around;
-
-				delete v;
-			} // if
-		} catch( SemanticError &e ) {
-			e.set_location( (*i)->location );
-			errors.append( e );
-		} // try
-	} // for
-	if ( ! errors.isEmpty() ) {
-		throw errors;
-	} // if
-}
-
 // Local Variables: //
 // tab-width: 4 //
Index: src/Tuples/TupleExpansion.cc
===================================================================
--- src/Tuples/TupleExpansion.cc	(revision d130fe87f4cdf82b08c0879a57d7bae53c7644a2)
+++ src/Tuples/TupleExpansion.cc	(revision ba54f7dba922f0df27eebfcc9c67f07969df7db4)
@@ -168,5 +168,5 @@
 				// steal the already generated assignment to var from the unqExpr - this has been generated by FixInit
 				Expression * expr = unqExpr->get_expr();
-				CommaExpr * commaExpr = safe_dynamic_cast< CommaExpr * >( expr );
+				CommaExpr * commaExpr = strict_dynamic_cast< CommaExpr * >( expr );
 				assignUnq = commaExpr->get_arg1();
 				commaExpr->set_arg1( nullptr );
@@ -237,9 +237,9 @@
 		delete tupleExpr;
 
-		StructInstType * type = safe_dynamic_cast< StructInstType * >( tuple->get_result() );
+		StructInstType * type = strict_dynamic_cast< StructInstType * >( tuple->get_result() );
 		StructDecl * structDecl = type->get_baseStruct();
 		assert( structDecl->get_members().size() > idx );
 		Declaration * member = *std::next(structDecl->get_members().begin(), idx);
-		MemberExpr * memExpr = new MemberExpr( safe_dynamic_cast< DeclarationWithType * >( member ), tuple );
+		MemberExpr * memExpr = new MemberExpr( strict_dynamic_cast< DeclarationWithType * >( member ), tuple );
 		memExpr->set_env( env );
 		return memExpr;
Index: src/include/cassert
===================================================================
--- src/include/cassert	(revision d130fe87f4cdf82b08c0879a57d7bae53c7644a2)
+++ src/include/cassert	(revision ba54f7dba922f0df27eebfcc9c67f07969df7db4)
@@ -31,7 +31,7 @@
 	__ASSERT_FUNCTION, fmt, ## __VA_ARGS__ ))
 
-void __assert_fail_f( 	const char *assertion, const char *file, 
-						unsigned int line, const char *function, 
-						const char *fmt, ... 
+void __assert_fail_f( 	const char *assertion, const char *file,
+						unsigned int line, const char *function,
+						const char *fmt, ...
 	) __attribute__((noreturn, format(printf, 5, 6)));
 
@@ -39,5 +39,5 @@
 
 template<typename T, typename U>
-static inline T safe_dynamic_cast( const U & src ) {
+static inline T strict_dynamic_cast( const U & src ) {
 	T ret = dynamic_cast<T>(src);
 	assert(ret);
Index: src/libcfa/concurrency/monitor
===================================================================
--- src/libcfa/concurrency/monitor	(revision d130fe87f4cdf82b08c0879a57d7bae53c7644a2)
+++ src/libcfa/concurrency/monitor	(revision ba54f7dba922f0df27eebfcc9c67f07969df7db4)
@@ -103,4 +103,5 @@
 	unsigned short count;
 	monitor_desc ** monitors;
+	bool is_dtor;
 };
 
Index: src/main.cc
===================================================================
--- src/main.cc	(revision d130fe87f4cdf82b08c0879a57d7bae53c7644a2)
+++ src/main.cc	(revision ba54f7dba922f0df27eebfcc9c67f07969df7db4)
@@ -39,4 +39,5 @@
 #include "Common/UnimplementedError.h"      // for UnimplementedError
 #include "Common/utility.h"                 // for deleteAll, filter, printAll
+#include "Concurrency/Waitfor.h"            // for generateWaitfor
 #include "ControlStruct/ExceptTranslate.h"  // for translateEHM
 #include "ControlStruct/Mutate.h"           // for mutate
@@ -304,4 +305,7 @@
 		ControlStruct::translateEHM( translationUnit );
 
+		OPTPRINT( "generateWaitfor" );
+		Concurrency::generateWaitFor( translationUnit );
+
 		OPTPRINT( "convertSpecializations" ) // needs to happen before tuple types are expanded
 		GenPoly::convertSpecializations( translationUnit );
Index: src/tests/.expect/32/KRfunctions.txt
===================================================================
--- src/tests/.expect/32/KRfunctions.txt	(revision d130fe87f4cdf82b08c0879a57d7bae53c7644a2)
+++ src/tests/.expect/32/KRfunctions.txt	(revision ba54f7dba922f0df27eebfcc9c67f07969df7db4)
@@ -2,18 +2,18 @@
 __attribute__ ((__nothrow__,__leaf__)) extern void free(void *__ptr);
 __attribute__ ((__nothrow__,__leaf__,__noreturn__)) extern void abort(void);
-__attribute__ ((__nothrow__,__leaf__,__nonnull__(1))) extern int atexit(void (*__func)(void));
-__attribute__ ((__nothrow__,__leaf__,__noreturn__)) extern void exit(int __status);
-extern int printf(const char *__restrict __format, ...);
-int __f0__Fi_iPCii__1(int __a__i_1, const int *__b__PCi_1, int __c__i_1){
-    __attribute__ ((unused)) int ___retval_f0__i_1;
+__attribute__ ((__nothrow__,__leaf__,__nonnull__(1))) extern signed int atexit(void (*__func)(void));
+__attribute__ ((__nothrow__,__leaf__,__noreturn__)) extern void exit(signed int __status);
+extern signed int printf(const char *__restrict __format, ...);
+signed int __f0__Fi_iPCii__1(signed int __a__i_1, const signed int *__b__PCi_1, signed int __c__i_1){
+    __attribute__ ((unused)) signed int ___retval_f0__i_1;
 }
-int __f1__Fi_PiiPi__1(int *__a__Pi_1, __attribute__ ((unused)) int __b__i_1, int *__c__Pi_1){
-    __attribute__ ((unused)) int ___retval_f1__i_1;
+signed int __f1__Fi_PiiPi__1(signed int *__a__Pi_1, __attribute__ ((unused)) signed int __b__i_1, signed int *__c__Pi_1){
+    __attribute__ ((unused)) signed int ___retval_f1__i_1;
 }
-int __f2__Fi_iPiPi__1(int __a__i_1, int *__b__Pi_1, int *__c__Pi_1){
-    __attribute__ ((unused)) int ___retval_f2__i_1;
+signed int __f2__Fi_iPiPi__1(signed int __a__i_1, signed int *__b__Pi_1, signed int *__c__Pi_1){
+    __attribute__ ((unused)) signed int ___retval_f2__i_1;
 }
 struct S {
-    int __i__i_1;
+    signed int __i__i_1;
 };
 static inline void ___constructor__F_R2sS_autogen___1(struct S *___dst__R2sS_1);
@@ -36,63 +36,63 @@
     return ((struct S )___ret__2sS_1);
 }
-static inline void ___constructor__F_R2sSi_autogen___1(struct S *___dst__R2sS_1, int __i__i_1){
+static inline void ___constructor__F_R2sSi_autogen___1(struct S *___dst__R2sS_1, signed int __i__i_1){
     ((void)((*___dst__R2sS_1).__i__i_1=__i__i_1) /* ?{} */);
 }
-int __f3__Fi_2sS2sSPi__1(struct S __a__2sS_1, struct S __b__2sS_1, int *__c__Pi_1){
-    __attribute__ ((unused)) int ___retval_f3__i_1;
+signed int __f3__Fi_2sS2sSPi__1(struct S __a__2sS_1, struct S __b__2sS_1, signed int *__c__Pi_1){
+    __attribute__ ((unused)) signed int ___retval_f3__i_1;
     struct S __s__2sS_2;
 }
-int __f4__Fi_iPiPi__1(int __a__i_1, int *__b__Pi_1, int *__c__Pi_1){
-    __attribute__ ((unused)) int ___retval_f4__i_1;
+signed int __f4__Fi_iPiPi__1(signed int __a__i_1, signed int *__b__Pi_1, signed int *__c__Pi_1){
+    __attribute__ ((unused)) signed int ___retval_f4__i_1;
 }
-int __f5__Fi_iPiPi__1(int __a__i_1, int *__b__Pi_1, int *__c__Pi_1){
-    __attribute__ ((unused)) int ___retval_f5__i_1;
+signed int __f5__Fi_iPiPi__1(signed int __a__i_1, signed int *__b__Pi_1, signed int *__c__Pi_1){
+    __attribute__ ((unused)) signed int ___retval_f5__i_1;
 }
-int (*__f6__FPFi_i__iPiPi__1(int __a__i_1, int *__b__Pi_1, int *__c__Pi_1))(int __anonymous_object0){
-    __attribute__ ((unused)) int (*___retval_f6__PFi_i__1)(int __anonymous_object1);
+signed int (*__f6__FPFi_i__iPiPi__1(signed int __a__i_1, signed int *__b__Pi_1, signed int *__c__Pi_1))(signed int __anonymous_object0){
+    __attribute__ ((unused)) signed int (*___retval_f6__PFi_i__1)(signed int __anonymous_object1);
 }
-int (*__f7__FPFi_ii__iPiPi__1(int __a__i_1, int *__b__Pi_1, int *__c__Pi_1))(int __a__i_1, int __b__i_1){
-    __attribute__ ((unused)) int (*___retval_f7__PFi_ii__1)(int __a__i_1, int __b__i_1);
+signed int (*__f7__FPFi_ii__iPiPi__1(signed int __a__i_1, signed int *__b__Pi_1, signed int *__c__Pi_1))(signed int __a__i_1, signed int __b__i_1){
+    __attribute__ ((unused)) signed int (*___retval_f7__PFi_ii__1)(signed int __a__i_1, signed int __b__i_1);
 }
-int *__f8__FPi_iPiPi__1(int __a__i_1, int *__b__Pi_1, int *__c__Pi_1){
-    __attribute__ ((unused)) int *___retval_f8__Pi_1;
+signed int *__f8__FPi_iPiPi__1(signed int __a__i_1, signed int *__b__Pi_1, signed int *__c__Pi_1){
+    __attribute__ ((unused)) signed int *___retval_f8__Pi_1;
 }
-int *const __f9__FCPi_PiiPi__1(int *__a__Pi_1, int __b__i_1, int *__c__Pi_1){
-    __attribute__ ((unused)) int *const ___retval_f9__CPi_1;
+signed int *const __f9__FCPi_PiiPi__1(signed int *__a__Pi_1, signed int __b__i_1, signed int *__c__Pi_1){
+    __attribute__ ((unused)) signed int *const ___retval_f9__CPi_1;
 }
-int *(*__f10__FPFPi_ii__iPiPid__1(int __a__i_1, int *__b__Pi_1, int *__c__Pi_1, double __y__d_1))(int __x__i_1, int __y__i_1){
-    __attribute__ ((unused)) int *(*___retval_f10__PFPi_ii__1)(int __x__i_1, int __y__i_1);
-    int *__x__FPi_ii__2(int __anonymous_object2, int __anonymous_object3);
+signed int *(*__f10__FPFPi_ii__iPiPid__1(signed int __a__i_1, signed int *__b__Pi_1, signed int *__c__Pi_1, double __y__d_1))(signed int __x__i_1, signed int __y__i_1){
+    __attribute__ ((unused)) signed int *(*___retval_f10__PFPi_ii__1)(signed int __x__i_1, signed int __y__i_1);
+    signed int *__x__FPi_ii__2(signed int __anonymous_object2, signed int __anonymous_object3);
     ((void)(___retval_f10__PFPi_ii__1=__x__FPi_ii__2) /* ?{} */);
-    return ((int *(*)(int __x__i_1, int __y__i_1))___retval_f10__PFPi_ii__1);
+    return ((signed int *(*)(signed int __x__i_1, signed int __y__i_1))___retval_f10__PFPi_ii__1);
 }
-int (*__f11__FPA0i_iPiPi__1(int __a__i_1, int *__b__Pi_1, int *__c__Pi_1))[]{
-    __attribute__ ((unused)) int (*___retval_f11__PA0i_1)[];
+signed int (*__f11__FPA0i_iPiPi__1(signed int __a__i_1, signed int *__b__Pi_1, signed int *__c__Pi_1))[]{
+    __attribute__ ((unused)) signed int (*___retval_f11__PA0i_1)[];
 }
-int (*__f12__FPA0A0i_iPiPi__1(int __a__i_1, int *__b__Pi_1, int *__c__Pi_1))[][((unsigned int )10)]{
-    __attribute__ ((unused)) int (*___retval_f12__PA0A0i_1)[][((unsigned int )10)];
+signed int (*__f12__FPA0A0i_iPiPi__1(signed int __a__i_1, signed int *__b__Pi_1, signed int *__c__Pi_1))[][((unsigned int )10)]{
+    __attribute__ ((unused)) signed int (*___retval_f12__PA0A0i_1)[][((unsigned int )10)];
 }
-int (*__f13__FPA0A0i_iPiPi__1(int __a__i_1, int *__b__Pi_1, int *__c__Pi_1))[][((unsigned int )10)]{
-    __attribute__ ((unused)) int (*___retval_f13__PA0A0i_1)[][((unsigned int )10)];
+signed int (*__f13__FPA0A0i_iPiPi__1(signed int __a__i_1, signed int *__b__Pi_1, signed int *__c__Pi_1))[][((unsigned int )10)]{
+    __attribute__ ((unused)) signed int (*___retval_f13__PA0A0i_1)[][((unsigned int )10)];
 }
-int (*__f14__FPA0A0i_iPiPi__1(int __a__i_1, int *__b__Pi_1, int *__c__Pi_1))[][((unsigned int )10)]{
-    __attribute__ ((unused)) int (*___retval_f14__PA0A0i_1)[][((unsigned int )10)];
+signed int (*__f14__FPA0A0i_iPiPi__1(signed int __a__i_1, signed int *__b__Pi_1, signed int *__c__Pi_1))[][((unsigned int )10)]{
+    __attribute__ ((unused)) signed int (*___retval_f14__PA0A0i_1)[][((unsigned int )10)];
 }
-int __f15__Fi_iii__1(int __a__i_1, int __b__i_1, int __c__i_1){
-    __attribute__ ((unused)) int ___retval_f15__i_1;
+signed int __f15__Fi_iii__1(signed int __a__i_1, signed int __b__i_1, signed int __c__i_1){
+    __attribute__ ((unused)) signed int ___retval_f15__i_1;
 }
-const int __fred__FCi___1(){
-    __attribute__ ((unused)) const int ___retval_fred__Ci_1;
-    int *(*__x__PFPi_ii__2)(int __anonymous_object4, int __anonymous_object5);
-    int __a__i_2;
-    int __b__i_2;
-    int *(*_tmp_cp_ret0)(int __x__i_1, int __y__i_1);
+const signed int __fred__FCi___1(){
+    __attribute__ ((unused)) const signed int ___retval_fred__Ci_1;
+    signed int *(*__x__PFPi_ii__2)(signed int __anonymous_object4, signed int __anonymous_object5);
+    signed int __a__i_2;
+    signed int __b__i_2;
+    signed int *(*_tmp_cp_ret0)(signed int __x__i_1, signed int __y__i_1);
     ((void)(__x__PFPi_ii__2=(((void)(_tmp_cp_ret0=__f10__FPFPi_ii__iPiPid__1(3, (&__a__i_2), (&__b__i_2), 3.5))) , _tmp_cp_ret0)));
     ((void)(_tmp_cp_ret0) /* ^?{} */);
-    const int __f1__FCi_iPiPi__2(int __a__i_2, int *__b__Pi_2, int *__c__Pi_2){
-        __attribute__ ((unused)) const int ___retval_f1__Ci_2;
+    const signed int __f1__FCi_iPiPi__2(signed int __a__i_2, signed int *__b__Pi_2, signed int *__c__Pi_2){
+        __attribute__ ((unused)) const signed int ___retval_f1__Ci_2;
     }
-    const int __f2__FCi_iii__2(int __a__i_2, int __b__i_2, int __c__i_2){
-        __attribute__ ((unused)) const int ___retval_f2__Ci_2;
+    const signed int __f2__FCi_iii__2(signed int __a__i_2, signed int __b__i_2, signed int __c__i_2){
+        __attribute__ ((unused)) const signed int ___retval_f2__Ci_2;
     }
 }
Index: src/tests/.expect/32/attributes.txt
===================================================================
--- src/tests/.expect/32/attributes.txt	(revision d130fe87f4cdf82b08c0879a57d7bae53c7644a2)
+++ src/tests/.expect/32/attributes.txt	(revision ba54f7dba922f0df27eebfcc9c67f07969df7db4)
@@ -2,9 +2,9 @@
 __attribute__ ((__nothrow__,__leaf__)) extern void free(void *__ptr);
 __attribute__ ((__nothrow__,__leaf__,__noreturn__)) extern void abort(void);
-__attribute__ ((__nothrow__,__leaf__,__nonnull__(1))) extern int atexit(void (*__func)(void));
-__attribute__ ((__nothrow__,__leaf__,__noreturn__)) extern void exit(int __status);
-extern int printf(const char *__restrict __format, ...);
-int __la__Fi___1(){
-    __attribute__ ((unused)) int ___retval_la__i_1;
+__attribute__ ((__nothrow__,__leaf__,__nonnull__(1))) extern signed int atexit(void (*__func)(void));
+__attribute__ ((__nothrow__,__leaf__,__noreturn__)) extern void exit(signed int __status);
+extern signed int printf(const char *__restrict __format, ...);
+signed int __la__Fi___1(){
+    __attribute__ ((unused)) signed int ___retval_la__i_1;
     L: __attribute__ ((unused)) ((void)1);
 }
@@ -54,14 +54,14 @@
 __attribute__ ((unused)) struct __anonymous3;
 struct Fdl {
-    __attribute__ ((unused)) int __f1__i_1;
-    __attribute__ ((unused)) int __f2__i_1;
-    __attribute__ ((unused,unused)) int __f3__i_1;
-    __attribute__ ((unused)) int __f4__i_1;
-    __attribute__ ((unused,unused)) int __f5__i_1;
-    __attribute__ ((used,packed)) int __f6__i_1;
-    __attribute__ ((used,unused,unused)) int __f7__i_1;
-    __attribute__ ((used,used,unused)) int __f8__i_1;
-    __attribute__ ((unused)) int __anonymous_object0;
-    __attribute__ ((unused,unused)) int *__f9__Pi_1;
+    __attribute__ ((unused)) signed int __f1__i_1;
+    __attribute__ ((unused)) signed int __f2__i_1;
+    __attribute__ ((unused,unused)) signed int __f3__i_1;
+    __attribute__ ((unused)) signed int __f4__i_1;
+    __attribute__ ((unused,unused)) signed int __f5__i_1;
+    __attribute__ ((used,packed)) signed int __f6__i_1;
+    __attribute__ ((used,unused,unused)) signed int __f7__i_1;
+    __attribute__ ((used,used,unused)) signed int __f8__i_1;
+    __attribute__ ((unused)) signed int __anonymous_object0;
+    __attribute__ ((unused,unused)) signed int *__f9__Pi_1;
 };
 static inline void ___constructor__F_R4sFdl_autogen___1(struct Fdl *___dst__R4sFdl_1);
@@ -116,5 +116,5 @@
     return ((struct Fdl )___ret__4sFdl_1);
 }
-static inline void ___constructor__F_R4sFdli_autogen___1(struct Fdl *___dst__R4sFdl_1, int __f1__i_1){
+static inline void ___constructor__F_R4sFdli_autogen___1(struct Fdl *___dst__R4sFdl_1, signed int __f1__i_1){
     ((void)((*___dst__R4sFdl_1).__f1__i_1=__f1__i_1) /* ?{} */);
     ((void)((*___dst__R4sFdl_1).__f2__i_1) /* ?{} */);
@@ -127,5 +127,5 @@
     ((void)((*___dst__R4sFdl_1).__f9__Pi_1) /* ?{} */);
 }
-static inline void ___constructor__F_R4sFdlii_autogen___1(struct Fdl *___dst__R4sFdl_1, int __f1__i_1, int __f2__i_1){
+static inline void ___constructor__F_R4sFdlii_autogen___1(struct Fdl *___dst__R4sFdl_1, signed int __f1__i_1, signed int __f2__i_1){
     ((void)((*___dst__R4sFdl_1).__f1__i_1=__f1__i_1) /* ?{} */);
     ((void)((*___dst__R4sFdl_1).__f2__i_1=__f2__i_1) /* ?{} */);
@@ -138,5 +138,5 @@
     ((void)((*___dst__R4sFdl_1).__f9__Pi_1) /* ?{} */);
 }
-static inline void ___constructor__F_R4sFdliii_autogen___1(struct Fdl *___dst__R4sFdl_1, int __f1__i_1, int __f2__i_1, int __f3__i_1){
+static inline void ___constructor__F_R4sFdliii_autogen___1(struct Fdl *___dst__R4sFdl_1, signed int __f1__i_1, signed int __f2__i_1, signed int __f3__i_1){
     ((void)((*___dst__R4sFdl_1).__f1__i_1=__f1__i_1) /* ?{} */);
     ((void)((*___dst__R4sFdl_1).__f2__i_1=__f2__i_1) /* ?{} */);
@@ -149,27 +149,27 @@
     ((void)((*___dst__R4sFdl_1).__f9__Pi_1) /* ?{} */);
 }
-static inline void ___constructor__F_R4sFdliiii_autogen___1(struct Fdl *___dst__R4sFdl_1, int __f1__i_1, int __f2__i_1, int __f3__i_1, int __f4__i_1){
-    ((void)((*___dst__R4sFdl_1).__f1__i_1=__f1__i_1) /* ?{} */);
-    ((void)((*___dst__R4sFdl_1).__f2__i_1=__f2__i_1) /* ?{} */);
-    ((void)((*___dst__R4sFdl_1).__f3__i_1=__f3__i_1) /* ?{} */);
-    ((void)((*___dst__R4sFdl_1).__f4__i_1=__f4__i_1) /* ?{} */);
-    ((void)((*___dst__R4sFdl_1).__f5__i_1) /* ?{} */);
-    ((void)((*___dst__R4sFdl_1).__f6__i_1) /* ?{} */);
-    ((void)((*___dst__R4sFdl_1).__f7__i_1) /* ?{} */);
-    ((void)((*___dst__R4sFdl_1).__f8__i_1) /* ?{} */);
-    ((void)((*___dst__R4sFdl_1).__f9__Pi_1) /* ?{} */);
-}
-static inline void ___constructor__F_R4sFdliiiii_autogen___1(struct Fdl *___dst__R4sFdl_1, int __f1__i_1, int __f2__i_1, int __f3__i_1, int __f4__i_1, int __f5__i_1){
-    ((void)((*___dst__R4sFdl_1).__f1__i_1=__f1__i_1) /* ?{} */);
-    ((void)((*___dst__R4sFdl_1).__f2__i_1=__f2__i_1) /* ?{} */);
-    ((void)((*___dst__R4sFdl_1).__f3__i_1=__f3__i_1) /* ?{} */);
-    ((void)((*___dst__R4sFdl_1).__f4__i_1=__f4__i_1) /* ?{} */);
-    ((void)((*___dst__R4sFdl_1).__f5__i_1=__f5__i_1) /* ?{} */);
-    ((void)((*___dst__R4sFdl_1).__f6__i_1) /* ?{} */);
-    ((void)((*___dst__R4sFdl_1).__f7__i_1) /* ?{} */);
-    ((void)((*___dst__R4sFdl_1).__f8__i_1) /* ?{} */);
-    ((void)((*___dst__R4sFdl_1).__f9__Pi_1) /* ?{} */);
-}
-static inline void ___constructor__F_R4sFdliiiiii_autogen___1(struct Fdl *___dst__R4sFdl_1, int __f1__i_1, int __f2__i_1, int __f3__i_1, int __f4__i_1, int __f5__i_1, int __f6__i_1){
+static inline void ___constructor__F_R4sFdliiii_autogen___1(struct Fdl *___dst__R4sFdl_1, signed int __f1__i_1, signed int __f2__i_1, signed int __f3__i_1, signed int __f4__i_1){
+    ((void)((*___dst__R4sFdl_1).__f1__i_1=__f1__i_1) /* ?{} */);
+    ((void)((*___dst__R4sFdl_1).__f2__i_1=__f2__i_1) /* ?{} */);
+    ((void)((*___dst__R4sFdl_1).__f3__i_1=__f3__i_1) /* ?{} */);
+    ((void)((*___dst__R4sFdl_1).__f4__i_1=__f4__i_1) /* ?{} */);
+    ((void)((*___dst__R4sFdl_1).__f5__i_1) /* ?{} */);
+    ((void)((*___dst__R4sFdl_1).__f6__i_1) /* ?{} */);
+    ((void)((*___dst__R4sFdl_1).__f7__i_1) /* ?{} */);
+    ((void)((*___dst__R4sFdl_1).__f8__i_1) /* ?{} */);
+    ((void)((*___dst__R4sFdl_1).__f9__Pi_1) /* ?{} */);
+}
+static inline void ___constructor__F_R4sFdliiiii_autogen___1(struct Fdl *___dst__R4sFdl_1, signed int __f1__i_1, signed int __f2__i_1, signed int __f3__i_1, signed int __f4__i_1, signed int __f5__i_1){
+    ((void)((*___dst__R4sFdl_1).__f1__i_1=__f1__i_1) /* ?{} */);
+    ((void)((*___dst__R4sFdl_1).__f2__i_1=__f2__i_1) /* ?{} */);
+    ((void)((*___dst__R4sFdl_1).__f3__i_1=__f3__i_1) /* ?{} */);
+    ((void)((*___dst__R4sFdl_1).__f4__i_1=__f4__i_1) /* ?{} */);
+    ((void)((*___dst__R4sFdl_1).__f5__i_1=__f5__i_1) /* ?{} */);
+    ((void)((*___dst__R4sFdl_1).__f6__i_1) /* ?{} */);
+    ((void)((*___dst__R4sFdl_1).__f7__i_1) /* ?{} */);
+    ((void)((*___dst__R4sFdl_1).__f8__i_1) /* ?{} */);
+    ((void)((*___dst__R4sFdl_1).__f9__Pi_1) /* ?{} */);
+}
+static inline void ___constructor__F_R4sFdliiiiii_autogen___1(struct Fdl *___dst__R4sFdl_1, signed int __f1__i_1, signed int __f2__i_1, signed int __f3__i_1, signed int __f4__i_1, signed int __f5__i_1, signed int __f6__i_1){
     ((void)((*___dst__R4sFdl_1).__f1__i_1=__f1__i_1) /* ?{} */);
     ((void)((*___dst__R4sFdl_1).__f2__i_1=__f2__i_1) /* ?{} */);
@@ -182,5 +182,5 @@
     ((void)((*___dst__R4sFdl_1).__f9__Pi_1) /* ?{} */);
 }
-static inline void ___constructor__F_R4sFdliiiiiii_autogen___1(struct Fdl *___dst__R4sFdl_1, int __f1__i_1, int __f2__i_1, int __f3__i_1, int __f4__i_1, int __f5__i_1, int __f6__i_1, int __f7__i_1){
+static inline void ___constructor__F_R4sFdliiiiiii_autogen___1(struct Fdl *___dst__R4sFdl_1, signed int __f1__i_1, signed int __f2__i_1, signed int __f3__i_1, signed int __f4__i_1, signed int __f5__i_1, signed int __f6__i_1, signed int __f7__i_1){
     ((void)((*___dst__R4sFdl_1).__f1__i_1=__f1__i_1) /* ?{} */);
     ((void)((*___dst__R4sFdl_1).__f2__i_1=__f2__i_1) /* ?{} */);
@@ -193,5 +193,5 @@
     ((void)((*___dst__R4sFdl_1).__f9__Pi_1) /* ?{} */);
 }
-static inline void ___constructor__F_R4sFdliiiiiiii_autogen___1(struct Fdl *___dst__R4sFdl_1, int __f1__i_1, int __f2__i_1, int __f3__i_1, int __f4__i_1, int __f5__i_1, int __f6__i_1, int __f7__i_1, int __f8__i_1){
+static inline void ___constructor__F_R4sFdliiiiiiii_autogen___1(struct Fdl *___dst__R4sFdl_1, signed int __f1__i_1, signed int __f2__i_1, signed int __f3__i_1, signed int __f4__i_1, signed int __f5__i_1, signed int __f6__i_1, signed int __f7__i_1, signed int __f8__i_1){
     ((void)((*___dst__R4sFdl_1).__f1__i_1=__f1__i_1) /* ?{} */);
     ((void)((*___dst__R4sFdl_1).__f2__i_1=__f2__i_1) /* ?{} */);
@@ -204,5 +204,5 @@
     ((void)((*___dst__R4sFdl_1).__f9__Pi_1) /* ?{} */);
 }
-static inline void ___constructor__F_R4sFdliiiiiiiiPi_autogen___1(struct Fdl *___dst__R4sFdl_1, int __f1__i_1, int __f2__i_1, int __f3__i_1, int __f4__i_1, int __f5__i_1, int __f6__i_1, int __f7__i_1, int __f8__i_1, int *__f9__Pi_1){
+static inline void ___constructor__F_R4sFdliiiiiiiiPi_autogen___1(struct Fdl *___dst__R4sFdl_1, signed int __f1__i_1, signed int __f2__i_1, signed int __f3__i_1, signed int __f4__i_1, signed int __f5__i_1, signed int __f6__i_1, signed int __f7__i_1, signed int __f8__i_1, signed int *__f9__Pi_1){
     ((void)((*___dst__R4sFdl_1).__f1__i_1=__f1__i_1) /* ?{} */);
     ((void)((*___dst__R4sFdl_1).__f2__i_1=__f2__i_1) /* ?{} */);
@@ -215,76 +215,76 @@
     ((void)((*___dst__R4sFdl_1).__f9__Pi_1=__f9__Pi_1) /* ?{} */);
 }
-__attribute__ ((unused)) int __f__Fi___1() asm ( "xyz" );
-__attribute__ ((used,used)) const int __vd1__Ci_1;
-__attribute__ ((used,unused)) const int __vd2__Ci_1;
-__attribute__ ((used,used,used,used)) const int *__vd3__PCi_1;
-__attribute__ ((used,used,unused,used,unused)) const int *__vd4__PCi_1;
-__attribute__ ((used,used,used)) const int __vd5__A0Ci_1[((unsigned int )5)];
-__attribute__ ((used,used,unused,used)) const int __vd6__A0Ci_1[((unsigned int )5)];
-__attribute__ ((used,used,used,used)) const int (*__vd7__PFCi___1)();
-__attribute__ ((used,used,unused,used,used)) const int (*__vd8__PFCi___1)();
-__attribute__ ((unused,used)) int __f1__Fi___1();
-__attribute__ ((unused)) int __f1__Fi___1(){
-    __attribute__ ((unused)) int ___retval_f1__i_1;
-}
-__attribute__ ((unused,unused,unused,used)) int **const __f2__FCPPi___1();
-__attribute__ ((unused,unused,unused)) int **const __f2__FCPPi___1(){
-    __attribute__ ((unused)) int **const ___retval_f2__CPPi_1;
-}
-__attribute__ ((unused,used,unused)) int (*__f3__FPA0i_i__1(int __anonymous_object1))[];
-__attribute__ ((unused,unused)) int (*__f3__FPA0i_i__1(int __p__i_1))[]{
-    __attribute__ ((unused)) int (*___retval_f3__PA0i_1)[];
-}
-__attribute__ ((unused,used,unused)) int (*__f4__FPFi_i____1())(int __anonymous_object2);
-__attribute__ ((unused,unused)) int (*__f4__FPFi_i____1())(int __anonymous_object3){
-    __attribute__ ((unused)) int (*___retval_f4__PFi_i__1)(int __anonymous_object4);
-}
-int __vtr__Fi___1(){
-    __attribute__ ((unused)) int ___retval_vtr__i_1;
-    __attribute__ ((unused,unused,used)) int __t1__i_2;
-    __attribute__ ((unused,unused,unused,unused,unused)) int **__t2__PPi_2;
-    __attribute__ ((unused,unused,unused)) int __t3__A0i_2[((unsigned int )5)];
-    __attribute__ ((unused,unused,unused,unused,unused)) int **__t4__A0PPi_2[((unsigned int )5)];
-    __attribute__ ((unused,unused,unused)) int __t5__Fi___2();
-    __attribute__ ((unused,unused,unused,unused)) int *__t6__FPi___2();
-}
-int __ipd1__Fi_ii__1(__attribute__ ((unused,unused,unused)) int __p__i_1, __attribute__ ((unused,unused,unused)) int __q__i_1);
-int __ipd1__Fi_ii__1(__attribute__ ((unused,unused,unused)) int __p__i_1, __attribute__ ((unused,unused,unused)) int __q__i_1){
-    __attribute__ ((unused)) int ___retval_ipd1__i_1;
-}
-int __ipd2__Fi_PiPi__1(__attribute__ ((unused,unused,unused,unused)) int *__p__Pi_1, __attribute__ ((unused,unused,unused)) int *__q__Pi_1);
-int __ipd2__Fi_PiPi__1(__attribute__ ((unused,unused,unused,unused)) int *__p__Pi_1, __attribute__ ((unused,unused,unused)) int *__q__Pi_1){
-    __attribute__ ((unused)) int ___retval_ipd2__i_1;
-}
-int __ipd3__Fi_PiPi__1(__attribute__ ((unused,unused,unused)) int *__p__Pi_1, __attribute__ ((unused,unused,unused)) int *__q__Pi_1);
-int __ipd3__Fi_PiPi__1(__attribute__ ((unused,unused,unused)) int *__p__Pi_1, __attribute__ ((unused,unused,unused)) int *__q__Pi_1){
-    __attribute__ ((unused)) int ___retval_ipd3__i_1;
-}
-int __ipd4__Fi_PFi__PFi____1(__attribute__ ((unused,unused,unused)) int (*__p__PFi___1)(), __attribute__ ((unused,unused,unused)) int (*__q__PFi___1)());
-int __ipd4__Fi_PFi__PFi____1(__attribute__ ((unused,unused,unused)) int (*__p__PFi___1)(), __attribute__ ((unused,unused,unused)) int (*__q__PFi___1)()){
-    __attribute__ ((unused)) int ___retval_ipd4__i_1;
-}
-int __tpr1__Fi_i__1(__attribute__ ((unused,unused,unused)) int __Foo__i_1);
-int __tpr2__Fi_PPi__1(__attribute__ ((unused,unused,unused,unused,unused,unused)) int **__Foo__PPi_1);
-int __tpr3__Fi_Pi__1(__attribute__ ((unused,unused,unused)) int *__Foo__Pi_1);
-int __tpr4__Fi_PFi_Pi___1(__attribute__ ((unused,unused)) int (*__anonymous_object5)(__attribute__ ((unused,unused)) int __anonymous_object6[((unsigned int )5)]));
-int __tpr5__Fi_PFi____1(__attribute__ ((unused,unused,unused)) int (*__Foo__PFi___1)());
-int __tpr6__Fi_PFi____1(__attribute__ ((unused,unused,unused)) int (*__Foo__PFi___1)());
-int __tpr7__Fi_PFi_PFi_i____1(__attribute__ ((unused,unused)) int (*__anonymous_object7)(__attribute__ ((unused)) int (*__anonymous_object8)(__attribute__ ((unused,unused)) int __anonymous_object9)));
-int __ad__Fi___1(){
-    __attribute__ ((unused)) int ___retval_ad__i_1;
-    __attribute__ ((used,unused)) int __ad1__i_2;
-    __attribute__ ((unused,unused,unused)) int *__ad2__Pi_2;
-    __attribute__ ((unused,unused,unused)) int __ad3__A0i_2[((unsigned int )5)];
-    __attribute__ ((unused,unused,unused,unused,unused)) int (*__ad4__PA0i_2)[((unsigned int )10)];
-    __attribute__ ((unused,unused,unused,unused,used)) int __ad5__i_2;
-    __attribute__ ((unused,unused,unused,unused,unused)) int __ad6__Fi___2();
-    ((void)sizeof(__attribute__ ((unused,unused)) int ));
-    ((void)sizeof(__attribute__ ((unused,unused,unused,unused)) int **));
-    ((void)sizeof(__attribute__ ((unused,unused,unused)) int [5]));
-    ((void)sizeof(__attribute__ ((unused,unused,unused)) int (*)[10]));
-    ((void)sizeof(__attribute__ ((unused,unused,unused)) int ()));
+__attribute__ ((unused)) signed int __f__Fi___1() asm ( "xyz" );
+__attribute__ ((used,used)) const signed int __vd1__Ci_1;
+__attribute__ ((used,unused)) const signed int __vd2__Ci_1;
+__attribute__ ((used,used,used,used)) const signed int *__vd3__PCi_1;
+__attribute__ ((used,used,unused,used,unused)) const signed int *__vd4__PCi_1;
+__attribute__ ((used,used,used)) const signed int __vd5__A0Ci_1[((unsigned int )5)];
+__attribute__ ((used,used,unused,used)) const signed int __vd6__A0Ci_1[((unsigned int )5)];
+__attribute__ ((used,used,used,used)) const signed int (*__vd7__PFCi___1)();
+__attribute__ ((used,used,unused,used,used)) const signed int (*__vd8__PFCi___1)();
+__attribute__ ((unused,used)) signed int __f1__Fi___1();
+__attribute__ ((unused)) signed int __f1__Fi___1(){
+    __attribute__ ((unused)) signed int ___retval_f1__i_1;
+}
+__attribute__ ((unused,unused,unused,used)) signed int **const __f2__FCPPi___1();
+__attribute__ ((unused,unused,unused)) signed int **const __f2__FCPPi___1(){
+    __attribute__ ((unused)) signed int **const ___retval_f2__CPPi_1;
+}
+__attribute__ ((unused,used,unused)) signed int (*__f3__FPA0i_i__1(signed int __anonymous_object1))[];
+__attribute__ ((unused,unused)) signed int (*__f3__FPA0i_i__1(signed int __p__i_1))[]{
+    __attribute__ ((unused)) signed int (*___retval_f3__PA0i_1)[];
+}
+__attribute__ ((unused,used,unused)) signed int (*__f4__FPFi_i____1())(signed int __anonymous_object2);
+__attribute__ ((unused,unused)) signed int (*__f4__FPFi_i____1())(signed int __anonymous_object3){
+    __attribute__ ((unused)) signed int (*___retval_f4__PFi_i__1)(signed int __anonymous_object4);
+}
+signed int __vtr__Fi___1(){
+    __attribute__ ((unused)) signed int ___retval_vtr__i_1;
+    __attribute__ ((unused,unused,used)) signed int __t1__i_2;
+    __attribute__ ((unused,unused,unused,unused,unused)) signed int **__t2__PPi_2;
+    __attribute__ ((unused,unused,unused)) signed int __t3__A0i_2[((unsigned int )5)];
+    __attribute__ ((unused,unused,unused,unused,unused)) signed int **__t4__A0PPi_2[((unsigned int )5)];
+    __attribute__ ((unused,unused,unused)) signed int __t5__Fi___2();
+    __attribute__ ((unused,unused,unused,unused)) signed int *__t6__FPi___2();
+}
+signed int __ipd1__Fi_ii__1(__attribute__ ((unused,unused,unused)) signed int __p__i_1, __attribute__ ((unused,unused,unused)) signed int __q__i_1);
+signed int __ipd1__Fi_ii__1(__attribute__ ((unused,unused,unused)) signed int __p__i_1, __attribute__ ((unused,unused,unused)) signed int __q__i_1){
+    __attribute__ ((unused)) signed int ___retval_ipd1__i_1;
+}
+signed int __ipd2__Fi_PiPi__1(__attribute__ ((unused,unused,unused,unused)) signed int *__p__Pi_1, __attribute__ ((unused,unused,unused)) signed int *__q__Pi_1);
+signed int __ipd2__Fi_PiPi__1(__attribute__ ((unused,unused,unused,unused)) signed int *__p__Pi_1, __attribute__ ((unused,unused,unused)) signed int *__q__Pi_1){
+    __attribute__ ((unused)) signed int ___retval_ipd2__i_1;
+}
+signed int __ipd3__Fi_PiPi__1(__attribute__ ((unused,unused,unused)) signed int *__p__Pi_1, __attribute__ ((unused,unused,unused)) signed int *__q__Pi_1);
+signed int __ipd3__Fi_PiPi__1(__attribute__ ((unused,unused,unused)) signed int *__p__Pi_1, __attribute__ ((unused,unused,unused)) signed int *__q__Pi_1){
+    __attribute__ ((unused)) signed int ___retval_ipd3__i_1;
+}
+signed int __ipd4__Fi_PFi__PFi____1(__attribute__ ((unused,unused,unused)) signed int (*__p__PFi___1)(), __attribute__ ((unused,unused,unused)) signed int (*__q__PFi___1)());
+signed int __ipd4__Fi_PFi__PFi____1(__attribute__ ((unused,unused,unused)) signed int (*__p__PFi___1)(), __attribute__ ((unused,unused,unused)) signed int (*__q__PFi___1)()){
+    __attribute__ ((unused)) signed int ___retval_ipd4__i_1;
+}
+signed int __tpr1__Fi_i__1(__attribute__ ((unused,unused,unused)) signed int __Foo__i_1);
+signed int __tpr2__Fi_PPi__1(__attribute__ ((unused,unused,unused,unused,unused,unused)) signed int **__Foo__PPi_1);
+signed int __tpr3__Fi_Pi__1(__attribute__ ((unused,unused,unused)) signed int *__Foo__Pi_1);
+signed int __tpr4__Fi_PFi_Pi___1(__attribute__ ((unused,unused)) signed int (*__anonymous_object5)(__attribute__ ((unused,unused)) signed int __anonymous_object6[((unsigned int )5)]));
+signed int __tpr5__Fi_PFi____1(__attribute__ ((unused,unused,unused)) signed int (*__Foo__PFi___1)());
+signed int __tpr6__Fi_PFi____1(__attribute__ ((unused,unused,unused)) signed int (*__Foo__PFi___1)());
+signed int __tpr7__Fi_PFi_PFi_i____1(__attribute__ ((unused,unused)) signed int (*__anonymous_object7)(__attribute__ ((unused)) signed int (*__anonymous_object8)(__attribute__ ((unused,unused)) signed int __anonymous_object9)));
+signed int __ad__Fi___1(){
+    __attribute__ ((unused)) signed int ___retval_ad__i_1;
+    __attribute__ ((used,unused)) signed int __ad1__i_2;
+    __attribute__ ((unused,unused,unused)) signed int *__ad2__Pi_2;
+    __attribute__ ((unused,unused,unused)) signed int __ad3__A0i_2[((unsigned int )5)];
+    __attribute__ ((unused,unused,unused,unused,unused)) signed int (*__ad4__PA0i_2)[((unsigned int )10)];
+    __attribute__ ((unused,unused,unused,unused,used)) signed int __ad5__i_2;
+    __attribute__ ((unused,unused,unused,unused,unused)) signed int __ad6__Fi___2();
+    ((void)sizeof(__attribute__ ((unused,unused)) signed int ));
+    ((void)sizeof(__attribute__ ((unused,unused,unused,unused)) signed int **));
+    ((void)sizeof(__attribute__ ((unused,unused,unused)) signed int [5]));
+    ((void)sizeof(__attribute__ ((unused,unused,unused)) signed int (*)[10]));
+    ((void)sizeof(__attribute__ ((unused,unused,unused)) signed int ()));
     __attribute__ ((unused)) struct __anonymous4 {
-        int __i__i_2;
+        signed int __i__i_2;
     };
     inline void ___constructor__F_R13s__anonymous4_autogen___2(struct __anonymous4 *___dst__R13s__anonymous4_2){
@@ -303,5 +303,5 @@
         return ((struct __anonymous4 )___ret__13s__anonymous4_2);
     }
-    inline void ___constructor__F_R13s__anonymous4i_autogen___2(struct __anonymous4 *___dst__R13s__anonymous4_2, int __i__i_2){
+    inline void ___constructor__F_R13s__anonymous4i_autogen___2(struct __anonymous4 *___dst__R13s__anonymous4_2, signed int __i__i_2){
         ((void)((*___dst__R13s__anonymous4_2).__i__i_2=__i__i_2) /* ?{} */);
     }
@@ -324,16 +324,16 @@
     ((void)sizeof(enum __anonymous5 ));
 }
-int __apd1__Fi_PiPi__1(__attribute__ ((unused,unused,unused)) int *__anonymous_object10, __attribute__ ((unused,unused,unused)) int *__anonymous_object11);
-int __apd2__Fi_PPiPPi__1(__attribute__ ((unused,unused,unused,unused)) int **__anonymous_object12, __attribute__ ((unused,unused,unused,unused)) int **__anonymous_object13);
-int __apd3__Fi_PiPi__1(__attribute__ ((unused,unused,unused)) int *__anonymous_object14, __attribute__ ((unused,unused,unused)) int *__anonymous_object15);
-int __apd4__Fi_PFi__PFi____1(__attribute__ ((unused,unused,unused)) int (*__anonymous_object16)(), __attribute__ ((unused,unused,unused)) int (*__anonymous_object17)());
-int __apd5__Fi_PFi_i_PFi_i___1(__attribute__ ((unused,unused,unused)) int (*__anonymous_object18)(__attribute__ ((unused)) int __anonymous_object19), __attribute__ ((unused,unused,unused)) int (*__anonymous_object20)(__attribute__ ((unused)) int __anonymous_object21));
-int __apd6__Fi_PFi__PFi____1(__attribute__ ((unused,unused,unused)) int (*__anonymous_object22)(), __attribute__ ((unused,unused,unused)) int (*__anonymous_object23)());
-int __apd7__Fi_PFi_i_PFi_i___1(__attribute__ ((unused,unused,unused)) int (*__anonymous_object24)(__attribute__ ((unused)) int __anonymous_object25), __attribute__ ((unused,unused,unused)) int (*__anonymous_object26)(__attribute__ ((unused)) int __anonymous_object27));
+signed int __apd1__Fi_PiPi__1(__attribute__ ((unused,unused,unused)) signed int *__anonymous_object10, __attribute__ ((unused,unused,unused)) signed int *__anonymous_object11);
+signed int __apd2__Fi_PPiPPi__1(__attribute__ ((unused,unused,unused,unused)) signed int **__anonymous_object12, __attribute__ ((unused,unused,unused,unused)) signed int **__anonymous_object13);
+signed int __apd3__Fi_PiPi__1(__attribute__ ((unused,unused,unused)) signed int *__anonymous_object14, __attribute__ ((unused,unused,unused)) signed int *__anonymous_object15);
+signed int __apd4__Fi_PFi__PFi____1(__attribute__ ((unused,unused,unused)) signed int (*__anonymous_object16)(), __attribute__ ((unused,unused,unused)) signed int (*__anonymous_object17)());
+signed int __apd5__Fi_PFi_i_PFi_i___1(__attribute__ ((unused,unused,unused)) signed int (*__anonymous_object18)(__attribute__ ((unused)) signed int __anonymous_object19), __attribute__ ((unused,unused,unused)) signed int (*__anonymous_object20)(__attribute__ ((unused)) signed int __anonymous_object21));
+signed int __apd6__Fi_PFi__PFi____1(__attribute__ ((unused,unused,unused)) signed int (*__anonymous_object22)(), __attribute__ ((unused,unused,unused)) signed int (*__anonymous_object23)());
+signed int __apd7__Fi_PFi_i_PFi_i___1(__attribute__ ((unused,unused,unused)) signed int (*__anonymous_object24)(__attribute__ ((unused)) signed int __anonymous_object25), __attribute__ ((unused,unused,unused)) signed int (*__anonymous_object26)(__attribute__ ((unused)) signed int __anonymous_object27));
 struct Vad {
-    __attribute__ ((unused)) int __anonymous_object28;
-    __attribute__ ((unused,unused)) int *__anonymous_object29;
-    __attribute__ ((unused,unused)) int __anonymous_object30[((unsigned int )10)];
-    __attribute__ ((unused,unused)) int (*__anonymous_object31)();
+    __attribute__ ((unused)) signed int __anonymous_object28;
+    __attribute__ ((unused,unused)) signed int *__anonymous_object29;
+    __attribute__ ((unused,unused)) signed int __anonymous_object30[((unsigned int )10)];
+    __attribute__ ((unused,unused)) signed int (*__anonymous_object31)();
 };
 static inline void ___constructor__F_R4sVad_autogen___1(struct Vad *___dst__R4sVad_1);
Index: src/tests/.expect/32/declarationSpecifier.txt
===================================================================
--- src/tests/.expect/32/declarationSpecifier.txt	(revision d130fe87f4cdf82b08c0879a57d7bae53c7644a2)
+++ src/tests/.expect/32/declarationSpecifier.txt	(revision ba54f7dba922f0df27eebfcc9c67f07969df7db4)
@@ -2,17 +2,17 @@
 __attribute__ ((__nothrow__,__leaf__)) extern void free(void *__ptr);
 __attribute__ ((__nothrow__,__leaf__,__noreturn__)) extern void abort(void);
-__attribute__ ((__nothrow__,__leaf__,__nonnull__(1))) extern int atexit(void (*__func)(void));
-__attribute__ ((__nothrow__,__leaf__,__noreturn__)) extern void exit(int __status);
-extern int printf(const char *__restrict __format, ...);
-volatile const short __x1__CVs_1;
-static volatile const short __x2__CVs_1;
-static volatile const short __x3__CVs_1;
-static volatile const short __x4__CVs_1;
-static volatile const short __x5__CVs_1;
-static volatile const short __x6__CVs_1;
-static volatile const short __x7__CVs_1;
-static volatile const short __x8__CVs_1;
+__attribute__ ((__nothrow__,__leaf__,__nonnull__(1))) extern signed int atexit(void (*__func)(void));
+__attribute__ ((__nothrow__,__leaf__,__noreturn__)) extern void exit(signed int __status);
+extern signed int printf(const char *__restrict __format, ...);
+volatile const signed short int __x1__CVs_1;
+static volatile const signed short int __x2__CVs_1;
+static volatile const signed short int __x3__CVs_1;
+static volatile const signed short int __x4__CVs_1;
+static volatile const signed short int __x5__CVs_1;
+static volatile const signed short int __x6__CVs_1;
+static volatile const signed short int __x7__CVs_1;
+static volatile const signed short int __x8__CVs_1;
 struct __anonymous0 {
-    int __i__i_1;
+    signed int __i__i_1;
 };
 static inline void ___constructor__F_R13s__anonymous0_autogen___1(struct __anonymous0 *___dst__R13s__anonymous0_1);
@@ -35,10 +35,10 @@
     return ((struct __anonymous0 )___ret__13s__anonymous0_1);
 }
-static inline void ___constructor__F_R13s__anonymous0i_autogen___1(struct __anonymous0 *___dst__R13s__anonymous0_1, int __i__i_1){
+static inline void ___constructor__F_R13s__anonymous0i_autogen___1(struct __anonymous0 *___dst__R13s__anonymous0_1, signed int __i__i_1){
     ((void)((*___dst__R13s__anonymous0_1).__i__i_1=__i__i_1) /* ?{} */);
 }
 volatile const struct __anonymous0 __x10__CV13s__anonymous0_1;
 struct __anonymous1 {
-    int __i__i_1;
+    signed int __i__i_1;
 };
 static inline void ___constructor__F_R13s__anonymous1_autogen___1(struct __anonymous1 *___dst__R13s__anonymous1_1);
@@ -61,10 +61,10 @@
     return ((struct __anonymous1 )___ret__13s__anonymous1_1);
 }
-static inline void ___constructor__F_R13s__anonymous1i_autogen___1(struct __anonymous1 *___dst__R13s__anonymous1_1, int __i__i_1){
+static inline void ___constructor__F_R13s__anonymous1i_autogen___1(struct __anonymous1 *___dst__R13s__anonymous1_1, signed int __i__i_1){
     ((void)((*___dst__R13s__anonymous1_1).__i__i_1=__i__i_1) /* ?{} */);
 }
 volatile const struct __anonymous1 __x11__CV13s__anonymous1_1;
 struct __anonymous2 {
-    int __i__i_1;
+    signed int __i__i_1;
 };
 static inline void ___constructor__F_R13s__anonymous2_autogen___1(struct __anonymous2 *___dst__R13s__anonymous2_1);
@@ -87,10 +87,10 @@
     return ((struct __anonymous2 )___ret__13s__anonymous2_1);
 }
-static inline void ___constructor__F_R13s__anonymous2i_autogen___1(struct __anonymous2 *___dst__R13s__anonymous2_1, int __i__i_1){
+static inline void ___constructor__F_R13s__anonymous2i_autogen___1(struct __anonymous2 *___dst__R13s__anonymous2_1, signed int __i__i_1){
     ((void)((*___dst__R13s__anonymous2_1).__i__i_1=__i__i_1) /* ?{} */);
 }
 volatile const struct __anonymous2 __x12__CV13s__anonymous2_1;
 struct __anonymous3 {
-    int __i__i_1;
+    signed int __i__i_1;
 };
 static inline void ___constructor__F_R13s__anonymous3_autogen___1(struct __anonymous3 *___dst__R13s__anonymous3_1);
@@ -113,10 +113,10 @@
     return ((struct __anonymous3 )___ret__13s__anonymous3_1);
 }
-static inline void ___constructor__F_R13s__anonymous3i_autogen___1(struct __anonymous3 *___dst__R13s__anonymous3_1, int __i__i_1){
+static inline void ___constructor__F_R13s__anonymous3i_autogen___1(struct __anonymous3 *___dst__R13s__anonymous3_1, signed int __i__i_1){
     ((void)((*___dst__R13s__anonymous3_1).__i__i_1=__i__i_1) /* ?{} */);
 }
 static volatile const struct __anonymous3 __x13__CV13s__anonymous3_1;
 struct __anonymous4 {
-    int __i__i_1;
+    signed int __i__i_1;
 };
 static inline void ___constructor__F_R13s__anonymous4_autogen___1(struct __anonymous4 *___dst__R13s__anonymous4_1);
@@ -139,10 +139,10 @@
     return ((struct __anonymous4 )___ret__13s__anonymous4_1);
 }
-static inline void ___constructor__F_R13s__anonymous4i_autogen___1(struct __anonymous4 *___dst__R13s__anonymous4_1, int __i__i_1){
+static inline void ___constructor__F_R13s__anonymous4i_autogen___1(struct __anonymous4 *___dst__R13s__anonymous4_1, signed int __i__i_1){
     ((void)((*___dst__R13s__anonymous4_1).__i__i_1=__i__i_1) /* ?{} */);
 }
 static volatile const struct __anonymous4 __x14__CV13s__anonymous4_1;
 struct __anonymous5 {
-    int __i__i_1;
+    signed int __i__i_1;
 };
 static inline void ___constructor__F_R13s__anonymous5_autogen___1(struct __anonymous5 *___dst__R13s__anonymous5_1);
@@ -165,10 +165,10 @@
     return ((struct __anonymous5 )___ret__13s__anonymous5_1);
 }
-static inline void ___constructor__F_R13s__anonymous5i_autogen___1(struct __anonymous5 *___dst__R13s__anonymous5_1, int __i__i_1){
+static inline void ___constructor__F_R13s__anonymous5i_autogen___1(struct __anonymous5 *___dst__R13s__anonymous5_1, signed int __i__i_1){
     ((void)((*___dst__R13s__anonymous5_1).__i__i_1=__i__i_1) /* ?{} */);
 }
 static volatile const struct __anonymous5 __x15__CV13s__anonymous5_1;
 struct __anonymous6 {
-    int __i__i_1;
+    signed int __i__i_1;
 };
 static inline void ___constructor__F_R13s__anonymous6_autogen___1(struct __anonymous6 *___dst__R13s__anonymous6_1);
@@ -191,10 +191,10 @@
     return ((struct __anonymous6 )___ret__13s__anonymous6_1);
 }
-static inline void ___constructor__F_R13s__anonymous6i_autogen___1(struct __anonymous6 *___dst__R13s__anonymous6_1, int __i__i_1){
+static inline void ___constructor__F_R13s__anonymous6i_autogen___1(struct __anonymous6 *___dst__R13s__anonymous6_1, signed int __i__i_1){
     ((void)((*___dst__R13s__anonymous6_1).__i__i_1=__i__i_1) /* ?{} */);
 }
 static volatile const struct __anonymous6 __x16__CV13s__anonymous6_1;
 struct __anonymous7 {
-    int __i__i_1;
+    signed int __i__i_1;
 };
 static inline void ___constructor__F_R13s__anonymous7_autogen___1(struct __anonymous7 *___dst__R13s__anonymous7_1);
@@ -217,18 +217,18 @@
     return ((struct __anonymous7 )___ret__13s__anonymous7_1);
 }
-static inline void ___constructor__F_R13s__anonymous7i_autogen___1(struct __anonymous7 *___dst__R13s__anonymous7_1, int __i__i_1){
+static inline void ___constructor__F_R13s__anonymous7i_autogen___1(struct __anonymous7 *___dst__R13s__anonymous7_1, signed int __i__i_1){
     ((void)((*___dst__R13s__anonymous7_1).__i__i_1=__i__i_1) /* ?{} */);
 }
 static volatile const struct __anonymous7 __x17__CV13s__anonymous7_1;
-volatile const short __x20__CVs_1;
-static volatile const short __x21__CVs_1;
-static volatile const short __x22__CVs_1;
-static volatile const short __x23__CVs_1;
-static volatile const short __x24__CVs_1;
-static volatile const short __x25__CVs_1;
-static volatile const short __x26__CVs_1;
-static volatile const short __x27__CVs_1;
+volatile const signed short int __x20__CVs_1;
+static volatile const signed short int __x21__CVs_1;
+static volatile const signed short int __x22__CVs_1;
+static volatile const signed short int __x23__CVs_1;
+static volatile const signed short int __x24__CVs_1;
+static volatile const signed short int __x25__CVs_1;
+static volatile const signed short int __x26__CVs_1;
+static volatile const signed short int __x27__CVs_1;
 struct __anonymous8 {
-    short __i__s_1;
+    signed short int __i__s_1;
 };
 static inline void ___constructor__F_R13s__anonymous8_autogen___1(struct __anonymous8 *___dst__R13s__anonymous8_1);
@@ -251,10 +251,10 @@
     return ((struct __anonymous8 )___ret__13s__anonymous8_1);
 }
-static inline void ___constructor__F_R13s__anonymous8s_autogen___1(struct __anonymous8 *___dst__R13s__anonymous8_1, short __i__s_1){
+static inline void ___constructor__F_R13s__anonymous8s_autogen___1(struct __anonymous8 *___dst__R13s__anonymous8_1, signed short int __i__s_1){
     ((void)((*___dst__R13s__anonymous8_1).__i__s_1=__i__s_1) /* ?{} */);
 }
 volatile const struct __anonymous8 __x29__CV13s__anonymous8_1;
 struct __anonymous9 {
-    short __i__s_1;
+    signed short int __i__s_1;
 };
 static inline void ___constructor__F_R13s__anonymous9_autogen___1(struct __anonymous9 *___dst__R13s__anonymous9_1);
@@ -277,10 +277,10 @@
     return ((struct __anonymous9 )___ret__13s__anonymous9_1);
 }
-static inline void ___constructor__F_R13s__anonymous9s_autogen___1(struct __anonymous9 *___dst__R13s__anonymous9_1, short __i__s_1){
+static inline void ___constructor__F_R13s__anonymous9s_autogen___1(struct __anonymous9 *___dst__R13s__anonymous9_1, signed short int __i__s_1){
     ((void)((*___dst__R13s__anonymous9_1).__i__s_1=__i__s_1) /* ?{} */);
 }
 volatile const struct __anonymous9 __x30__CV13s__anonymous9_1;
 struct __anonymous10 {
-    short __i__s_1;
+    signed short int __i__s_1;
 };
 static inline void ___constructor__F_R14s__anonymous10_autogen___1(struct __anonymous10 *___dst__R14s__anonymous10_1);
@@ -303,10 +303,10 @@
     return ((struct __anonymous10 )___ret__14s__anonymous10_1);
 }
-static inline void ___constructor__F_R14s__anonymous10s_autogen___1(struct __anonymous10 *___dst__R14s__anonymous10_1, short __i__s_1){
+static inline void ___constructor__F_R14s__anonymous10s_autogen___1(struct __anonymous10 *___dst__R14s__anonymous10_1, signed short int __i__s_1){
     ((void)((*___dst__R14s__anonymous10_1).__i__s_1=__i__s_1) /* ?{} */);
 }
 volatile const struct __anonymous10 __x31__CV14s__anonymous10_1;
 struct __anonymous11 {
-    short __i__s_1;
+    signed short int __i__s_1;
 };
 static inline void ___constructor__F_R14s__anonymous11_autogen___1(struct __anonymous11 *___dst__R14s__anonymous11_1);
@@ -329,10 +329,10 @@
     return ((struct __anonymous11 )___ret__14s__anonymous11_1);
 }
-static inline void ___constructor__F_R14s__anonymous11s_autogen___1(struct __anonymous11 *___dst__R14s__anonymous11_1, short __i__s_1){
+static inline void ___constructor__F_R14s__anonymous11s_autogen___1(struct __anonymous11 *___dst__R14s__anonymous11_1, signed short int __i__s_1){
     ((void)((*___dst__R14s__anonymous11_1).__i__s_1=__i__s_1) /* ?{} */);
 }
 static volatile const struct __anonymous11 __x32__CV14s__anonymous11_1;
 struct __anonymous12 {
-    short __i__s_1;
+    signed short int __i__s_1;
 };
 static inline void ___constructor__F_R14s__anonymous12_autogen___1(struct __anonymous12 *___dst__R14s__anonymous12_1);
@@ -355,10 +355,10 @@
     return ((struct __anonymous12 )___ret__14s__anonymous12_1);
 }
-static inline void ___constructor__F_R14s__anonymous12s_autogen___1(struct __anonymous12 *___dst__R14s__anonymous12_1, short __i__s_1){
+static inline void ___constructor__F_R14s__anonymous12s_autogen___1(struct __anonymous12 *___dst__R14s__anonymous12_1, signed short int __i__s_1){
     ((void)((*___dst__R14s__anonymous12_1).__i__s_1=__i__s_1) /* ?{} */);
 }
 static volatile const struct __anonymous12 __x33__CV14s__anonymous12_1;
 struct __anonymous13 {
-    short __i__s_1;
+    signed short int __i__s_1;
 };
 static inline void ___constructor__F_R14s__anonymous13_autogen___1(struct __anonymous13 *___dst__R14s__anonymous13_1);
@@ -381,10 +381,10 @@
     return ((struct __anonymous13 )___ret__14s__anonymous13_1);
 }
-static inline void ___constructor__F_R14s__anonymous13s_autogen___1(struct __anonymous13 *___dst__R14s__anonymous13_1, short __i__s_1){
+static inline void ___constructor__F_R14s__anonymous13s_autogen___1(struct __anonymous13 *___dst__R14s__anonymous13_1, signed short int __i__s_1){
     ((void)((*___dst__R14s__anonymous13_1).__i__s_1=__i__s_1) /* ?{} */);
 }
 static volatile const struct __anonymous13 __x34__CV14s__anonymous13_1;
 struct __anonymous14 {
-    short __i__s_1;
+    signed short int __i__s_1;
 };
 static inline void ___constructor__F_R14s__anonymous14_autogen___1(struct __anonymous14 *___dst__R14s__anonymous14_1);
@@ -407,10 +407,10 @@
     return ((struct __anonymous14 )___ret__14s__anonymous14_1);
 }
-static inline void ___constructor__F_R14s__anonymous14s_autogen___1(struct __anonymous14 *___dst__R14s__anonymous14_1, short __i__s_1){
+static inline void ___constructor__F_R14s__anonymous14s_autogen___1(struct __anonymous14 *___dst__R14s__anonymous14_1, signed short int __i__s_1){
     ((void)((*___dst__R14s__anonymous14_1).__i__s_1=__i__s_1) /* ?{} */);
 }
 static volatile const struct __anonymous14 __x35__CV14s__anonymous14_1;
 struct __anonymous15 {
-    short __i__s_1;
+    signed short int __i__s_1;
 };
 static inline void ___constructor__F_R14s__anonymous15_autogen___1(struct __anonymous15 *___dst__R14s__anonymous15_1);
@@ -433,26 +433,26 @@
     return ((struct __anonymous15 )___ret__14s__anonymous15_1);
 }
-static inline void ___constructor__F_R14s__anonymous15s_autogen___1(struct __anonymous15 *___dst__R14s__anonymous15_1, short __i__s_1){
+static inline void ___constructor__F_R14s__anonymous15s_autogen___1(struct __anonymous15 *___dst__R14s__anonymous15_1, signed short int __i__s_1){
     ((void)((*___dst__R14s__anonymous15_1).__i__s_1=__i__s_1) /* ?{} */);
 }
 static volatile const struct __anonymous15 __x36__CV14s__anonymous15_1;
-static inline volatile const int __f11__FCVi___1();
-static inline volatile const int __f12__FCVi___1();
-static inline volatile const int __f13__FCVi___1();
-static inline volatile const int __f14__FCVi___1();
-static inline volatile const int __f15__FCVi___1();
-static inline volatile const int __f16__FCVi___1();
-static inline volatile const int __f17__FCVi___1();
-static inline volatile const int __f18__FCVi___1();
-static inline volatile const short __f21__FCVs___1();
-static inline volatile const short __f22__FCVs___1();
-static inline volatile const short __f23__FCVs___1();
-static inline volatile const short __f24__FCVs___1();
-static inline volatile const short __f25__FCVs___1();
-static inline volatile const short __f26__FCVs___1();
-static inline volatile const short __f27__FCVs___1();
-static inline volatile const short __f28__FCVs___1();
+static inline volatile const signed int __f11__FCVi___1();
+static inline volatile const signed int __f12__FCVi___1();
+static inline volatile const signed int __f13__FCVi___1();
+static inline volatile const signed int __f14__FCVi___1();
+static inline volatile const signed int __f15__FCVi___1();
+static inline volatile const signed int __f16__FCVi___1();
+static inline volatile const signed int __f17__FCVi___1();
+static inline volatile const signed int __f18__FCVi___1();
+static inline volatile const signed short int __f21__FCVs___1();
+static inline volatile const signed short int __f22__FCVs___1();
+static inline volatile const signed short int __f23__FCVs___1();
+static inline volatile const signed short int __f24__FCVs___1();
+static inline volatile const signed short int __f25__FCVs___1();
+static inline volatile const signed short int __f26__FCVs___1();
+static inline volatile const signed short int __f27__FCVs___1();
+static inline volatile const signed short int __f28__FCVs___1();
 struct __anonymous16 {
-    int __i__i_1;
+    signed int __i__i_1;
 };
 static inline void ___constructor__F_R14s__anonymous16_autogen___1(struct __anonymous16 *___dst__R14s__anonymous16_1);
@@ -475,10 +475,10 @@
     return ((struct __anonymous16 )___ret__14s__anonymous16_1);
 }
-static inline void ___constructor__F_R14s__anonymous16i_autogen___1(struct __anonymous16 *___dst__R14s__anonymous16_1, int __i__i_1){
+static inline void ___constructor__F_R14s__anonymous16i_autogen___1(struct __anonymous16 *___dst__R14s__anonymous16_1, signed int __i__i_1){
     ((void)((*___dst__R14s__anonymous16_1).__i__i_1=__i__i_1) /* ?{} */);
 }
 static inline volatile const struct __anonymous16 __f31__FCV14s__anonymous16___1();
 struct __anonymous17 {
-    int __i__i_1;
+    signed int __i__i_1;
 };
 static inline void ___constructor__F_R14s__anonymous17_autogen___1(struct __anonymous17 *___dst__R14s__anonymous17_1);
@@ -501,10 +501,10 @@
     return ((struct __anonymous17 )___ret__14s__anonymous17_1);
 }
-static inline void ___constructor__F_R14s__anonymous17i_autogen___1(struct __anonymous17 *___dst__R14s__anonymous17_1, int __i__i_1){
+static inline void ___constructor__F_R14s__anonymous17i_autogen___1(struct __anonymous17 *___dst__R14s__anonymous17_1, signed int __i__i_1){
     ((void)((*___dst__R14s__anonymous17_1).__i__i_1=__i__i_1) /* ?{} */);
 }
 static inline volatile const struct __anonymous17 __f32__FCV14s__anonymous17___1();
 struct __anonymous18 {
-    int __i__i_1;
+    signed int __i__i_1;
 };
 static inline void ___constructor__F_R14s__anonymous18_autogen___1(struct __anonymous18 *___dst__R14s__anonymous18_1);
@@ -527,10 +527,10 @@
     return ((struct __anonymous18 )___ret__14s__anonymous18_1);
 }
-static inline void ___constructor__F_R14s__anonymous18i_autogen___1(struct __anonymous18 *___dst__R14s__anonymous18_1, int __i__i_1){
+static inline void ___constructor__F_R14s__anonymous18i_autogen___1(struct __anonymous18 *___dst__R14s__anonymous18_1, signed int __i__i_1){
     ((void)((*___dst__R14s__anonymous18_1).__i__i_1=__i__i_1) /* ?{} */);
 }
 static inline volatile const struct __anonymous18 __f33__FCV14s__anonymous18___1();
 struct __anonymous19 {
-    int __i__i_1;
+    signed int __i__i_1;
 };
 static inline void ___constructor__F_R14s__anonymous19_autogen___1(struct __anonymous19 *___dst__R14s__anonymous19_1);
@@ -553,10 +553,10 @@
     return ((struct __anonymous19 )___ret__14s__anonymous19_1);
 }
-static inline void ___constructor__F_R14s__anonymous19i_autogen___1(struct __anonymous19 *___dst__R14s__anonymous19_1, int __i__i_1){
+static inline void ___constructor__F_R14s__anonymous19i_autogen___1(struct __anonymous19 *___dst__R14s__anonymous19_1, signed int __i__i_1){
     ((void)((*___dst__R14s__anonymous19_1).__i__i_1=__i__i_1) /* ?{} */);
 }
 static inline volatile const struct __anonymous19 __f34__FCV14s__anonymous19___1();
 struct __anonymous20 {
-    int __i__i_1;
+    signed int __i__i_1;
 };
 static inline void ___constructor__F_R14s__anonymous20_autogen___1(struct __anonymous20 *___dst__R14s__anonymous20_1);
@@ -579,10 +579,10 @@
     return ((struct __anonymous20 )___ret__14s__anonymous20_1);
 }
-static inline void ___constructor__F_R14s__anonymous20i_autogen___1(struct __anonymous20 *___dst__R14s__anonymous20_1, int __i__i_1){
+static inline void ___constructor__F_R14s__anonymous20i_autogen___1(struct __anonymous20 *___dst__R14s__anonymous20_1, signed int __i__i_1){
     ((void)((*___dst__R14s__anonymous20_1).__i__i_1=__i__i_1) /* ?{} */);
 }
 static inline volatile const struct __anonymous20 __f35__FCV14s__anonymous20___1();
 struct __anonymous21 {
-    int __i__i_1;
+    signed int __i__i_1;
 };
 static inline void ___constructor__F_R14s__anonymous21_autogen___1(struct __anonymous21 *___dst__R14s__anonymous21_1);
@@ -605,10 +605,10 @@
     return ((struct __anonymous21 )___ret__14s__anonymous21_1);
 }
-static inline void ___constructor__F_R14s__anonymous21i_autogen___1(struct __anonymous21 *___dst__R14s__anonymous21_1, int __i__i_1){
+static inline void ___constructor__F_R14s__anonymous21i_autogen___1(struct __anonymous21 *___dst__R14s__anonymous21_1, signed int __i__i_1){
     ((void)((*___dst__R14s__anonymous21_1).__i__i_1=__i__i_1) /* ?{} */);
 }
 static inline volatile const struct __anonymous21 __f36__FCV14s__anonymous21___1();
 struct __anonymous22 {
-    int __i__i_1;
+    signed int __i__i_1;
 };
 static inline void ___constructor__F_R14s__anonymous22_autogen___1(struct __anonymous22 *___dst__R14s__anonymous22_1);
@@ -631,10 +631,10 @@
     return ((struct __anonymous22 )___ret__14s__anonymous22_1);
 }
-static inline void ___constructor__F_R14s__anonymous22i_autogen___1(struct __anonymous22 *___dst__R14s__anonymous22_1, int __i__i_1){
+static inline void ___constructor__F_R14s__anonymous22i_autogen___1(struct __anonymous22 *___dst__R14s__anonymous22_1, signed int __i__i_1){
     ((void)((*___dst__R14s__anonymous22_1).__i__i_1=__i__i_1) /* ?{} */);
 }
 static inline volatile const struct __anonymous22 __f37__FCV14s__anonymous22___1();
 struct __anonymous23 {
-    int __i__i_1;
+    signed int __i__i_1;
 };
 static inline void ___constructor__F_R14s__anonymous23_autogen___1(struct __anonymous23 *___dst__R14s__anonymous23_1);
@@ -657,22 +657,22 @@
     return ((struct __anonymous23 )___ret__14s__anonymous23_1);
 }
-static inline void ___constructor__F_R14s__anonymous23i_autogen___1(struct __anonymous23 *___dst__R14s__anonymous23_1, int __i__i_1){
+static inline void ___constructor__F_R14s__anonymous23i_autogen___1(struct __anonymous23 *___dst__R14s__anonymous23_1, signed int __i__i_1){
     ((void)((*___dst__R14s__anonymous23_1).__i__i_1=__i__i_1) /* ?{} */);
 }
 static inline volatile const struct __anonymous23 __f38__FCV14s__anonymous23___1();
-static inline volatile const short __f41__FCVs___1();
-static inline volatile const short __f42__FCVs___1();
-static inline volatile const short __f43__FCVs___1();
-static inline volatile const short __f44__FCVs___1();
-static inline volatile const short __f45__FCVs___1();
-static inline volatile const short __f46__FCVs___1();
-static inline volatile const short __f47__FCVs___1();
-static inline volatile const short __f48__FCVs___1();
-int __main__Fi_iPPCc__1(int __argc__i_1, const char **__argv__PPCc_1){
-    __attribute__ ((unused)) int ___retval_main__i_1;
-    ((void)(___retval_main__i_1=((int )0)) /* ?{} */);
-    return ((int )___retval_main__i_1);
+static inline volatile const signed short int __f41__FCVs___1();
+static inline volatile const signed short int __f42__FCVs___1();
+static inline volatile const signed short int __f43__FCVs___1();
+static inline volatile const signed short int __f44__FCVs___1();
+static inline volatile const signed short int __f45__FCVs___1();
+static inline volatile const signed short int __f46__FCVs___1();
+static inline volatile const signed short int __f47__FCVs___1();
+static inline volatile const signed short int __f48__FCVs___1();
+signed int __main__Fi_iPPCc__1(signed int __argc__i_1, const char **__argv__PPCc_1){
+    __attribute__ ((unused)) signed int ___retval_main__i_1;
+    ((void)(___retval_main__i_1=((signed int )0)) /* ?{} */);
+    return ((signed int )___retval_main__i_1);
     ((void)(___retval_main__i_1=0) /* ?{} */);
-    return ((int )___retval_main__i_1);
+    return ((signed int )___retval_main__i_1);
 }
 static inline int invoke_main(int argc, char* argv[], char* envp[]) { (void)argc; (void)argv; (void)envp; return __main__Fi_iPPCc__1(argc, argv); }
@@ -680,13 +680,13 @@
 __attribute__ ((__nothrow__,__leaf__)) extern void free(void *__ptr);
 __attribute__ ((__nothrow__,__leaf__,__noreturn__)) extern void abort(void);
-__attribute__ ((__nothrow__,__leaf__,__nonnull__(1))) extern int atexit(void (*__func)(void));
-__attribute__ ((__nothrow__,__leaf__,__noreturn__)) extern void exit(int __status);
-extern int printf(const char *__restrict __format, ...);
-static inline int invoke_main(int argc, char **argv, char **envp);
-int main(int __argc__i_1, char **__argv__PPc_1, char **__envp__PPc_1){
-    __attribute__ ((unused)) int ___retval_main__i_1;
-    int _tmp_cp_ret0;
+__attribute__ ((__nothrow__,__leaf__,__nonnull__(1))) extern signed int atexit(void (*__func)(void));
+__attribute__ ((__nothrow__,__leaf__,__noreturn__)) extern void exit(signed int __status);
+extern signed int printf(const char *__restrict __format, ...);
+static inline signed int invoke_main(signed int argc, char **argv, char **envp);
+signed int main(signed int __argc__i_1, char **__argv__PPc_1, char **__envp__PPc_1){
+    __attribute__ ((unused)) signed int ___retval_main__i_1;
+    signed int _tmp_cp_ret0;
     ((void)(___retval_main__i_1=(((void)(_tmp_cp_ret0=invoke_main(__argc__i_1, __argv__PPc_1, __envp__PPc_1))) , _tmp_cp_ret0)) /* ?{} */);
     ((void)(_tmp_cp_ret0) /* ^?{} */);
-    return ((int )___retval_main__i_1);
-}
+    return ((signed int )___retval_main__i_1);
+}
Index: src/tests/.expect/32/extension.txt
===================================================================
--- src/tests/.expect/32/extension.txt	(revision d130fe87f4cdf82b08c0879a57d7bae53c7644a2)
+++ src/tests/.expect/32/extension.txt	(revision ba54f7dba922f0df27eebfcc9c67f07969df7db4)
@@ -2,14 +2,14 @@
 __attribute__ ((__nothrow__,__leaf__)) extern void free(void *__ptr);
 __attribute__ ((__nothrow__,__leaf__,__noreturn__)) extern void abort(void);
-__attribute__ ((__nothrow__,__leaf__,__nonnull__(1))) extern int atexit(void (*__func)(void));
-__attribute__ ((__nothrow__,__leaf__,__noreturn__)) extern void exit(int __status);
-extern int printf(const char *__restrict __format, ...);
-__extension__ int __a__i_1;
-__extension__ int __b__i_1;
-__extension__ int __c__i_1;
+__attribute__ ((__nothrow__,__leaf__,__nonnull__(1))) extern signed int atexit(void (*__func)(void));
+__attribute__ ((__nothrow__,__leaf__,__noreturn__)) extern void exit(signed int __status);
+extern signed int printf(const char *__restrict __format, ...);
+__extension__ signed int __a__i_1;
+__extension__ signed int __b__i_1;
+__extension__ signed int __c__i_1;
 __extension__ struct S {
-    __extension__ int __a__i_1;
-    __extension__ int __b__i_1;
-    __extension__ int __c__i_1;
+    __extension__ signed int __a__i_1;
+    __extension__ signed int __b__i_1;
+    __extension__ signed int __c__i_1;
 };
 static inline void ___constructor__F_R2sS_autogen___1(struct S *___dst__R2sS_1);
@@ -40,15 +40,15 @@
     return ((struct S )___ret__2sS_1);
 }
-static inline void ___constructor__F_R2sSi_autogen___1(struct S *___dst__R2sS_1, int __a__i_1){
+static inline void ___constructor__F_R2sSi_autogen___1(struct S *___dst__R2sS_1, signed int __a__i_1){
     ((void)((*___dst__R2sS_1).__a__i_1=__a__i_1) /* ?{} */);
     ((void)((*___dst__R2sS_1).__b__i_1) /* ?{} */);
     ((void)((*___dst__R2sS_1).__c__i_1) /* ?{} */);
 }
-static inline void ___constructor__F_R2sSii_autogen___1(struct S *___dst__R2sS_1, int __a__i_1, int __b__i_1){
+static inline void ___constructor__F_R2sSii_autogen___1(struct S *___dst__R2sS_1, signed int __a__i_1, signed int __b__i_1){
     ((void)((*___dst__R2sS_1).__a__i_1=__a__i_1) /* ?{} */);
     ((void)((*___dst__R2sS_1).__b__i_1=__b__i_1) /* ?{} */);
     ((void)((*___dst__R2sS_1).__c__i_1) /* ?{} */);
 }
-static inline void ___constructor__F_R2sSiii_autogen___1(struct S *___dst__R2sS_1, int __a__i_1, int __b__i_1, int __c__i_1){
+static inline void ___constructor__F_R2sSiii_autogen___1(struct S *___dst__R2sS_1, signed int __a__i_1, signed int __b__i_1, signed int __c__i_1){
     ((void)((*___dst__R2sS_1).__a__i_1=__a__i_1) /* ?{} */);
     ((void)((*___dst__R2sS_1).__b__i_1=__b__i_1) /* ?{} */);
@@ -56,7 +56,7 @@
 }
 __extension__ union U {
-    __extension__ int __a__i_1;
-    __extension__ int __b__i_1;
-    __extension__ int __c__i_1;
+    __extension__ signed int __a__i_1;
+    __extension__ signed int __b__i_1;
+    __extension__ signed int __c__i_1;
 };
 static inline void ___constructor__F_R2uU_autogen___1(__attribute__ ((unused)) union U *___dst__R2uU_1){
@@ -73,6 +73,6 @@
     return ((union U )___ret__2uU_1);
 }
-static inline void ___constructor__F_R2uUi_autogen___1(__attribute__ ((unused)) union U *___dst__R2uU_1, int __src__i_1){
-    ((void)__builtin_memcpy(((void *)___dst__R2uU_1), ((const void *)(&__src__i_1)), sizeof(int )));
+static inline void ___constructor__F_R2uUi_autogen___1(__attribute__ ((unused)) union U *___dst__R2uU_1, signed int __src__i_1){
+    ((void)__builtin_memcpy(((void *)___dst__R2uU_1), ((const void *)(&__src__i_1)), sizeof(signed int )));
 }
 __extension__ enum E {
@@ -81,35 +81,35 @@
     __B__C2eE_1,
 };
-__extension__ int __f__Fi___1();
-__extension__ int i;
-__extension__ int j;
-__extension__ int __fred__Fi_i__1(int __p__i_1){
-    __attribute__ ((unused)) int ___retval_fred__i_1;
+__extension__ signed int __f__Fi___1();
+__extension__ signed int i;
+__extension__ signed int j;
+__extension__ signed int __fred__Fi_i__1(signed int __p__i_1){
+    __attribute__ ((unused)) signed int ___retval_fred__i_1;
     __extension__ struct S {
-        __extension__ int __a__i_2;
-        __extension__ int __b__i_2;
-        __extension__ int __c__i_2;
-        __extension__ int *__x__Pi_2;
-        __extension__ int *__y__Pi_2;
-        __extension__ int *__z__Pi_2;
+        __extension__ signed int __a__i_2;
+        __extension__ signed int __b__i_2;
+        __extension__ signed int __c__i_2;
+        __extension__ signed int *__x__Pi_2;
+        __extension__ signed int *__y__Pi_2;
+        __extension__ signed int *__z__Pi_2;
     };
-    int __i__i_2 = ((int )(__extension__ __a__i_1+__extension__ 3));
+    signed int __i__i_2 = ((signed int )(__extension__ __a__i_1+__extension__ 3));
     ((void)__extension__ 3);
     ((void)__extension__ __a__i_1);
-    __extension__ int __a__i_2;
-    __extension__ int __b__i_2;
-    __extension__ int __c__i_2;
+    __extension__ signed int __a__i_2;
+    __extension__ signed int __b__i_2;
+    __extension__ signed int __c__i_2;
     ((void)(__extension__ __a__i_2=(__extension__ __b__i_2+__extension__ __c__i_2)));
-    int _tmp_cp_ret0;
+    signed int _tmp_cp_ret0;
     ((void)(((void)(_tmp_cp_ret0=__extension__ __fred__Fi_i__1(3))) , _tmp_cp_ret0));
     ((void)(_tmp_cp_ret0) /* ^?{} */);
-    __extension__ int __mary__Fi_i__2(int __p__i_2){
-        __attribute__ ((unused)) int ___retval_mary__i_2;
+    __extension__ signed int __mary__Fi_i__2(signed int __p__i_2){
+        __attribute__ ((unused)) signed int ___retval_mary__i_2;
     }
     ((void)__extension__ sizeof(3));
-    ((void)__extension__ (((int )(3!=((int )0))) || ((int )(4!=((int )0)))));
+    ((void)__extension__ (((signed int )(3!=((signed int )0))) || ((signed int )(4!=((signed int )0)))));
     ((void)__extension__ __alignof__(__extension__ __a__i_2));
-    ((void)(((int )(__extension__ __a__i_2!=((int )0))) || ((int )((((int )(__extension__ __b__i_2!=((int )0))) && ((int )(__extension__ __c__i_2!=((int )0))))!=((int )0)))));
-    ((void)(((int )((__extension__ __a__i_2>__extension__ __b__i_2)!=((int )0))) ? __extension__ __c__i_2 : __extension__ __c__i_2));
+    ((void)(((signed int )(__extension__ __a__i_2!=((signed int )0))) || ((signed int )((((signed int )(__extension__ __b__i_2!=((signed int )0))) && ((signed int )(__extension__ __c__i_2!=((signed int )0))))!=((signed int )0)))));
+    ((void)(((signed int )((__extension__ __a__i_2>__extension__ __b__i_2)!=((signed int )0))) ? __extension__ __c__i_2 : __extension__ __c__i_2));
     ((void)(__extension__ __a__i_2=__extension__ (__extension__ __b__i_2+__extension__ __c__i_2)));
     ((void)(((void)(((void)__extension__ __a__i_2) , __extension__ __b__i_2)) , __extension__ __c__i_2));
Index: src/tests/.expect/32/gccExtensions.txt
===================================================================
--- src/tests/.expect/32/gccExtensions.txt	(revision d130fe87f4cdf82b08c0879a57d7bae53c7644a2)
+++ src/tests/.expect/32/gccExtensions.txt	(revision ba54f7dba922f0df27eebfcc9c67f07969df7db4)
@@ -2,44 +2,44 @@
 __attribute__ ((__nothrow__,__leaf__)) extern void free(void *__ptr);
 __attribute__ ((__nothrow__,__leaf__,__noreturn__)) extern void abort(void);
-__attribute__ ((__nothrow__,__leaf__,__nonnull__(1))) extern int atexit(void (*__func)(void));
-__attribute__ ((__nothrow__,__leaf__,__noreturn__)) extern void exit(int __status);
-extern int printf(const char *__restrict __format, ...);
-extern int __x__i_1 asm ( "xx" );
-int __main__Fi_iPPCc__1(int __argc__i_1, const char **__argv__PPCc_1){
-    __attribute__ ((unused)) int ___retval_main__i_1;
+__attribute__ ((__nothrow__,__leaf__,__nonnull__(1))) extern signed int atexit(void (*__func)(void));
+__attribute__ ((__nothrow__,__leaf__,__noreturn__)) extern void exit(signed int __status);
+extern signed int printf(const char *__restrict __format, ...);
+extern signed int __x__i_1 asm ( "xx" );
+signed int __main__Fi_iPPCc__1(signed int __argc__i_1, const char **__argv__PPCc_1){
+    __attribute__ ((unused)) signed int ___retval_main__i_1;
     asm ( "nop" :  :  :  );
     asm ( "nop" :  :  :  );
     asm ( "nop" :  :  :  );
-    static int __y__i_2 asm ( "yy" );
-    static int *__z__Pi_2 asm ( "zz" );
-    int __src__i_2;
-    int __dst__i_2;
-    asm volatile ( "mov %1, %0\n\tadd $1, %0" :  :  :  );
-    asm volatile ( "mov %1, %0\n\tadd $1, %0" : "=r" ( __dst__i_2 ) :  :  );
-    asm volatile ( "mov %1, %0\n\tadd $1, %0" : "=r" ( __dst__i_2 ) : "r" ( __src__i_2 ) :  );
-    asm ( "mov %1, %0\n\tadd $1, %0" : "=r" ( __dst__i_2 ), "=r" ( __src__i_2 ) : [ __src__i_2 ] "r" ( __dst__i_2 ) : "r0" );
+    static signed int __y__i_2 asm ( "yy" );
+    static signed int *__z__Pi_2 asm ( "zz" );
+    signed int __src__i_2;
+    signed int __dst__i_2;
+    asm volatile ( "mov %1, %0\n\t" "add $1, %0" :  :  :  );
+    asm volatile ( "mov %1, %0\n\t" "add $1, %0" : "=" "r" ( __dst__i_2 ) :  :  );
+    asm volatile ( "mov %1, %0\n\t" "add $1, %0" : "=r" ( __dst__i_2 ) : "r" ( __src__i_2 ) :  );
+    asm ( "mov %1, %0\n\t" "add $1, %0" : "=r" ( __dst__i_2 ), "=r" ( __src__i_2 ) : [ __src__i_2 ] "r" ( __dst__i_2 ) : "r0" );
     L2: L1: asm goto ( "frob %%r5, %1; jc %l[L1]; mov (%2), %%r5" :  : "r" ( __src__i_2 ), "r" ( (&__dst__i_2) ) : "r5", "memory" : L1, L2 );
     double _Complex __c1__Xd_2;
     double _Complex __c2__Xd_2;
-    const int __i1__Ci_2;
-    const int __i2__Ci_2;
-    const int __i3__Ci_2;
-    inline int __f1__Fi___2(){
-        __attribute__ ((unused)) int ___retval_f1__i_2;
+    const signed int __i1__Ci_2;
+    const signed int __i2__Ci_2;
+    const signed int __i3__Ci_2;
+    inline signed int __f1__Fi___2(){
+        __attribute__ ((unused)) signed int ___retval_f1__i_2;
     }
-    inline int __f2__Fi___2(){
-        __attribute__ ((unused)) int ___retval_f2__i_2;
+    inline signed int __f2__Fi___2(){
+        __attribute__ ((unused)) signed int ___retval_f2__i_2;
     }
-    int __s1__i_2;
-    int __s2__i_2;
-    volatile int __v1__Vi_2;
-    volatile int __v2__Vi_2;
-    int __t1___2;
-    int __t2___2;
-    __extension__ const int __ex__Ci_2;
+    signed int __s1__i_2;
+    signed int __s2__i_2;
+    volatile signed int __v1__Vi_2;
+    volatile signed int __v2__Vi_2;
+    signed int __t1___2;
+    signed int __t2___2;
+    __extension__ const signed int __ex__Ci_2;
     struct S {
-        __extension__ int __a__i_2;
-        __extension__ int __b__i_2;
-        __extension__ int __c__i_2;
+        __extension__ signed int __a__i_2;
+        __extension__ signed int __b__i_2;
+        __extension__ signed int __c__i_2;
     };
     inline void ___constructor__F_R2sS_autogen___2(struct S *___dst__R2sS_2){
@@ -66,38 +66,38 @@
         return ((struct S )___ret__2sS_2);
     }
-    inline void ___constructor__F_R2sSi_autogen___2(struct S *___dst__R2sS_2, int __a__i_2){
+    inline void ___constructor__F_R2sSi_autogen___2(struct S *___dst__R2sS_2, signed int __a__i_2){
         ((void)((*___dst__R2sS_2).__a__i_2=__a__i_2) /* ?{} */);
         ((void)((*___dst__R2sS_2).__b__i_2) /* ?{} */);
         ((void)((*___dst__R2sS_2).__c__i_2) /* ?{} */);
     }
-    inline void ___constructor__F_R2sSii_autogen___2(struct S *___dst__R2sS_2, int __a__i_2, int __b__i_2){
+    inline void ___constructor__F_R2sSii_autogen___2(struct S *___dst__R2sS_2, signed int __a__i_2, signed int __b__i_2){
         ((void)((*___dst__R2sS_2).__a__i_2=__a__i_2) /* ?{} */);
         ((void)((*___dst__R2sS_2).__b__i_2=__b__i_2) /* ?{} */);
         ((void)((*___dst__R2sS_2).__c__i_2) /* ?{} */);
     }
-    inline void ___constructor__F_R2sSiii_autogen___2(struct S *___dst__R2sS_2, int __a__i_2, int __b__i_2, int __c__i_2){
+    inline void ___constructor__F_R2sSiii_autogen___2(struct S *___dst__R2sS_2, signed int __a__i_2, signed int __b__i_2, signed int __c__i_2){
         ((void)((*___dst__R2sS_2).__a__i_2=__a__i_2) /* ?{} */);
         ((void)((*___dst__R2sS_2).__b__i_2=__b__i_2) /* ?{} */);
         ((void)((*___dst__R2sS_2).__c__i_2=__c__i_2) /* ?{} */);
     }
-    int __i__i_2 = ((int )__extension__ 3);
-    __extension__ int __a__i_2;
-    __extension__ int __b__i_2;
-    __extension__ int __c__i_2;
+    signed int __i__i_2 = ((signed int )__extension__ 3);
+    __extension__ signed int __a__i_2;
+    __extension__ signed int __b__i_2;
+    __extension__ signed int __c__i_2;
     ((void)(((void)(((void)__extension__ __a__i_2) , __extension__ __b__i_2)) , __extension__ __c__i_2));
     ((void)(__extension__ __a__i_2=(__extension__ __b__i_2+__extension__ __c__i_2)));
     ((void)(__extension__ __a__i_2=__extension__ (__extension__ __b__i_2+__extension__ __c__i_2)));
-    int __a1__i_2;
-    const int __a2__Ci_2;
-    static const int __a3__Ci_2;
-    static const int __a4__Ci_2;
-    static const int __a5__Ci_2;
-    static const int __a6__Ci_2;
-    static const int __a7__Ci_2;
-    int *__p1__Pi_2;
-    int *__p2__Pi_2;
+    signed int __a1__i_2;
+    const signed int __a2__Ci_2;
+    static const signed int __a3__Ci_2;
+    static const signed int __a4__Ci_2;
+    static const signed int __a5__Ci_2;
+    static const signed int __a6__Ci_2;
+    static const signed int __a7__Ci_2;
+    signed int *__p1__Pi_2;
+    signed int *__p2__Pi_2;
     struct s1;
     struct s2 {
-        int __i__i_2;
+        signed int __i__i_2;
     };
     inline void ___constructor__F_R3ss2_autogen___2(struct s2 *___dst__R3ss2_2){
@@ -116,9 +116,9 @@
         return ((struct s2 )___ret__3ss2_2);
     }
-    inline void ___constructor__F_R3ss2i_autogen___2(struct s2 *___dst__R3ss2_2, int __i__i_2){
+    inline void ___constructor__F_R3ss2i_autogen___2(struct s2 *___dst__R3ss2_2, signed int __i__i_2){
         ((void)((*___dst__R3ss2_2).__i__i_2=__i__i_2) /* ?{} */);
     }
     struct s3 {
-        int __i__i_2;
+        signed int __i__i_2;
     };
     inline void ___constructor__F_R3ss3_autogen___2(struct s3 *___dst__R3ss3_2){
@@ -137,5 +137,5 @@
         return ((struct s3 )___ret__3ss3_2);
     }
-    inline void ___constructor__F_R3ss3i_autogen___2(struct s3 *___dst__R3ss3_2, int __i__i_2){
+    inline void ___constructor__F_R3ss3i_autogen___2(struct s3 *___dst__R3ss3_2, signed int __i__i_2){
         ((void)((*___dst__R3ss3_2).__i__i_2=__i__i_2) /* ?{} */);
     }
@@ -143,5 +143,5 @@
     struct s3 __y1__3ss3_2;
     struct s4 {
-        int __i__i_2;
+        signed int __i__i_2;
     };
     inline void ___constructor__F_R3ss4_autogen___2(struct s4 *___dst__R3ss4_2){
@@ -160,16 +160,16 @@
         return ((struct s4 )___ret__3ss4_2);
     }
-    inline void ___constructor__F_R3ss4i_autogen___2(struct s4 *___dst__R3ss4_2, int __i__i_2){
+    inline void ___constructor__F_R3ss4i_autogen___2(struct s4 *___dst__R3ss4_2, signed int __i__i_2){
         ((void)((*___dst__R3ss4_2).__i__i_2=__i__i_2) /* ?{} */);
     }
     struct s4 __x2__3ss4_2;
     struct s4 __y2__3ss4_2;
-    int __m1__A0i_2[((unsigned int )10)];
-    int __m2__A0A0i_2[((unsigned int )10)][((unsigned int )10)];
-    int __m3__A0A0i_2[((unsigned int )10)][((unsigned int )10)];
-    ((void)(___retval_main__i_1=((int )0)) /* ?{} */);
-    return ((int )___retval_main__i_1);
+    signed int __m1__A0i_2[((unsigned int )10)];
+    signed int __m2__A0A0i_2[((unsigned int )10)][((unsigned int )10)];
+    signed int __m3__A0A0i_2[((unsigned int )10)][((unsigned int )10)];
+    ((void)(___retval_main__i_1=((signed int )0)) /* ?{} */);
+    return ((signed int )___retval_main__i_1);
     ((void)(___retval_main__i_1=0) /* ?{} */);
-    return ((int )___retval_main__i_1);
+    return ((signed int )___retval_main__i_1);
 }
 static inline int invoke_main(int argc, char* argv[], char* envp[]) { (void)argc; (void)argv; (void)envp; return __main__Fi_iPPCc__1(argc, argv); }
@@ -177,13 +177,13 @@
 __attribute__ ((__nothrow__,__leaf__)) extern void free(void *__ptr);
 __attribute__ ((__nothrow__,__leaf__,__noreturn__)) extern void abort(void);
-__attribute__ ((__nothrow__,__leaf__,__nonnull__(1))) extern int atexit(void (*__func)(void));
-__attribute__ ((__nothrow__,__leaf__,__noreturn__)) extern void exit(int __status);
-extern int printf(const char *__restrict __format, ...);
-static inline int invoke_main(int argc, char **argv, char **envp);
-int main(int __argc__i_1, char **__argv__PPc_1, char **__envp__PPc_1){
-    __attribute__ ((unused)) int ___retval_main__i_1;
-    int _tmp_cp_ret0;
+__attribute__ ((__nothrow__,__leaf__,__nonnull__(1))) extern signed int atexit(void (*__func)(void));
+__attribute__ ((__nothrow__,__leaf__,__noreturn__)) extern void exit(signed int __status);
+extern signed int printf(const char *__restrict __format, ...);
+static inline signed int invoke_main(signed int argc, char **argv, char **envp);
+signed int main(signed int __argc__i_1, char **__argv__PPc_1, char **__envp__PPc_1){
+    __attribute__ ((unused)) signed int ___retval_main__i_1;
+    signed int _tmp_cp_ret0;
     ((void)(___retval_main__i_1=(((void)(_tmp_cp_ret0=invoke_main(__argc__i_1, __argv__PPc_1, __envp__PPc_1))) , _tmp_cp_ret0)) /* ?{} */);
     ((void)(_tmp_cp_ret0) /* ^?{} */);
-    return ((int )___retval_main__i_1);
+    return ((signed int )___retval_main__i_1);
 }
Index: src/tests/sched-ext-parse.c
===================================================================
--- src/tests/sched-ext-parse.c	(revision ba54f7dba922f0df27eebfcc9c67f07969df7db4)
+++ src/tests/sched-ext-parse.c	(revision ba54f7dba922f0df27eebfcc9c67f07969df7db4)
@@ -0,0 +1,95 @@
+#include <monitor>
+
+monitor M {};
+
+M a;
+
+void f1( M & mutex a );
+void f2( M & mutex a );
+void f2( M & mutex a, M & mutex b );
+void f3( M & mutex a );
+void f3( M & mutex a, M & mutex b );
+void f3( M & mutex a, M & mutex b, M & mutex c );
+
+void foo() {
+
+	//---------------------------------------
+	waitfor( f1, a ) {
+		1;
+	}
+
+	//---------------------------------------
+	waitfor( f1, a ) {
+		2;
+	}
+	waitfor( f2, a ) {
+		3;
+	}
+
+	//---------------------------------------
+	when( 1 < 3 ) waitfor( f2, a, a ) {
+		4;
+	}
+	or timeout( 100 ) {
+		5;
+	}
+
+	//---------------------------------------
+	when( 2 < 3 ) waitfor( f3, a ) {
+		5;
+	}
+	or else {
+		6;
+	}
+
+	//---------------------------------------
+	when( 3 < 3 ) waitfor( f3, a, a ) {
+		7;
+	}
+	or when( 4 < 3 ) timeout( 101 ) {
+		8;
+	}
+	or when( 5 < 3 ) else {
+		9;
+	}
+
+	//---------------------------------------
+	when( 6 < 3 ) waitfor( f3, a, a, a ) {
+		10;
+	}
+ 	or when( 7 < 3 ) waitfor( f1, a  ) {
+		11;
+	}
+	or else {
+		12;
+	}
+
+	//---------------------------------------
+	when( 8 < 3 ) waitfor( f3, a, a ) {
+		13;
+	}
+ 	or waitfor( f1, a  ) {
+		14;
+	}
+	or when( 9 < 3 ) timeout( 102 ) {
+		15;
+	}
+
+	//---------------------------------------
+	when( 10 < 3 ) waitfor( f1, a ) {
+		16;
+	}
+ 	or waitfor( f1, a, a ) {
+		17;
+	}
+	or timeout( 103 ) {
+		18;
+	}
+	or when( 11 < 3 ) else {
+		19;
+	}
+}
+
+int main() {
+
+}
