@@ -295,35 +295,35 @@ void yosys_shutdown()
295295#endif
296296}
297297
298- RTLIL::IdString new_id (std::string file, int line, std::string func)
298+ RTLIL::IdString new_id (std::string_view file, int line, std::string_view func)
299299{
300300#ifdef _WIN32
301301 size_t pos = file.find_last_of (" /\\ " );
302302#else
303303 size_t pos = file.find_last_of (' /' );
304304#endif
305- if (pos != std::string ::npos)
305+ if (pos != std::string_view ::npos)
306306 file = file.substr (pos+1 );
307307
308308 pos = func.find_last_of (' :' );
309- if (pos != std::string ::npos)
309+ if (pos != std::string_view ::npos)
310310 func = func.substr (pos+1 );
311311
312312 return stringf (" $auto$%s:%d:%s$%d" , file, line, func, autoidx++);
313313}
314314
315- RTLIL::IdString new_id_suffix (std::string file, int line, std::string func, std::string suffix)
315+ RTLIL::IdString new_id_suffix (std::string_view file, int line, std::string_view func, std::string_view suffix)
316316{
317317#ifdef _WIN32
318318 size_t pos = file.find_last_of (" /\\ " );
319319#else
320320 size_t pos = file.find_last_of (' /' );
321321#endif
322- if (pos != std::string ::npos)
322+ if (pos != std::string_view ::npos)
323323 file = file.substr (pos+1 );
324324
325325 pos = func.find_last_of (' :' );
326- if (pos != std::string ::npos)
326+ if (pos != std::string_view ::npos)
327327 func = func.substr (pos+1 );
328328
329329 return stringf (" $auto$%s:%d:%s$%s$%d" , file, line, func, suffix, autoidx++);
0 commit comments