Commit 55af254c authored by Robert Bradshaw's avatar Robert Bradshaw

More determinism in fused types.

parent b390a172
...@@ -6,6 +6,7 @@ from . import (ExprNodes, PyrexTypes, MemoryView, ...@@ -6,6 +6,7 @@ from . import (ExprNodes, PyrexTypes, MemoryView,
ParseTreeTransforms, StringEncoding, Errors) ParseTreeTransforms, StringEncoding, Errors)
from .ExprNodes import CloneNode, ProxyNode, TupleNode from .ExprNodes import CloneNode, ProxyNode, TupleNode
from .Nodes import FuncDefNode, CFuncDefNode, StatListNode, DefNode from .Nodes import FuncDefNode, CFuncDefNode, StatListNode, DefNode
from ..Utils import OrderedSet
class FusedCFuncDefNode(StatListNode): class FusedCFuncDefNode(StatListNode):
...@@ -576,7 +577,7 @@ class FusedCFuncDefNode(StatListNode): ...@@ -576,7 +577,7 @@ class FusedCFuncDefNode(StatListNode):
fused_index = 0 fused_index = 0
default_idx = 0 default_idx = 0
all_buffer_types = set() all_buffer_types = OrderedSet()
seen_fused_types = set() seen_fused_types = set()
for i, arg in enumerate(self.node.args): for i, arg in enumerate(self.node.args):
if arg.type.is_fused: if arg.type.is_fused:
......
...@@ -449,6 +449,22 @@ class LazyStr: ...@@ -449,6 +449,22 @@ class LazyStr:
return left + self.callback() return left + self.callback()
class OrderedSet(object):
def __init__(self, elements=()):
self._list = []
self._set = set()
self.update(elements)
def __iter__(self):
return iter(self._list)
def update(self, elements):
for e in elements:
self.add(e)
def add(self, e):
if e not in self._set:
self._list.append(e)
self._set.add(e)
# Class decorator that adds a metaclass and recreates the class with it. # Class decorator that adds a metaclass and recreates the class with it.
# Copied from 'six'. # Copied from 'six'.
def add_metaclass(metaclass): def add_metaclass(metaclass):
......
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