mirror of https://github.com/YosysHQ/yosys.git
Remove unnecessary pruning of double-quoting
In the past I was calling the ILANG_BACKEND::dump_const() to dump values to an output stream. When these values were strings, the function used to add quotes around them. The firrtl compiler, in turn, escaped these quotes and the result was double-quoted strings which were hard to read. However I'm now calling design_entity->get_src_attribute() directly and there is no additional quote being put around it, so we can safely remove the unnecessary call to str.erase() here.
This commit is contained in:
parent
6c2b220af5
commit
820e3d1dad
|
@ -47,11 +47,6 @@ std::string getFileinfo(const RTLIL::AttrObject *design_entity)
|
|||
{
|
||||
std::string src(design_entity->get_src_attribute());
|
||||
std::string fileinfo_str = src.empty() ? "" : "@[" + src + "]";
|
||||
|
||||
// Remove quotes from src attribute as firrtl automatically escapes and
|
||||
// double-quotes them.
|
||||
fileinfo_str.erase(std::remove(fileinfo_str.begin(), fileinfo_str.end(), '\"'), fileinfo_str.end());
|
||||
|
||||
return fileinfo_str;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue