mirror of
				https://github.com/YosysHQ/yosys
				synced 2025-11-04 05:19:11 +00:00 
			
		
		
		
	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:
		
							parent
							
								
									83f84afc0b
								
							
						
					
					
						commit
						e558905598
					
				
					 1 changed files with 2 additions and 2 deletions
				
			
		| 
						 | 
					@ -319,7 +319,7 @@ void RTLIL::AttrObject::set_strpool_attribute(RTLIL::IdString id, const pool<str
 | 
				
			||||||
			attrval += "|";
 | 
								attrval += "|";
 | 
				
			||||||
		attrval += s;
 | 
							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)
 | 
					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;
 | 
						pool<string> data;
 | 
				
			||||||
	if (attributes.count(id) != 0)
 | 
						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);
 | 
								data.insert(s);
 | 
				
			||||||
	return data;
 | 
						return data;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue