1.1 --- a/translator.py Tue Mar 14 22:54:03 2017 +0100
1.2 +++ b/translator.py Tue Mar 14 23:00:05 2017 +0100
1.3 @@ -647,16 +647,11 @@
1.4 access_location = self.deducer.const_accesses.get(location)
1.5 return self.deducer.reference_invocations_unsuitable.get(access_location or location)
1.6
1.7 - def get_accessor_kinds(self, locations):
1.8 -
1.9 - "Return the accessor kinds for 'locations'."
1.10 -
1.11 - accessor_kinds = set()
1.12 - for location in locations:
1.13 - kinds = self.deducer.accessor_kinds.get(location)
1.14 - if kinds:
1.15 - accessor_kinds.update(kinds)
1.16 - return accessor_kinds
1.17 + def get_accessor_kinds(self, location):
1.18 +
1.19 + "Return the accessor kinds for 'location'."
1.20 +
1.21 + return self.deducer.accessor_kinds.get(location)
1.22
1.23 def get_access_location(self, name, attrnames=None):
1.24
1.25 @@ -1025,7 +1020,6 @@
1.26
1.27 objpath = expr.get_origin()
1.28 location = expr.access_location()
1.29 - locations = expr.access_locations()
1.30
1.31 # Identified target details.
1.32
1.33 @@ -1080,8 +1074,7 @@
1.34
1.35 context_required = self.is_method(objpath)
1.36
1.37 - accessor_kinds = location and self.get_accessor_kinds([location]) or \
1.38 - locations and self.get_accessor_kinds(locations)
1.39 + accessor_kinds = location and self.get_accessor_kinds(location)
1.40
1.41 instance_accessor = accessor_kinds and \
1.42 len(accessor_kinds) == 1 and \
1.43 @@ -1456,7 +1449,7 @@
1.44
1.45 refs = self.deducer.referenced_objects.get(location)
1.46 refs = refs or self.deducer.accessor_all_types.get(location)
1.47 - return AliasResult(name_ref, refs or set(), [location])
1.48 + return AliasResult(name_ref, refs or set(), location)
1.49
1.50 def make_volatile(self, name):
1.51
2.1 --- a/transresults.py Tue Mar 14 22:54:03 2017 +0100
2.2 +++ b/transresults.py Tue Mar 14 23:00:05 2017 +0100
2.3 @@ -71,9 +71,6 @@
2.4 def access_location(self):
2.5 return self.location
2.6
2.7 - def access_locations(self):
2.8 - return self.location and [self.location]
2.9 -
2.10 def __str__(self):
2.11
2.12 "Return an output representation of the referenced name."
2.13 @@ -188,9 +185,6 @@
2.14 def access_location(self):
2.15 return self.location
2.16
2.17 - def access_locations(self):
2.18 - return self.location and [self.location]
2.19 -
2.20 def context(self):
2.21 return self.context_identity
2.22
2.23 @@ -218,11 +212,11 @@
2.24
2.25 "An alias for other values."
2.26
2.27 - def __init__(self, name_ref, refs, locations):
2.28 + def __init__(self, name_ref, refs, location):
2.29 NameRef.__init__(self, name_ref.name, is_global=name_ref.is_global_name())
2.30 self.name_ref = name_ref
2.31 self.refs = refs
2.32 - self.locations = locations
2.33 + self.location = location
2.34
2.35 def references(self):
2.36 ref = self.name_ref.reference()
2.37 @@ -233,10 +227,7 @@
2.38 return len(refs) == 1 and first(refs) or None
2.39
2.40 def access_location(self):
2.41 - return len(self.locations) == 1 and first(self.locations) or None
2.42 -
2.43 - def access_locations(self):
2.44 - return self.locations
2.45 + return self.location
2.46
2.47 def get_name(self):
2.48 ref = self.reference()