From: Sahand Kashani Date: Wed, 8 Apr 2020 21:20:56 +0000 (+0200) Subject: Remove unnecessary pruning of double-quoting X-Git-Tag: working-ls180~630^2~3 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=820e3d1dad4f484f9646588f79b73b21b495e3d8;p=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. --- diff --git a/backends/firrtl/firrtl.cc b/backends/firrtl/firrtl.cc index 0cac437ac..3ef886664 100644 --- a/backends/firrtl/firrtl.cc +++ b/backends/firrtl/firrtl.cc @@ -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; }