mcast_comm::quote_messages_processor*
    mcast_comm::quote_messages_processor::get_parser(const std::string& msg)
{
  if (is_parseable(msg))
    return this;
  return next_ != NULL ? next_->get_parser(msg) : NULL;
}
Example #2
0
void get_static_heuristic(){

	start_pass("heuristic");

	make_initial_bc();

	if(!is_parseable()){
		end_pass("heuristic");
		return;
	}

	stringstream cmd;
	string llvm_path   = cmd_option_str("llvm_path");

	// Clean optimization pass
	cmd.str("");
	//cmd << "opt -simplifycfg -instcombine -strip-dead-prototypes < file.bc > file-2.bc";
	cmd << "opt -strip-dead-prototypes < file.bc > file-2.bc";
	systm(cmd.str().c_str());

	// First optimization pass
	cmd.str("");
	cmd << "opt -load " << llvm_path << "/Release+Asserts/lib/ForestMeasure.so -meas_fillnames < file-2.bc > file-3.bc";
	systm(cmd.str().c_str());

	// Second optimization pass
	cmd.str("");
	cmd << "opt -load " << llvm_path << "/Release+Asserts/lib/ForestInstr.so -instr_rmmalloc -instr_rmpthread -instr_rmputs -instr_rmassume -instr_rmmemcpy -instr_rmerror -instr_rmindet -instr_addassert < file-3.bc > file-4.bc";
	systm(cmd.str().c_str());

	options_to_file();

	// Heuristic optimization pass
	cmd.str("");
	cmd << "opt -load " << llvm_path << "/Release+Asserts/lib/ForestHeuristic.so -pathfinder < file-4.bc > file-5.bc";
	systm(cmd.str().c_str());

	end_pass("heuristic");

}