techmap: Replace naughty `const_cast<>()`s.
authorAlberto Gonzalez <boqwxp@airmail.cc>
Tue, 21 Apr 2020 17:47:00 +0000 (17:47 +0000)
committerAlberto Gonzalez <boqwxp@airmail.cc>
Thu, 14 May 2020 20:06:55 +0000 (20:06 +0000)
Co-Authored-By: Eddie Hung <eddie@fpgeh.com>
passes/techmap/techmap.cc

index 0b88e5910e3e98c90881ab5d0965a60029334340..6ac1d111361036b4e9d3155921751bc840cb4464 100644 (file)
@@ -413,8 +413,10 @@ struct TechmapWorker
                                if (autopurge) {
                                        autopurge_ports.push_back(conn.first);
                                } else {
-                                       apply_prefix(cell->name, const_cast<RTLIL::SigSpec&>(conn.second), module);
-                                       port_signal_map.apply(const_cast<RTLIL::SigSpec&>(conn.second));
+                                       RTLIL::SigSpec new_conn = conn.second;
+                                       apply_prefix(cell->name, new_conn, module);
+                                       port_signal_map.apply(new_conn);
+                                       c->setPort(conn.first, std::move(new_conn));
                                }
                        }