c++11: replace push(Type(args...)) by emplace(args...)

This of course concerns push_back and push_front as well.

* src/bin/common_finput.cc, src/bin/dstar2tgba.cc, src/bin/ltl2tgba.cc,
src/bin/ltl2tgta.cc, src/bin/ltlcross.cc, src/bin/ltlfilt.cc,
src/dstarparse/dstarparse.yy, src/kripkeparse/kripkeparse.yy,
src/ltlast/formula.cc, src/ltlparse/ltlparse.yy, src/misc/minato.cc,
src/neverparse/neverclaimparse.yy, src/priv/bddalloc.cc, src/ta/ta.cc,
src/taalgos/emptinessta.cc, src/tgba/taatgba.cc,
src/tgbaalgos/gtec/gtec.cc, src/tgbaalgos/gtec/sccstack.cc,
src/tgbaalgos/magic.cc, src/tgbaalgos/ndfs_result.hxx,
src/tgbaalgos/rundotdec.cc, src/tgbaalgos/scc.cc, src/tgbaalgos/se05.cc,
src/tgbaalgos/simulation.cc, src/tgbaalgos/tau03.cc,
src/tgbaalgos/tau03opt.cc, src/tgbaparse/tgbaparse.yy: Use emplace
to make the code less verbose and avoid creating temporaries.
This commit is contained in:
Alexandre Duret-Lutz 2014-01-28 23:33:07 +01:00
parent e0bbc2655d
commit 49c66c6319
27 changed files with 189 additions and 202 deletions

View file

