aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/log.h
diff options
context:
space:
mode:
authorMiodrag Milanović <mmicko@gmail.com>2020-05-21 15:36:30 +0200
committerGitHub <noreply@github.com>2020-05-21 15:36:30 +0200
commit637650597b27a2e2f5407fc128ffd21d7a0b3016 (patch)
treef6c29b8d0e4f3a16ef8db59abfc8b94585a1fc5e /kernel/log.h
parent026fed31356faa5a1b21a6270dd5cf0c745bb76e (diff)
parent8297afe92588c881fbf0590a64c81af08e6f20f6 (diff)
downloadyosys-637650597b27a2e2f5407fc128ffd21d7a0b3016.tar.gz
yosys-637650597b27a2e2f5407fc128ffd21d7a0b3016.tar.bz2
yosys-637650597b27a2e2f5407fc128ffd21d7a0b3016.zip
Merge pull request #2059 from boqwxp/logger-vector-to-dict
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.h13
1 files changed, 5 insertions, 8 deletions
diff --git a/kernel/log.h b/kernel/log.h
index 6c5de78d7..516744b50 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);