Commit a211a120 authored by Jan Hoenig's avatar Jan Hoenig
Browse files

Removing function children. Args does the same

parent bfa625c1
......@@ -36,9 +36,6 @@ class Node(object):
result.update(arg.atoms(argType))
return result
def children(self):
yield None
class KernelFunction(Node):
......@@ -99,7 +96,7 @@ class KernelFunction(Node):
@property
def args(self):
return [self._body]
yield self._body
@property
def fieldsAccessed(self):
......@@ -113,8 +110,6 @@ class KernelFunction(Node):
l.isFieldStrideArgument, l.name),
reverse=True)
def children(self):
yield self.body
def __str__(self):
self._updateParameters()
......@@ -182,9 +177,6 @@ class Block(Node):
definedSymbols.update(a.symbolsDefined)
return result - definedSymbols
def children(self):
return self._nodes
def __str__(self):
return ''.join('{!s}\n'.format(node) for node in self._nodes)
......@@ -285,9 +277,6 @@ class LoopOverCoordinate(Node):
def coordinateToLoopOver(self):
return self._coordinateToLoopOver
def children(self):
yield self.body
def __str__(self):
return 'loop:{!s} in {!s}:{!s}:{!s}\n{!s}'.format(self.loopCounterName, self.start, self.stop, self.step,
textwrap.indent(str(self.body), '\t'))
......
......@@ -21,10 +21,10 @@ class DotPrinter(Printer):
self._print(loop.body)
def _print_Block(self, block):
for node in block.children():
for node in block.args:
self._print(node)
parent = block.parent
for node in block.children():
for node in block.args:
self.dot.edge(self._nodeToStrFunction(parent), self._nodeToStrFunction(node))
#parent = node
......
......@@ -122,7 +122,7 @@ class LLVMPrinter(Printer):
return fn
def _print_Block(self, block):
for node in block.children():
for node in block.args:
self._print(node)
def _print_LoopOverCoordinate(self, loop):
......
......@@ -515,4 +515,5 @@ def getLoopHierarchy(astNode):
node = getNextParentOfType(node, ast.LoopOverCoordinate)
if node:
result.append(node.coordinateToLoopOver)
return reversed(result)
\ No newline at end of file
return reversed(result)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment