RTLIL: use {get,set}_string_attribute in {get,set}_strpool_attribute.

The only difference in behavior is that this removes the attribute
when the pool becomes empty.
This commit is contained in:
whitequark 2020-06-08 19:02:48 +00:00
parent 83f84afc0b
commit e558905598
1 changed files with 2 additions and 2 deletions

View File

@ -319,7 +319,7 @@ void RTLIL::AttrObject::set_strpool_attribute(RTLIL::IdString id, const pool<str
attrval += "|";
attrval += s;
}
attributes[id] = RTLIL::Const(attrval);
set_string_attribute(id, attrval);
}
void RTLIL::AttrObject::add_strpool_attribute(RTLIL::IdString id, const pool<string> &data)
@ -334,7 +334,7 @@ pool<string> RTLIL::AttrObject::get_strpool_attribute(RTLIL::IdString id) const
{
pool<string> data;
if (attributes.count(id) != 0)
for (auto s : split_tokens(attributes.at(id).decode_string(), "|"))
for (auto s : split_tokens(get_string_attribute(id), "|"))
data.insert(s);
return data;
}