diff options
author | Clifford Wolf <clifford@clifford.at> | 2015-01-24 12:16:46 +0100 |
---|---|---|
committer | Clifford Wolf <clifford@clifford.at> | 2015-01-24 12:16:46 +0100 |
commit | 2a9ad48eb63a5f019c528fe46ceca0065364a44d (patch) | |
tree | a84eec02de3e555ca502d9fc4cdc2d9ca66b203c /kernel | |
parent | 8fe9ab50e51204e5709eaad0fbf2ffb5397a0194 (diff) | |
download | yosys-2a9ad48eb63a5f019c528fe46ceca0065364a44d.tar.gz yosys-2a9ad48eb63a5f019c528fe46ceca0065364a44d.tar.bz2 yosys-2a9ad48eb63a5f019c528fe46ceca0065364a44d.zip |
Added ENABLE_NDEBUG makefile options
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/log.h | 2 | ||||
-rw-r--r-- | kernel/macc.h | 4 | ||||
-rw-r--r-- | kernel/modtools.h | 6 | ||||
-rw-r--r-- | kernel/yosys.cc | 2 |
4 files changed, 9 insertions, 5 deletions
diff --git a/kernel/log.h b/kernel/log.h index 8b3d8a3ad..fd35c7bf7 100644 --- a/kernel/log.h +++ b/kernel/log.h @@ -220,7 +220,7 @@ static inline void log_dump_val_worker(char *v) { log("%s", v); } static inline void log_dump_val_worker(const char *v) { log("%s", v); } static inline void log_dump_val_worker(std::string v) { log("%s", v.c_str()); } static inline void log_dump_val_worker(PerformanceTimer p) { log("%f seconds", p.sec()); } -static inline void log_dump_args_worker(const char *p) { log_assert(*p == 0); } +static inline void log_dump_args_worker(const char *p YS_ATTRIBUTE(unused)) { log_assert(*p == 0); } void log_dump_val_worker(RTLIL::SigSpec v); template<typename T> diff --git a/kernel/macc.h b/kernel/macc.h index ab17f8c41..cac5b00d7 100644 --- a/kernel/macc.h +++ b/kernel/macc.h @@ -105,10 +105,12 @@ struct Macc bit_ports = cell->getPort("\\B"); std::vector<RTLIL::State> config_bits = cell->getParam("\\CONFIG").bits; - int config_width = cell->getParam("\\CONFIG_WIDTH").as_int(); int config_cursor = 0; +#ifndef NDEBUG + int config_width = cell->getParam("\\CONFIG_WIDTH").as_int(); log_assert(GetSize(config_bits) >= config_width); +#endif int num_bits = 0; if (config_bits[config_cursor++] == RTLIL::S1) num_bits |= 1; diff --git a/kernel/modtools.h b/kernel/modtools.h index 113b0918d..5fd7ef5a6 100644 --- a/kernel/modtools.h +++ b/kernel/modtools.h @@ -130,7 +130,7 @@ struct ModIndex : public RTLIL::Monitor port_add(cell, port, sig); } - virtual void notify_connect(RTLIL::Module *mod, const RTLIL::SigSig &sigsig) YS_OVERRIDE + virtual void notify_connect(RTLIL::Module *mod YS_ATTRIBUTE(unused), const RTLIL::SigSig &sigsig) YS_OVERRIDE { log_assert(module == mod); @@ -174,13 +174,13 @@ struct ModIndex : public RTLIL::Monitor } } - virtual void notify_connect(RTLIL::Module *mod, const std::vector<RTLIL::SigSig>&) YS_OVERRIDE + virtual void notify_connect(RTLIL::Module *mod YS_ATTRIBUTE(unused), const std::vector<RTLIL::SigSig>&) YS_OVERRIDE { log_assert(module == mod); auto_reload_module = true; } - virtual void notify_blackout(RTLIL::Module *mod) YS_OVERRIDE + virtual void notify_blackout(RTLIL::Module *mod YS_ATTRIBUTE(unused)) YS_OVERRIDE { log_assert(module == mod); auto_reload_module = true; diff --git a/kernel/yosys.cc b/kernel/yosys.cc index ac1bc7abf..d5467afe1 100644 --- a/kernel/yosys.cc +++ b/kernel/yosys.cc @@ -319,11 +319,13 @@ std::string make_temp_dir(std::string template_str) mkdir(template_str.c_str()); return template_str; #else +# ifndef NDEBUG size_t pos = template_str.rfind("XXXXXX"); log_assert(pos != std::string::npos); int suffixlen = GetSize(template_str) - pos - 6; log_assert(suffixlen == 0); +# endif char *p = strdup(template_str.c_str()); p = mkdtemp(p); |