diff options
author | Alberto Gonzalez <boqwxp@airmail.cc> | 2020-05-14 22:52:07 +0000 |
---|---|---|
committer | Alberto Gonzalez <boqwxp@airmail.cc> | 2020-05-15 00:55:32 +0000 |
commit | 8297afe92588c881fbf0590a64c81af08e6f20f6 (patch) | |
tree | c826fc72447648d0c72e739e12af0d6c897070b4 /kernel/log.h | |
parent | 07eecff9cca555086667666c4dbdb4c6a7133c67 (diff) | |
download | yosys-8297afe92588c881fbf0590a64c81af08e6f20f6.tar.gz yosys-8297afe92588c881fbf0590a64c81af08e6f20f6.tar.bz2 yosys-8297afe92588c881fbf0590a64c81af08e6f20f6.zip |
log: Use `dict` instead of `std::vector<std::pair>` for `log_expect_{error, warning, log}` to better express the intent that each element is unique.
Diffstat (limited to 'kernel/log.h')
-rw-r--r-- | kernel/log.h | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/kernel/log.h b/kernel/log.h index dee5d44d7..54bfcb911 100644 --- a/kernel/log.h +++ b/kernel/log.h @@ -202,19 +202,16 @@ void log_flush(); struct LogExpectedItem { - LogExpectedItem(std::string pattern, int expected) : - expected_count(expected), - current_count(0), - pattern(pattern) - { - } + LogExpectedItem(const YS_REGEX_TYPE &pat, int expected) : + pattern(pat), expected_count(expected), current_count(0) {} + LogExpectedItem() : expected_count(0), current_count(0) {} + YS_REGEX_TYPE pattern; int expected_count; int current_count; - std::string pattern; }; -extern std::vector<std::pair<YS_REGEX_TYPE,LogExpectedItem>> log_expect_log, log_expect_warning, log_expect_error; +extern dict<std::string, LogExpectedItem> log_expect_log, log_expect_warning, log_expect_error; void log_check_expected(); const char *log_signal(const RTLIL::SigSpec &sig, bool autoint = true); |