1.1 --- a/deducer.py Thu Mar 09 21:55:38 2017 +0100
1.2 +++ b/deducer.py Thu Mar 09 23:20:23 2017 +0100
1.3 @@ -131,7 +131,8 @@
1.4 # access/attribute-specific accessor tests.
1.5
1.6 self.reference_all_attrs = {}
1.7 - self.reference_all_attrtypes = {}
1.8 + self.reference_all_providers = {}
1.9 + self.reference_all_provider_kinds = {}
1.10 self.reference_all_accessor_types = {}
1.11 self.reference_all_accessor_general_types = {}
1.12 self.reference_test_types = {}
1.13 @@ -604,17 +605,24 @@
1.14
1.15 attrname = get_attrname_from_location(location)
1.16
1.17 - all_accessed_attrs = set()
1.18 - all_providers = set()
1.19 + self.reference_all_attrs[location] = all_accessed_attrs = []
1.20 + self.reference_all_providers[location] = all_providers = []
1.21 + self.reference_all_provider_kinds[location] = all_provider_kinds = set()
1.22
1.23 # Obtain provider and attribute details for this kind of
1.24 # object.
1.25
1.26 for attrtype, object_type, attr in referenced_attrs:
1.27 - all_accessed_attrs.add(attr)
1.28 - all_providers.add(object_type)
1.29 -
1.30 - self.reference_all_attrs[location] = all_accessed_attrs
1.31 + all_accessed_attrs.append(attr)
1.32 + all_providers.append(object_type)
1.33 + all_provider_kinds.add(attrtype)
1.34 +
1.35 + # Obtain reference and provider information as sets for the
1.36 + # operations below, retaining the list forms for use with
1.37 + # instruction plan preparation.
1.38 +
1.39 + all_accessed_attrs = set(all_accessed_attrs)
1.40 + all_providers = set(all_providers)
1.41 all_general_providers = self.get_most_general_types(all_providers)
1.42
1.43 # Determine which attributes would be provided by the
1.44 @@ -1974,17 +1982,11 @@
1.45 remaining = attrnames.split(".")
1.46 attrname = remaining[0]
1.47
1.48 - # Obtain reference and accessor information, retaining also distinct
1.49 - # provider kind details.
1.50 -
1.51 - attrs = []
1.52 - objtypes = []
1.53 - provider_kinds = set()
1.54 -
1.55 - for attrtype, objtype, attr in self.referenced_attrs[location]:
1.56 - attrs.append(attr)
1.57 - objtypes.append(objtype)
1.58 - provider_kinds.add(attrtype)
1.59 + # Obtain reference, provider and provider kind information.
1.60 +
1.61 + attrs = self.reference_all_attrs[location]
1.62 + provider_types = self.reference_all_providers[location]
1.63 + provider_kinds = self.reference_all_provider_kinds[location]
1.64
1.65 # Obtain accessor type and kind information.
1.66
1.67 @@ -2016,10 +2018,10 @@
1.68 base = None
1.69 dynamic_base = None
1.70
1.71 - # Constant accesses have static accessors.
1.72 + # Constant accesses have static providers.
1.73
1.74 if const_access:
1.75 - base = len(objtypes) == 1 and first(objtypes)
1.76 + base = len(provider_types) == 1 and first(provider_types)
1.77
1.78 # Name-based accesses.
1.79