src/Concurrency/Keywords.cc
void ConcurrentSueKeyword::addRoutines( ObjectDecl * field, FunctionDecl * func ) {
		CompoundStmt * statement = new CompoundStmt();
		statement->push_back(
			new ReturnStmt(
				new AddressExpr(
					new MemberExpr(
						field,
						new CastExpr(
							new VariableExpr( func->get_functionType()->get_parameters().front() ),
							func->get_functionType()->get_parameters().front()->get_type()->stripReferences()->clone(),
							false
						)
					)
				)
			)
		);

		FunctionDecl * get_decl = func->clone();

		get_decl->set_statements( statement );

		declsToAddAfter.push_back( get_decl );
	}
// This function adds the get_.* routine body for coroutines, monitors etc
// 		after their corresponding struct has been made
This function adds the get_.* routine body for coroutines, monitors etc
after their corresponding struct has been made
This function adds the get_ . * routine body for coroutines monitors etc after their corresponding struct has been made
void ConcurrentSueKeyword::addRoutines( ObjectDecl * field, FunctionDecl * func ) {
		CompoundStmt * statement = new CompoundStmt();
		statement->push_back(
			new ReturnStmt(
				new AddressExpr(
					new MemberExpr(
						field,
						new CastExpr(
							new VariableExpr( func->get_functionType()->get_parameters().front() ),
							func->get_functionType()->get_parameters().front()->get_type()->stripReferences()->clone(),
							false
						)
					)
				)
			)
		);
		FunctionDecl * get_decl = func->clone();
		get_decl->set_statements( statement );
		declsToAddAfter.push_back( get_decl );
	}
void ConcurrentSueKeyword :: addRoutines ( ObjectDecl * field , FunctionDecl * func ) { CompoundStmt * statement = new CompoundStmt ( ) ; statement -> push_back ( new ReturnStmt ( new AddressExpr ( new MemberExpr ( field , new CastExpr ( new VariableExpr ( func -> get_functionType ( ) -> get_parameters ( ) . front ( ) ) , func -> get_functionType ( ) -> get_parameters ( ) . front ( ) -> get_type ( ) -> stripReferences ( ) -> clone ( ) , false ) ) ) ) ) ; FunctionDecl * get_decl = func -> clone ( ) ; get_decl -> set_statements ( statement ) ; declsToAddAfter . push_back ( get_decl ) ; }
This function adds the get_.
This function adds the get_ .