Mercurial > lcfOS
diff python/ir/builder.py @ 174:3eb06f5fb987
Added memory alloc for locals
author | Windel Bouwman |
---|---|
date | Fri, 19 Apr 2013 19:22:52 +0200 |
parents | 5a7d37d615ee |
children | 46d62dadd61b |
line wrap: on
line diff
--- a/python/ir/builder.py Fri Apr 19 12:42:21 2013 +0200 +++ b/python/ir/builder.py Fri Apr 19 19:22:52 2013 +0200 @@ -9,14 +9,16 @@ yield a a = a + 1 self.nums = NumGen() - def gen(self): - return '{0}{1}'.format(self.prefix, self.nums.__next__()) + def gen(self, prefix=None): + if not prefix: + prefix = self.prefix + return '{0}{1}'.format(prefix, self.nums.__next__()) class ValueGenerator(NameGenerator): def __init__(self): super().__init__('t') - def gen(self): - v = Value(super().gen()) + def gen(self, prefix=None): + v = Value(super().gen(prefix)) return v class BBGenerator(NameGenerator):