1.1 --- a/translator.py Mon Mar 13 18:45:41 2017 +0100
1.2 +++ b/translator.py Thu Mar 16 18:13:34 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 @@ -1026,7 +1021,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 @@ -1081,8 +1075,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 @@ -1386,11 +1379,6 @@
1.44 ref, paths = self.importer.get_module(self.name).special[n.name]
1.45 return TrResolvedNameRef(n.name, ref)
1.46
1.47 - # Temporary names are output program locals.
1.48 -
1.49 - elif n.name.startswith("$t"):
1.50 - return TrResolvedNameRef(n.name, Reference("<var>"), expr=expr)
1.51 -
1.52 # Get the appropriate name for the name reference, using the same method
1.53 # as in the inspector.
1.54
1.55 @@ -1453,8 +1441,7 @@
1.56
1.57 name_ref = TrResolvedNameRef(n.name, ref, expr=expr, is_global=is_global,
1.58 location=location)
1.59 - result = self.get_aliases(name_ref)
1.60 - return result or name_ref
1.61 + return not expr and self.get_aliases(name_ref) or name_ref
1.62
1.63 def get_aliases(self, name_ref):
1.64
1.65 @@ -1462,21 +1449,9 @@
1.66
1.67 location = name_ref.access_location()
1.68
1.69 - accessor_locations = location and self.deducer.get_accessors_for_access(location)
1.70 - alias_refs = set()
1.71 - access_locations = set()
1.72 -
1.73 - if accessor_locations:
1.74 - for accessor_location in accessor_locations:
1.75 - aliased_accesses = self.deducer.alias_index.get(accessor_location)
1.76 - if not aliased_accesses:
1.77 - continue
1.78 - access_locations.update(aliased_accesses)
1.79 - refs = self.deducer.referenced_objects.get(accessor_location)
1.80 - if refs:
1.81 - alias_refs.update(refs)
1.82 -
1.83 - return AliasResult(name_ref, alias_refs, access_locations)
1.84 + refs = self.deducer.referenced_objects.get(location)
1.85 + refs = refs or self.deducer.accessor_all_types.get(location)
1.86 + return AliasResult(name_ref, refs or set(), location)
1.87
1.88 def make_volatile(self, name):
1.89