comparison python/ppci/codegen/registerallocator.py @ 366:39bf68bf1891

Fix sample tests and deterministic build
author Windel Bouwman
date Fri, 21 Mar 2014 09:43:01 +0100
parents b00219172a42
children
comparison
equal deleted inserted replaced
365:98ff43cfdd36 366:39bf68bf1891
1 import logging 1 import logging
2 from .flowgraph import FlowGraph 2 from .flowgraph import FlowGraph
3 from .interferencegraph import InterferenceGraph 3 from .interferencegraph import InterferenceGraph
4 4
5 # Nifty first function: 5 # Nifty first function:
6 first = lambda x: next(iter(x)) 6 def first(x):
7 """ Take the first element of a collection after sorting the things """
8 x = list(x)
9 x.sort()
10 return next(iter(x))
7 11
8 12
9 class RegisterAllocator: 13 class RegisterAllocator:
10 """ 14 """
11 Target independent register allocator. 15 Target independent register allocator.