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.
{
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;
}