intel/genxml: Handle field names with different spacing/hyphen

If a field name differs slightly between two generations then this
change will still add the fields into the same group.

For example, these will be treated as equal:
* "Software Exception" and "Software  Exception"
* "Per Thread" and "Per-Thread"

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
This commit is contained in:
Jordan Justen 2017-08-16 18:19:39 -07:00
parent 973b49386c
commit acce7d3460
No known key found for this signature in database
GPG key ID: 37F99F68CAF992EB

View file

@ -182,12 +182,13 @@ class Container(object):
self.length_by_gen[gen] = xml_attrs['length']
def get_field(self, field_name, create=False):
if field_name not in self.fields:
key = to_alphanum(field_name)
if key not in self.fields:
if create:
self.fields[field_name] = Field(self, field_name)
self.fields[key] = Field(self, field_name)
else:
return None
return self.fields[field_name]
return self.fields[key]
def has_prop(self, prop):
if prop == 'length':