- if(const BasicTypeDeclaration *basic1 = dynamic_cast<const BasicTypeDeclaration *>(&type1))
- {
- const BasicTypeDeclaration *basic2 = dynamic_cast<const BasicTypeDeclaration *>(&type2);
- if(!basic2)
- return false;
-
- if(basic1->kind!=basic2->kind || basic1->size!=basic2->size)
- return false;
-
- if(basic1->base_type && basic2->base_type)
- return is_same_type(*basic1->base_type, *basic2->base_type);
- else
- return (!basic1->base_type && !basic2->base_type);
- }
- else if(const ImageTypeDeclaration *image1 = dynamic_cast<const ImageTypeDeclaration *>(&type1))
- {
- const ImageTypeDeclaration *image2 = dynamic_cast<const ImageTypeDeclaration *>(&type2);
- if(!image2)
- return false;
+ auto i = find_member(layout.qualifiers, name, &Layout::Qualifier::name);
+ return (i!=layout.qualifiers.end() ? i->value : def_value);
+}