+int get_layout_value(const Layout &layout, const string &name, int def_value)
+{
+ auto i = find_member(layout.qualifiers, name, &Layout::Qualifier::name);
+ return (i!=layout.qualifiers.end() ? i->value : def_value);
+}
+
+void add_to_chain(Assignment::Target &target, Assignment::Target::ChainType type, unsigned index)
+{
+ if(target.chain_len<7)
+ target.chain[target.chain_len] = type | min<unsigned>(index, 0x3F);
+ ++target.chain_len;