@ -1,6 +1,6 @@
// -*- coding: utf-8 -*-
// Copyright (C) 2012, 2013 Laboratoire de Recherche et Développement
// de l'Epita (LRDE).
// Copyright (C) 2012, 2013, 2014 Laboratoire de Recherche et
// Développement de l'Epita (LRDE).
//
// This file is part of Spot, a model checking library.
//
@ -56,10 +56,10 @@ parse_opt_finput(int key, char* arg, struct argp_state*)
switch (key)
{
case 'f':
jobs.push_back(job(arg, false));
jobs.emplace_back(arg, false);
break;
case 'F':
jobs.push_back(job(arg, true));
jobs.emplace_back(arg, true);
break;
case OPT_LBT:
lbt_input = true;

View file

@ -1,5 +1,5 @@
// -*- coding: utf-8 -*-
// Copyright (C) 2013 Laboratoire de Recherche et Développement de
// Copyright (C) 2013, 2014 Laboratoire de Recherche et Développement de
// l'Epita (LRDE).
//
// This file is part of Spot, a model checking library.
@ -140,7 +140,7 @@ parse_opt(int key, char* arg, struct argp_state*)
type = spot::postprocessor::BA;
break;
case 'F':
jobs.push_back(job(arg, true));
jobs.emplace_back(arg, true);
break;
case 'M':
type = spot::postprocessor::Monitor;
@ -188,7 +188,7 @@ parse_opt(int key, char* arg, struct argp_state*)
type = spot::postprocessor::TGBA;
break;
case ARGP_KEY_ARG:
jobs.push_back(job(arg, true));
jobs.emplace_back(arg, true);
break;
default:
@ -370,7 +370,7 @@ main(int argc, char** argv)
exit(err);
if (jobs.empty())
jobs.push_back(job("-", true));
jobs.emplace_back("-", true);
spot::postprocessor post(&extra_options);
post.set_pref(pref | comp);

View file

@ -1,6 +1,6 @@
// -*- coding: utf-8 -*-
// Copyright (C) 2012, 2013 Laboratoire de Recherche et Développement
// de l'Epita (LRDE).
// Copyright (C) 2012, 2013, 2014 Laboratoire de Recherche et
// Développement de l'Epita (LRDE).
//
// This file is part of Spot, a model checking library.
//
@ -186,7 +186,7 @@ parse_opt(int key, char* arg, struct argp_state*)
break;
case ARGP_KEY_ARG:
// FIXME: use stat() to distinguish filename from string?
jobs.push_back(job(arg, false));
jobs.emplace_back(arg, false);
break;
default:

View file

@ -1,6 +1,6 @@
// -*- coding: utf-8 -*-
// Copyright (C) 2012, 2013 Laboratoire de Recherche et Développement
// de l'Epita (LRDE).
// Copyright (C) 2012, 2013, 2014 Laboratoire de Recherche et
// Développement de l'Epita (LRDE).
//
// This file is part of Spot, a model checking library.
//
@ -144,7 +144,7 @@ parse_opt(int key, char* arg, struct argp_state*)
break;
case ARGP_KEY_ARG:
// FIXME: use stat() to distinguish filename from string?
jobs.push_back(job(arg, false));
jobs.emplace_back(arg, false);
break;
default:

View file

@ -1,6 +1,6 @@
// -*- coding: utf-8 -*-
// Copyright (C) 2012, 2013 Laboratoire de Recherche et Développement
// de l'Epita (LRDE).
// Copyright (C) 2012, 2013, 2014 Laboratoire de Recherche et
// Développement de l'Epita (LRDE).
//
// This file is part of Spot, a model checking library.
//
@ -1613,7 +1613,7 @@ main(int argc, char** argv)
exit(err);
if (jobs.empty())
jobs.push_back(job("-", 1));
jobs.emplace_back("-", 1);
if (translators.empty())
error(2, 0, "No translator to run? Run '%s --help' for usage.",

View file

@ -1,6 +1,6 @@
// -*- coding: utf-8 -*-
// Copyright (C) 2012, 2013 Laboratoire de Recherche et Développement de
// l'Epita (LRDE).
// Copyright (C) 2012, 2013, 2014 Laboratoire de Recherche et
// Développement de l'Epita (LRDE).
//
// This file is part of Spot, a model checking library.
//
@ -270,7 +270,7 @@ parse_opt(int key, char* arg, struct argp_state*)
break;
case ARGP_KEY_ARG:
// FIXME: use stat() to distinguish filename from string?
jobs.push_back(job(arg, true));
jobs.emplace_back(arg, true);
break;
case OPT_BOOLEAN:
boolean = true;
@ -598,7 +598,7 @@ main(int argc, char** argv)
exit(err);
if (jobs.empty())
jobs.push_back(job("-", 1));
jobs.emplace_back("-", 1);
// --stutter-insensitive implies --ltl
ltl |= stutter_insensitive;

View file

@ -1,6 +1,6 @@
/* -*- coding: utf-8 -*-
** Copyright (C) 2013 Laboratoire de Recherche et Développement de
** l'Epita (LRDE).
** Copyright (C) 2013, 2014 Laboratoire de Recherche et Développement
** de l'Epita (LRDE).
**
** This file is part of Spot, a model checking library.
**
@ -309,7 +309,7 @@ void
dstaryy::parser::error(const location_type& location,
const std::string& message)
{
error_list.push_back(spot::dstar_parse_error(location, message));
error_list.emplace_back(location, message);
}
namespace spot
@ -323,9 +323,8 @@ namespace spot
{
if (dstaryyopen(name))
{
error_list.push_back
(dstar_parse_error(spot::location(),
std::string("Cannot open file ") + name));
error_list.emplace_back(spot::location(),
std::string("Cannot open file ") + name);
return 0;
}
result_ r;

View file

@ -1,5 +1,5 @@
// -*- coding: utf-8 -*-
// Copyright (C) 2011, 2012, 2013 Laboratoire de Recherche et
// Copyright (C) 2011, 2012, 2013, 2014 Laboratoire de Recherche et
// Développement de l'Epita (LRDE)
//
// This file is part of Spot, a model checking library.
@ -121,8 +121,7 @@ strident "," condition "," follow_list ";"
here.begin.column + i->first.end.column;
here.begin.line += i->first.begin.line - 1;
here.begin.column += i->first.begin.column;
error_list.push_back(spot::kripke_parse_error(here,
i->second));
error_list.emplace_back(here, i->second);
}
if (f)
result->add_condition(f, *$1);
@ -154,8 +153,7 @@ string: STRING
| UNTERMINATED_STRING
{
$$ = $1;
error_list.push_back(spot::kripke_parse_error(@1,
"unterminated string"));
error_list.emplace_back(@1, "unterminated string");
}
;
@ -192,7 +190,7 @@ void
kripkeyy::parser::error(const location_type& location,
const std::string& message)
{
error_list.push_back(spot::kripke_parse_error(location, message));
error_list.emplace_back(location, message);
}
namespace spot

View file

@ -1,6 +1,6 @@
// -*- coding: utf-8 -*-
// Copyright (C) 2009, 2010, 2011, 2012, 2013 Laboratoire de Recherche et
// Développement de l'Epita (LRDE).
// Copyright (C) 2009, 2010, 2011, 2012, 2013, 2014 Laboratoire de
// Recherche et Développement de l'Epita (LRDE).
// Copyright (C) 2003, 2005 Laboratoire d'Informatique de Paris 6 (LIP6),
// département Systèmes Répartis Coopératifs (SRC), Université Pierre
// et Marie Curie.
@ -96,7 +96,7 @@ namespace spot
std::list<std::string> res;
#define proprint(m, a, l) \
if (f->m()) \
res.push_back(std::string(l));
res.emplace_back(l);
printprops;
#undef proprint
return res;

View file

@ -59,8 +59,8 @@
using namespace spot::ltl;
#define missing_right_op_msg(op, str) \
error_list.push_back(parse_error(op, \
"missing right operand for \"" str "\""));
error_list.emplace_back(op, \
"missing right operand for \"" str "\"");
#define missing_right_op(res, op, str) \
do \
@ -115,8 +115,7 @@ using namespace spot::ltl;
if (str.empty())
{
error_list.push_back(parse_error(location,
"unexpected empty block"));
error_list.emplace_back(location, "unexpected empty block");
return 0;
}
@ -149,7 +148,7 @@ using namespace spot::ltl;
s += "' rejected by environment `";
s += env.name();
s += "'";
error_list.push_back(parse_error(location, s));
error_list.emplace_back(location, s);
}
return f;
}
@ -308,14 +307,13 @@ result: START_LTL subformula END_OF_INPUT
emptyinput: END_OF_INPUT
{
error_list.push_back(parse_error(@$, "empty input"));
error_list.emplace_back(@$, "empty input");
result = 0;
}
enderror: error END_OF_INPUT
{
error_list.push_back(parse_error(@1,
"ignoring trailing garbage"));
error_list.emplace_back(@1, "ignoring trailing garbage");
}
@ -349,12 +347,11 @@ gotoargs: OP_GOTO_OPEN OP_SQBKT_NUM OP_SQBKT_SEP OP_SQBKT_NUM OP_SQBKT_CLOSE
| OP_GOTO_OPEN OP_SQBKT_NUM OP_SQBKT_CLOSE
{ $$.min = $$.max = $2; }
| OP_GOTO_OPEN error OP_SQBKT_CLOSE
{ error_list.push_back(parse_error(@$,
"treating this goto block as [->]"));
{ error_list.emplace_back(@$, "treating this goto block as [->]");
$$.min = $$.max = 1U; }
| OP_GOTO_OPEN error_opt END_OF_INPUT
{ error_list.push_back(parse_error(@$,
"missing closing bracket for goto operator"));
{ error_list.
emplace_back(@$, "missing closing bracket for goto operator");
$$.min = $$.max = 0U; }
kleen_star: OP_STAR | OP_BSTAR
@ -366,23 +363,20 @@ starargs: kleen_star
| OP_STAR_OPEN sqbracketargs
{ $$ = $2; }
| OP_STAR_OPEN error OP_SQBKT_CLOSE
{ error_list.push_back(parse_error(@$,
"treating this star block as [*]"));
{ error_list.emplace_back(@$, "treating this star block as [*]");
$$.min = 0U; $$.max = bunop::unbounded; }
| OP_STAR_OPEN error_opt END_OF_INPUT
{ error_list.push_back(parse_error(@$,
"missing closing bracket for star"));
{ error_list.emplace_back(@$, "missing closing bracket for star");
$$.min = $$.max = 0U; }
equalargs: OP_EQUAL_OPEN sqbracketargs
{ $$ = $2; }
| OP_EQUAL_OPEN error OP_SQBKT_CLOSE
{ error_list.push_back(parse_error(@$,
"treating this equal block as [*]"));
{ error_list.emplace_back(@$, "treating this equal block as [*]");
$$.min = 0U; $$.max = bunop::unbounded; }
| OP_EQUAL_OPEN error_opt END_OF_INPUT
{ error_list.push_back(parse_error(@$,
"missing closing bracket for equal operator"));
{ error_list.
emplace_back(@$, "missing closing bracket for equal operator");
$$.min = $$.max = 0U; }
@ -399,7 +393,7 @@ booleanatom: ATOMIC_PROP
s += "' in environment `";
s += parse_environment.name();
s += "'";
error_list.push_back(parse_error(@1, s));
error_list.emplace_back(@1, s);
delete $1;
YYERROR;
}
@ -416,7 +410,7 @@ booleanatom: ATOMIC_PROP
s += "' in environment `";
s += parse_environment.name();
s += "'";
error_list.push_back(parse_error(@1, s));
error_list.emplace_back(@1, s);
delete $1;
YYERROR;
}
@ -433,7 +427,7 @@ booleanatom: ATOMIC_PROP
s += "' in environment `";
s += parse_environment.name();
s += "'";
error_list.push_back(parse_error(@1, s));
error_list.emplace_back(@1, s);
delete $1;
YYERROR;
}
@ -455,11 +449,10 @@ sere: booleanatom
}
else
{
error_list.push_back(parse_error(@2,
error_list.emplace_back(@2,
"not a boolean expression: inside a SERE `!' can only "
"be applied to a Boolean expression"));
error_list.push_back(parse_error(@$,
"treating this block as false"));
"be applied to a Boolean expression");
error_list.emplace_back(@$, "treating this block as false");
$2->destroy();
$$ = constant::false_instance();
}
@ -476,19 +469,19 @@ sere: booleanatom
| PAR_OPEN sere PAR_CLOSE
{ $$ = $2; }
| PAR_OPEN error PAR_CLOSE
{ error_list.push_back(parse_error(@$,
"treating this parenthetical block as false"));
{ error_list.
emplace_back(@$,
"treating this parenthetical block as false");
$$ = constant::false_instance();
}
| PAR_OPEN sere END_OF_INPUT
{ error_list.push_back(parse_error(@1 + @2,
"missing closing parenthesis"));
{ error_list.emplace_back(@1 + @2, "missing closing parenthesis");
$$ = $2;
}
| PAR_OPEN error END_OF_INPUT
{ error_list.push_back(parse_error(@$,
{ error_list.emplace_back(@$,
"missing closing parenthesis, "
"treating this parenthetical block as false"));
"treating this parenthetical block as false");
$$ = constant::false_instance();
}
| sere OP_AND sere
@ -517,7 +510,7 @@ sere: booleanatom
{
if ($2.max < $2.min)
{
error_list.push_back(parse_error(@2, "reversed range"));
error_list.emplace_back(@2, "reversed range");
std::swap($2.max, $2.min);
}
$$ = bunop::instance(bunop::Star, $1, $2.min, $2.max);
@ -526,7 +519,7 @@ sere: booleanatom
{
if ($1.max < $1.min)
{
error_list.push_back(parse_error(@1, "reversed range"));
error_list.emplace_back(@1, "reversed range");
std::swap($1.max, $1.min);
}
$$ = bunop::instance(bunop::Star, constant::true_instance(),
@ -536,7 +529,7 @@ sere: booleanatom
{
if ($2.max < $2.min)
{
error_list.push_back(parse_error(@2, "reversed range"));
error_list.emplace_back(@2, "reversed range");
std::swap($2.max, $2.min);
}
if ($1->is_boolean())
@ -545,11 +538,11 @@ sere: booleanatom
}
else
{
error_list.push_back(parse_error(@1,
error_list.emplace_back(@1,
"not a boolean expression: [=...] can only "
"be applied to a Boolean expression"));
error_list.push_back(parse_error(@$,
"treating this block as false"));
"be applied to a Boolean expression");
error_list.emplace_back(@$,
"treating this block as false");
$1->destroy();
$$ = constant::false_instance();
}
@ -558,7 +551,7 @@ sere: booleanatom
{
if ($2.max < $2.min)
{
error_list.push_back(parse_error(@2, "reversed range"));
error_list.emplace_back(@2, "reversed range");
std::swap($2.max, $2.min);
}
if ($1->is_boolean())
@ -567,11 +560,11 @@ sere: booleanatom
}
else
{
error_list.push_back(parse_error(@1,
error_list.emplace_back(@1,
"not a boolean expression: [->...] can only "
"be applied to a Boolean expression"));
error_list.push_back(parse_error(@$,
"treating this block as false"));
"be applied to a Boolean expression");
error_list.emplace_back(@$,
"treating this block as false");
$1->destroy();
$$ = constant::false_instance();
}
@ -586,18 +579,17 @@ sere: booleanatom
{
if (!$1->is_boolean())
{
error_list.push_back(parse_error(@1,
error_list.emplace_back(@1,
"not a boolean expression: inside SERE `<->' can only "
"be applied to Boolean expressions"));
"be applied to Boolean expressions");
}
if (!$3->is_boolean())
{
error_list.push_back(parse_error(@3,
error_list.emplace_back(@3,
"not a boolean expression: inside SERE `<->' can only "
"be applied to Boolean expressions"));
"be applied to Boolean expressions");
}
error_list.push_back(parse_error(@$,
"treating this block as false"));
error_list.emplace_back(@$, "treating this block as false");
$1->destroy();
$3->destroy();
$$ = constant::false_instance();
@ -615,12 +607,11 @@ sere: booleanatom
{
if (!$1->is_boolean())
{
error_list.push_back(parse_error(@1,
error_list.emplace_back(@1,
"not a boolean expression: inside SERE `->' can only "
"be applied to a Boolean expression"));
"be applied to a Boolean expression");
}
error_list.push_back(parse_error(@$,
"treating this block as false"));
error_list.emplace_back(@$, "treating this block as false");
$1->destroy();
$3->destroy();
$$ = constant::false_instance();
@ -638,18 +629,17 @@ sere: booleanatom
{
if (!$1->is_boolean())
{
error_list.push_back(parse_error(@1,
error_list.emplace_back(@1,
"not a boolean expression: inside SERE `<->' can only "
"be applied to Boolean expressions"));
"be applied to Boolean expressions");
}
if (!$3->is_boolean())
{
error_list.push_back(parse_error(@3,
error_list.emplace_back(@3,
"not a boolean expression: inside SERE `<->' can only "
"be applied to Boolean expressions"));
"be applied to Boolean expressions");
}
error_list.push_back(parse_error(@$,
"treating this block as false"));
error_list.emplace_back(@$, "treating this block as false");
$1->destroy();
$3->destroy();
$$ = constant::false_instance();
@ -661,28 +651,28 @@ sere: booleanatom
bracedsere: BRACE_OPEN sere BRACE_CLOSE
{ $$ = $2; }
| BRACE_OPEN sere error BRACE_CLOSE
{ error_list.push_back(parse_error(@3, "ignoring this"));
{ error_list.emplace_back(@3, "ignoring this");
$$ = $2;
}
| BRACE_OPEN error BRACE_CLOSE
{ error_list.push_back(parse_error(@$,
"treating this brace block as false"));
{ error_list.emplace_back(@$,
"treating this brace block as false");
$$ = constant::false_instance();
}
| BRACE_OPEN sere END_OF_INPUT
{ error_list.push_back(parse_error(@1 + @2,
"missing closing brace"));
{ error_list.emplace_back(@1 + @2,
"missing closing brace");
$$ = $2;
}
| BRACE_OPEN sere error END_OF_INPUT
{ error_list.push_back(parse_error(@3,
"ignoring trailing garbage and missing closing brace"));
{ error_list. emplace_back(@3,
"ignoring trailing garbage and missing closing brace");
$$ = $2;
}
| BRACE_OPEN error END_OF_INPUT
{ error_list.push_back(parse_error(@$,
{ error_list.emplace_back(@$,
"missing closing brace, "
"treating this brace block as false"));
"treating this brace block as false");
$$ = constant::false_instance();
}
| BRA_BLOCK
@ -706,28 +696,27 @@ parenthesedsubformula: PAR_BLOCK
| PAR_OPEN subformula PAR_CLOSE
{ $$ = $2; }
| PAR_OPEN subformula error PAR_CLOSE
{ error_list.push_back(parse_error(@3, "ignoring this"));
{ error_list.emplace_back(@3, "ignoring this");
$$ = $2;
}
| PAR_OPEN error PAR_CLOSE
{ error_list.push_back(parse_error(@$,
"treating this parenthetical block as false"));
{ error_list.emplace_back(@$,
"treating this parenthetical block as false");
$$ = constant::false_instance();
}
| PAR_OPEN subformula END_OF_INPUT
{ error_list.push_back(parse_error(@1 + @2,
"missing closing parenthesis"));
{ error_list.emplace_back(@1 + @2, "missing closing parenthesis");
$$ = $2;
}
| PAR_OPEN subformula error END_OF_INPUT
{ error_list.push_back(parse_error(@3,
"ignoring trailing garbage and missing closing parenthesis"));
{ error_list.emplace_back(@3,
"ignoring trailing garbage and missing closing parenthesis");
$$ = $2;
}
| PAR_OPEN error END_OF_INPUT
{ error_list.push_back(parse_error(@$,
{ error_list.emplace_back(@$,
"missing closing parenthesis, "
"treating this parenthetical block as false"));
"treating this parenthetical block as false");
$$ = constant::false_instance();
}
@ -744,28 +733,28 @@ boolformula: booleanatom
| PAR_OPEN boolformula PAR_CLOSE
{ $$ = $2; }
| PAR_OPEN boolformula error PAR_CLOSE
{ error_list.push_back(parse_error(@3, "ignoring this"));
{ error_list.emplace_back(@3, "ignoring this");
$$ = $2;
}
| PAR_OPEN error PAR_CLOSE
{ error_list.push_back(parse_error(@$,
"treating this parenthetical block as false"));
{ error_list.emplace_back(@$,
"treating this parenthetical block as false");
$$ = constant::false_instance();
}
| PAR_OPEN boolformula END_OF_INPUT
{ error_list.push_back(parse_error(@1 + @2,
"missing closing parenthesis"));
{ error_list.emplace_back(@1 + @2,
"missing closing parenthesis");
$$ = $2;
}
| PAR_OPEN boolformula error END_OF_INPUT
{ error_list.push_back(parse_error(@3,
"ignoring trailing garbage and missing closing parenthesis"));
{ error_list.emplace_back(@3,
"ignoring trailing garbage and missing closing parenthesis");
$$ = $2;
}
| PAR_OPEN error END_OF_INPUT
{ error_list.push_back(parse_error(@$,
{ error_list.emplace_back(@$,
"missing closing parenthesis, "
"treating this parenthetical block as false"));
"treating this parenthetical block as false");
$$ = constant::false_instance();
}
| boolformula OP_AND boolformula
@ -923,7 +912,7 @@ lbtformula: ATOMIC_PROP
s += "' rejected by environment `";
s += parse_environment.name();
s += "'";
error_list.push_back(parse_error(@1, s));
error_list.emplace_back(@1, s);
delete $1;
YYERROR;
}
@ -969,7 +958,7 @@ lbtformula: ATOMIC_PROP
void
ltlyy::parser::error(const location_type& location, const std::string& message)
{
error_list.push_back(parse_error(location, message));
error_list.emplace_back(location, message);
}
namespace spot

View file

@ -1,6 +1,6 @@
// -*- coding: utf-8 -*-
// Copyright (C) 2009, 2013 Laboratoire de Recherche et Développement
// de l'Epita (LRDE).
// Copyright (C) 2009, 2013, 2014 Laboratoire de Recherche et
// Développement de l'Epita (LRDE).
// Copyright (C) 2003, 2004 Laboratoire d'Informatique de Paris
// 6 (LIP6), département Systèmes Répartis Coopératifs (SRC),
// Université Pierre et Marie Curie.
@ -39,14 +39,14 @@ namespace spot
// original algorithm, because in many cases we are trying to
// build ISOPs out of formulae that are already cubes.
cube_.push(bdd_satprefix(input));
todo_.push(local_vars(input, input, bdd_support(input)));
todo_.emplace(input, input, bdd_support(input));
}
minato_isop::minato_isop(bdd input, bdd vars)
: ret_(bddfalse)
{
cube_.push(bdd_satprefix(input));
todo_.push(local_vars(input, input, vars));
todo_.emplace(input, input, vars);
}
bdd
@ -129,7 +129,7 @@ namespace spot
}
cube_.push(cube_.top() & v0);
todo_.push(local_vars(l.f0_min - l.f1_max, l.f0_max, l.vars));
todo_.emplace(l.f0_min - l.f1_max, l.f0_max, l.vars);
}
continue;
@ -138,7 +138,7 @@ namespace spot
l.g0 = ret_;
cube_.pop();
cube_.push(cube_.top() & l.v1);
todo_.push(local_vars(l.f1_min - l.f0_max, l.f1_max, l.vars));
todo_.emplace(l.f1_min - l.f0_max, l.f1_max, l.vars);
continue;
case local_vars::ThirdStep:
@ -148,7 +148,7 @@ namespace spot
{
bdd fs_max = l.f0_max & l.f1_max;
bdd fs_min = fs_max & ((l.f0_min - l.g0) | (l.f1_min - l.g1));
todo_.push(local_vars(fs_min, fs_max, l.vars));
todo_.emplace(fs_min, fs_max, l.vars);
}
continue;

View file

@ -1,6 +1,6 @@
/* -*- coding: utf-8 -*-
** Copyright (C) 2010, 2011, 2012, 2013 Laboratoire de Recherche et
** Développement de l'Epita (LRDE).
** Copyright (C) 2010, 2011, 2012, 2013, 2014 Laboratoire de Recherche
** et Développement de l'Epita (LRDE).
**
** This file is part of Spot, a model checking library.
**
@ -259,7 +259,7 @@ void
neverclaimyy::parser::error(const location_type& location,
const std::string& message)
{
error_list.push_back(spot::neverclaim_parse_error(location, message));
error_list.emplace_back(location, message);
}
namespace spot
@ -273,9 +273,8 @@ namespace spot
{
if (neverclaimyyopen(name))
{
error_list.push_back
(neverclaim_parse_error(spot::location(),
std::string("Cannot open file ") + name));
error_list.emplace_back(spot::location(),
std::string("Cannot open file ") + name);
return 0;
}
tgba_explicit_string* result = new tgba_explicit_string(dict);

View file

@ -1,8 +1,9 @@
// Copyright (C) 2007, 2011 Laboratoire de Recherche et Développement
// de l'Epita (LRDE).
// -*- coding: utf-8 -*-
// Copyright (C) 2007, 2011, 2014 Laboratoire de Recherche et
// Développement de l'Epita (LRDE).
// Copyright (C) 2003, 2004, 2006, 2007 Laboratoire d'Informatique de
// Paris 6 (LIP6), département Systèmes Répartis Coopératifs (SRC),
// Université Pierre et Marie Curie.
// Paris 6 (LIP6), département Systèmes Répartis Coopératifs (SRC),
// Université Pierre et Marie Curie.
//
// This file is part of Spot, a model checking library.
//
@ -32,7 +33,7 @@ namespace spot
{
initialize();
lvarnum = bdd_varnum();
fl.push_front(pos_lenght_pair(0, lvarnum));
fl.emplace_front(0, lvarnum);
}
void

View file

@ -1,5 +1,6 @@
// Copyright (C) 2010, 2011 Laboratoire de Recherche et Developpement
// de l Epita (LRDE).
// -*- coding: utf-8 -*-
// Copyright (C) 2010, 2011, 2014 Laboratoire de Recherche et
// Developpement de l Epita (LRDE).
//
// This file is part of Spot, a model checking library.
//
@ -52,7 +53,7 @@ namespace spot
void
scc_stack_ta::push(int index)
{
s.push_front(connected_component(index));
s.emplace_front(index);
}
std::list<state*>&

View file

@ -1,6 +1,6 @@
// -*- coding: utf-8 -*-
// Copyright (C) 2010, 2011, 2012, 2013 Laboratoire de Recherche et
// Développement de l'Epita (LRDE).
// Copyright (C) 2010, 2011, 2012, 2013, 2014 Laboratoire de Recherche
// et Développement de l'Epita (LRDE).
//
// This file is part of Spot, a model checking library.
//
@ -118,7 +118,7 @@ namespace spot
ta_succ_iterator_product* iter = a_->succ_iter(init);
iter->first();
todo.push(pair_state_iter(init, iter));
todo.emplace(init, iter);
inc_depth();
@ -245,7 +245,7 @@ namespace spot
ta_succ_iterator_product* iter = a_->succ_iter(dest);
iter->first();
todo.push(pair_state_iter(dest, iter));
todo.emplace(dest, iter);
//colour[dest] = GREY;
inc_depth();
@ -467,7 +467,7 @@ namespace spot
sscc.top().is_accepting = t->is_livelock_accepting_state(init);
ta_succ_iterator_product* iter = t->succ_iter(init);
iter->first();
todo.push(pair_state_iter(init, iter));
todo.emplace(init, iter);
inc_depth();
}
@ -561,7 +561,7 @@ namespace spot
ta_succ_iterator_product* iter = t->succ_iter(dest);
iter->first();
todo.push(pair_state_iter(dest, iter));
todo.emplace(dest, iter);
inc_depth();
continue;
}

View file

@ -206,9 +206,8 @@ namespace spot
}
bounds_t bounds;
for (taa_tgba::state_set::const_iterator i = s->begin();
i != s->end(); ++i)
bounds.push_back(std::make_pair((*i)->begin(), (*i)->end()));
for (auto& i: *s)
bounds.emplace_back(i->begin(), i->end());
/// Sorting might make the cartesian product faster by not
/// exploring all possibilities.
@ -216,8 +215,8 @@ namespace spot
std::vector<iterator> pos;
pos.reserve(bounds.size());
for (bounds_t::const_iterator i = bounds.begin(); i != bounds.end(); ++i)
pos.push_back(i->first);
for (auto i: bounds)
pos.push_back(i.first);
while (pos[0] != bounds[0].second)
{

View file

@ -173,7 +173,7 @@ namespace spot
arc.push(bddfalse);
tgba_succ_iterator* iter = ecs_->aut->succ_iter(init);
iter->first();
todo.push(pair_state_iter(init, iter));
todo.emplace(init, iter);
inc_depth();
}
@ -242,7 +242,7 @@ namespace spot
arc.push(acc);
tgba_succ_iterator* iter = ecs_->aut->succ_iter(dest);
iter->first();
todo.push(pair_state_iter(dest, iter));
todo.emplace(dest, iter);
inc_depth();
continue;
}
@ -329,8 +329,8 @@ namespace spot
{
for (auto iter: shy->ecs_->aut->succ(s))
{
q.push_back(successor(iter->current_acceptance_conditions(),
iter->current_state()));
q.emplace_back(iter->current_acceptance_conditions(),
iter->current_state());
shy->inc_depth();
shy->inc_transitions();
}
@ -351,7 +351,7 @@ namespace spot
const state* i = ecs_->aut->get_init_state();
ecs_->h->insert(i, ++num);
ecs_->root.push(num);
todo.push_back(todo_item(i, num, this));
todo.emplace_back(i, num, this);
inc_depth(1);
}
@ -510,7 +510,7 @@ namespace spot
ecs_->h->insert(succ.s, ++num);
ecs_->root.push(num);
arc.push(succ.acc);
todo.push_back(todo_item(succ.s, num, this));
todo.emplace_back(succ.s, num, this);
pos = todo.back().q.begin();
inc_depth();
continue;

View file

@ -1,5 +1,8 @@
// -*- coding: utf-8 -*-
// Copyright (C) 2014 Laboratoire de Recherche et Developpement de
// l'Epita (LRDE).
// Copyright (C) 2004, 2005 Laboratoire d'Informatique de Paris 6 (LIP6),
// département Systèmes Répartis Coopératifs (SRC), Université Pierre
// département Systèmes Répartis Coopératifs (SRC), Université Pierre
// et Marie Curie.
//
// This file is part of Spot, a model checking library.
@ -49,7 +52,7 @@ namespace spot
void
scc_stack::push(int index)
{
s.push_front(connected_component(index));
s.emplace_front(index);
}
std::list<const state*>&

View file

@ -153,7 +153,7 @@ namespace spot
inc_depth();
tgba_succ_iterator* i = a_->succ_iter(s);
i->first();
st.push_front(stack_item(s, i, label, acc));
st.emplace_front(s, i, label, acc);
}
void pop(stack_type& st)

View file

@ -263,7 +263,7 @@ namespace spot
seen.insert(start);
tgba_succ_iterator* i = a_->succ_iter(start);
i->first();
st1.push_front(stack_item(start, i, bddfalse, bddfalse));
st1.emplace_front(start, i, bddfalse, bddfalse);
while (!st1.empty())
{
@ -292,7 +292,7 @@ namespace spot
seen.insert(s_prime);
tgba_succ_iterator* i = a_->succ_iter(s_prime);
i->first();
st1.push_front(stack_item(s_prime, i, label, acc));
st1.emplace_front(s_prime, i, label, acc);
}
else if ((acc & covered_acc) != acc)
{

View file

@ -1,5 +1,8 @@
// -*- coding: utf-8 -*-
// Copyright (C) 2014 Laboratoire de Recherche et Developpement
// de l'Epita (LRDE).
// Copyright (C) 2004, 2011 Laboratoire d'Informatique de Paris 6 (LIP6),
// département Systèmes Répartis Coopératifs (SRC), Université Pierre
// département Systèmes Répartis Coopératifs (SRC), Université Pierre
// et Marie Curie.
//
// This file is part of Spot, a model checking library.
@ -30,10 +33,10 @@ namespace spot
int n = 1;
for (tgba_run::steps::const_iterator i = run->prefix.begin();
i != run->prefix.end(); ++i, ++n)
map_[i->s].first.push_back(step_num(i, n));
map_[i->s].first.emplace_back(i, n);
for (tgba_run::steps::const_iterator i = run->cycle.begin();
i != run->cycle.end(); ++i, ++n)
map_[i->s].second.push_back(step_num(i, n));
map_[i->s].second.emplace_back(i, n);
}
tgba_run_dotty_decorator::~tgba_run_dotty_decorator()
@ -55,19 +58,17 @@ namespace spot
std::string sep = "(";
bool in_prefix = false;
bool in_cycle = false;
for (step_set::const_iterator j = i->second.first.begin();
j != i->second.first.end(); ++j)
for (auto j: i->second.first)
{
os << sep << j->second;
os << sep << j.second;
sep = ", ";
in_prefix = true;
}
if (sep == ", ")
sep = "; ";
for (step_set::const_iterator j = i->second.second.begin();
j != i->second.second.end(); ++j)
for (auto j: i->second.second)
{
os << sep << j->second;
os << sep << j.second;
sep = ", ";
in_cycle = true;
}

View file

@ -147,12 +147,12 @@ namespace spot
state* init = aut_->get_init_state();
num_ = -1;
h_.insert(std::make_pair(init, num_));
root_.push_front(scc(num_));
root_.emplace_front(num_);
arc_acc_.push(bddfalse);
arc_cond_.push(bddfalse);
tgba_succ_iterator* iter = aut_->succ_iter(init);
iter->first();
todo_.push(pair_state_iter(init, iter));
todo_.emplace(init, iter);
}
while (!todo_.empty())
@ -224,12 +224,12 @@ namespace spot
// Yes. Number it, stack it, and register its successors
// for later processing.
h_.insert(std::make_pair(dest, --num_));
root_.push_front(scc(num_));
root_.emplace_front(num_);
arc_acc_.push(acc);
arc_cond_.push(cond);
tgba_succ_iterator* iter = aut_->succ_iter(dest);
iter->first();
todo_.push(pair_state_iter(dest, iter));
todo_.emplace(dest, iter);
continue;
}

View file

@ -153,7 +153,7 @@ namespace spot
inc_depth();
tgba_succ_iterator* i = a_->succ_iter(s);
i->first();
st.push_front(stack_item(s, i, label, acc));
st.emplace_front(s, i, label, acc);
}
void pop(stack_type& st)

View file

@ -1317,7 +1317,7 @@ namespace spot
bdd sig = dont_care_compute_sig(src);
dont_care_bdd_lstate[sig].push_back(src);
dont_care_state2sig[src] = sig;
dont_care_now_to_now.push_back(std::make_pair(sig, it->second));
dont_care_now_to_now.emplace_back(sig, it->second);
class2state[it->second] = it->first;
sig = compute_sig(src);

View file

@ -127,7 +127,7 @@ namespace spot
inc_depth();
tgba_succ_iterator* i = a_->succ_iter(s);
i->first();
st.push_front(stack_item(s, i, label, acc));
st.emplace_front(s, i, label, acc);
}
void pop(stack_type& st)

View file

@ -152,7 +152,7 @@ namespace spot
inc_depth();
tgba_succ_iterator* i = a_->succ_iter(s);
i->first();
st.push_front(stack_item(s, i, label, acc));
st.emplace_front(s, i, label, acc);
}
void pop(stack_type& st)
@ -321,7 +321,7 @@ namespace spot
typedef std::pair<bdd, unsigned> cond_level;
std::stack<cond_level> condition_stack;
unsigned depth = 1;
condition_stack.push(cond_level(bddfalse, 0));
condition_stack.emplace(bddfalse, 0);
while (!st_red.empty())
{
@ -376,7 +376,7 @@ namespace spot
{
bdd old = acu;
acu |= acc;
condition_stack.push(cond_level(acu - old, depth));
condition_stack.emplace(acu - old, depth);
}
++depth;
}

View file

@ -1,6 +1,6 @@
/* -*- coding: utf-8 -*-
** Copyright (C) 2009, 2010, 2012, 2013 Laboratoire de Recherche et
** Développement de l'Epita (LRDE).
** Copyright (C) 2009, 2010, 2012, 2013, 2014 Laboratoire de Recherche
** et Développement de l'Epita (LRDE).
** Copyright (C) 2003, 2004, 2005, 2006 Laboratoire d'Informatique de
** Paris 6 (LIP6), département Systèmes Répartis Coopératifs (SRC),
** Université Pierre et Marie Curie.
@ -123,8 +123,7 @@ line: strident ',' strident ',' condition ',' acc_list ';'
here.begin.column + i->first.end.column;
here.begin.line += i->first.begin.line - 1;
here.begin.column += i->first.begin.column;
error_list.push_back(spot::tgba_parse_error(here,
i->second));
error_list.emplace_back(here, i->second);
}
if (f)
result->add_condition(t, f);
@ -151,8 +150,7 @@ string: STRING
| UNTERMINATED_STRING
{
$$ = $1;
error_list.push_back(spot::tgba_parse_error(@1,
"unterminated string"));
error_list.emplace_back(@1, "unterminated string");
}
strident: string | IDENT
@ -182,8 +180,8 @@ acc_list:
const formula* f = parse_envacc.require(*$2);
if (! result->has_acceptance_condition(f))
{
error_list.push_back(spot::tgba_parse_error(@2,
"undeclared acceptance condition `" + *$2 + "'"));
error_list.emplace_back(@2,
"undeclared acceptance condition `" + *$2 + "'");
f->destroy();
// $2 will be destroyed on error recovery.
YYERROR;
@ -207,7 +205,7 @@ acc_decl:
s += "' unknown in environment `";
s += parse_envacc.name();
s += "'";
error_list.push_back(spot::tgba_parse_error(@2, s));
error_list.emplace_back(@2, s);
YYERROR;
}
result->declare_acceptance_condition(f);
@ -221,7 +219,7 @@ void
tgbayy::parser::error(const location_type& location,
const std::string& message)
{
error_list.push_back(spot::tgba_parse_error(location, message));
error_list.emplace_back(location, message);
}
namespace spot
@ -236,9 +234,8 @@ namespace spot
{
if (tgbayyopen(name))
{
error_list.push_back
(tgba_parse_error(spot::location(),
std::string("Cannot open file ") + name));
error_list.emplace_back(spot::location(),
std::string("Cannot open file ") + name);
return 0;
}
formula_cache fcache;