From 820e3d1dad4f484f9646588f79b73b21b495e3d8 Mon Sep 17 00:00:00 2001 From: Sahand Kashani Date: Wed, 8 Apr 2020 23:20:56 +0200 Subject: 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. --- backends/firrtl/firrtl.cc | 5 ----- 1 file changed, 5 deletions(-) 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; } -- cgit v1.2.3