diff --git a/parasitics/SpefParse.yy b/parasitics/SpefParse.yy index 39ad246f..260a212c 100755 --- a/parasitics/SpefParse.yy +++ b/parasitics/SpefParse.yy @@ -27,7 +27,7 @@ #include "Report.hh" #include "StringUtil.hh" -#include "StringSeq.hh" +#include "StringUtil.hh" #include "parasitics/SpefReaderPvt.hh" #include "parasitics/SpefScanner.hh" @@ -62,7 +62,7 @@ sta::SpefParse::error(const location_type &loc, char *string; int integer; float number; - sta::StringSeq *string_seq; + sta::StdStringSeq *std_string_seq; sta::PortDirection *port_dir; sta::SpefRspfPi *pi; sta::SpefTriple *triple; @@ -105,7 +105,7 @@ sta::SpefParse::error(const location_type &loc, %type hchar suffix_bus_delim prefix_bus_delim -%type qstrings +%type qstrings %type direction %type par_value total_cap @@ -220,11 +220,14 @@ design_flow: qstrings: QSTRING - { $$ = new sta::StringSeq; + { $$ = new sta::StdStringSeq; $$->push_back($1); + sta::stringDelete($1); } | qstrings QSTRING - { $$->push_back($2); } + { $$->push_back($2); + sta::stringDelete($2); + } ; hierarchy_div_def: diff --git a/parasitics/SpefReader.cc b/parasitics/SpefReader.cc index 7d0751f8..16f7a6dc 100644 --- a/parasitics/SpefReader.cc +++ b/parasitics/SpefReader.cc @@ -92,7 +92,6 @@ SpefReader::SpefReader(const std::string &filename, cap_scale_(1.0), res_scale_(1.0), induct_scale_(1.0), - design_flow_(nullptr), parasitics_(parasitics), parasitic_(nullptr) { @@ -101,11 +100,6 @@ SpefReader::SpefReader(const std::string &filename, SpefReader::~SpefReader() { - if (design_flow_) { - deleteContents(design_flow_); - delete design_flow_; - design_flow_ = nullptr; - } } bool @@ -297,9 +291,10 @@ SpefReader::portDirection(char *spef_dir) } void -SpefReader::setDesignFlow(StringSeq *flow) +SpefReader::setDesignFlow(StdStringSeq *flow) { - design_flow_ = flow; + design_flow_ = std::move(*flow); + delete flow; } Pin * diff --git a/parasitics/SpefReaderPvt.hh b/parasitics/SpefReaderPvt.hh index f96480c4..de0b8043 100644 --- a/parasitics/SpefReaderPvt.hh +++ b/parasitics/SpefReaderPvt.hh @@ -27,7 +27,7 @@ #include #include "Zlib.hh" -#include "StringSeq.hh" +#include "StringUtil.hh" #include "NetworkClass.hh" #include "ParasiticsClass.hh" #include "StaState.hh" @@ -82,7 +82,7 @@ public: void makeNameMapEntry(const char *index, const char *name); const char *nameMapLookup(const char *index); - void setDesignFlow(StringSeq *flow_keys); + void setDesignFlow(StdStringSeq *flow_keys); Pin *findPin(char *name); Net *findNet(const char *name); void rspfBegin(Net *net, @@ -139,7 +139,7 @@ private: float res_scale_; float induct_scale_; SpefNameMap name_map_; - StringSeq *design_flow_; + StdStringSeq design_flow_; Parasitics *parasitics_; Parasitic *parasitic_; };