parseaut: replace std::map by robin_hood::unordered_flat_map

This improves the parsing performance a bit more.

* spot/parseaut/parsedecl.hh, spot/parseaut/parseaut.yy: Here.
* tests/sanity/style.test: Handle parsedecl.hh as a private header.
This commit is contained in:
Alexandre Duret-Lutz 2021-09-15 16:47:52 +02:00
parent ce1cf5507f
commit 4c94e14f86
3 changed files with 5 additions and 3 deletions

View file

@ -33,6 +33,7 @@
{
#include "config.h"
#include <spot/misc/common.hh>
#include <spot/priv/robin_hood.hh>
#include <string>
#include <cstring>
#include <sstream>
@ -64,7 +65,7 @@ extern "C" int strverscmp(const char *s1, const char *s2);
over and over, and to register all their atomic_propositions in
the bdd_dict. Keep the bdd result around so we can reuse
it. */
typedef std::map<std::string, bdd> formula_cache;
typedef robin_hood::unordered_flat_map<std::string, bdd> formula_cache;
typedef std::pair<int, std::string*> pair;
typedef spot::twa_graph::namer<std::string> named_tgba_t;

View file

@ -20,6 +20,7 @@
#pragma once
#include <string>
#include "spot/priv/robin_hood.hh"
#include <spot/parseaut/parseaut.hh>
#include <spot/misc/location.hh>
@ -28,7 +29,7 @@
spot::location *yylloc, \
void* yyscanner, \
spot::parse_aut_error_list& error_list, \
std::map<std::string, bdd>& fmap)
robin_hood::unordered_flat_map<std::string, bdd>& fmap)
YY_DECL;
namespace spot

View file

@ -313,7 +313,7 @@ for dir in "$TOP/spot" "$TOP/bin" "$TOP/tests"; do
# (in the latter case they do not have to specify the priv/
# directory, so they will not match this regex).
case $file in
*/priv/*|*/bin/*);;
*/priv/*|*/bin/*|*/parsedecl.hh);;
*)
$GREP '#.*include.*priv/' $tmp &&
diag 'Do not include private headers in public headers.'