1.1 --- a/docs/annotations.txt Sun Oct 27 02:39:45 2013 +0200
1.2 +++ b/docs/annotations.txt Sun Oct 27 02:55:51 2013 +0200
1.3 @@ -67,8 +67,6 @@
1.4 branch
1.5 _attrbranches indicates the immediate contributors to attribute usage
1.6 known to a node
1.7 -_attrrevbranches indicates the immediate recipients of attribute usage known
1.8 - to a node (and is thus the inverse of _attrbranches)
1.9 _attrcontributors defines nodes contributing to combined attribute usage known
1.10 to a node (and is thus the accumulation of all contributors
1.11 via branches)
2.1 --- a/micropython/branch.py Sun Oct 27 02:39:45 2013 +0200
2.2 +++ b/micropython/branch.py Sun Oct 27 02:55:51 2013 +0200
2.3 @@ -381,11 +381,6 @@
2.4 if node._attrbranches is None:
2.5 node._attrbranches = []
2.6
2.7 - # Branches receiving usage from this node.
2.8 -
2.9 - if node._attrrevbranches is None:
2.10 - node._attrrevbranches = []
2.11 -
2.12 # Definitions receiving usage from this node.
2.13
2.14 if node._attrdefs is None:
2.15 @@ -542,7 +537,6 @@
2.16 for user in all_users:
2.17 self._init_attribute_user(user)
2.18 user._attrbranches.append(node)
2.19 - node._attrrevbranches.append(user)
2.20
2.21 def _abandon_branch(self, retain_branch=True):
2.22
3.1 --- a/micropython/data.py Sun Oct 27 02:39:45 2013 +0200
3.2 +++ b/micropython/data.py Sun Oct 27 02:55:51 2013 +0200
3.3 @@ -574,29 +574,15 @@
3.4 self.users = None
3.5
3.6 def _get_defining_users(self):
3.7 -
3.8 - # NOTE: Re-evaluation may be necessary in places like loops where more
3.9 - # NOTE: branch information may be added.
3.10 -
3.11 if self.users is None:
3.12 users = set()
3.13 - visited = set()
3.14 for node in self.nodes:
3.15 - self._get_defining_users_for_node(node, visited, users)
3.16 + for user in node._attrdefs or [node]:
3.17 + if user._values and user._values.has_key(self.name):
3.18 + users.add(user)
3.19 self.users = users
3.20 return self.users
3.21
3.22 - def _get_defining_users_for_node(self, node, visited, users):
3.23 - if node in visited:
3.24 - return
3.25 - visited.add(node)
3.26 - if not node._attrrevbranches:
3.27 - if node._values and node._values.has_key(self.name):
3.28 - users.add(node)
3.29 - return
3.30 - for n in node._attrrevbranches:
3.31 - self._get_defining_users_for_node(n, visited, users)
3.32 -
3.33 def get_assignments(self):
3.34 return len(self._get_defining_users())
3.35