From: Clifford Wolf Date: Sun, 3 Aug 2014 12:59:13 +0000 (+0200) Subject: Added ID() macro for static IdStrings X-Git-Tag: yosys-0.4~315 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=75423169c59022b3680aa3bf7de0877bc43a8082;p=yosys.git Added ID() macro for static IdStrings --- diff --git a/kernel/yosys.h b/kernel/yosys.h index 34777c9a4..f9bbc0e44 100644 --- a/kernel/yosys.h +++ b/kernel/yosys.h @@ -103,6 +103,9 @@ RTLIL::IdString new_id(std::string file, int line, std::string func); #define NEW_ID \ YOSYS_NAMESPACE_PREFIX new_id(__FILE__, __LINE__, __FUNCTION__) +#define ID(_str) \ + ([]() { static YOSYS_NAMESPACE_PREFIX RTLIL::IdString _id(_str); return _id; })() + RTLIL::Design *yosys_get_design(); std::string proc_self_dirname(); std::string proc_share_dirname();