3
0
Fork 0
mirror of https://github.com/YosysHQ/yosys synced 2026-07-24 16:12:33 +00:00

Merge from upstream

This commit is contained in:
Akash Levy 2025-11-12 08:14:33 -08:00
commit 71586d39b0
14 changed files with 720 additions and 260 deletions

View file

@ -298,35 +298,35 @@ void yosys_shutdown()
#endif
}
RTLIL::IdString new_id(std::string file, int line, std::string func)
const std::string *create_id_prefix(std::string_view file, int line, std::string_view func)
{
#ifdef _WIN32
size_t pos = file.find_last_of("/\\");
#else
size_t pos = file.find_last_of('/');
#endif
if (pos != std::string::npos)
if (pos != std::string_view::npos)
file = file.substr(pos+1);
pos = func.find_last_of(':');
if (pos != std::string::npos)
if (pos != std::string_view::npos)
func = func.substr(pos+1);
return stringf("$auto$%s:%d:%s$%d", file, line, func, autoidx++);
return new std::string(stringf("$auto$%s:%d:%s$", file, line, func));
}
RTLIL::IdString new_id_suffix(std::string file, int line, std::string func, std::string suffix)
RTLIL::IdString new_id_suffix(std::string_view file, int line, std::string_view func, std::string_view suffix)
{
#ifdef _WIN32
size_t pos = file.find_last_of("/\\");
#else
size_t pos = file.find_last_of('/');
#endif
if (pos != std::string::npos)
if (pos != std::string_view::npos)
file = file.substr(pos+1);
pos = func.find_last_of(':');
if (pos != std::string::npos)
if (pos != std::string_view::npos)
func = func.substr(pos+1);
return stringf("$auto$%s:%d:%s$%s$%d", file, line, func, suffix, autoidx++);