1.1 --- a/optimiser.py Mon Oct 24 23:05:37 2016 +0200
1.2 +++ b/optimiser.py Tue Oct 25 00:12:01 2016 +0200
1.3 @@ -304,7 +304,7 @@
1.4
1.5 "Populate parameter tables using parameter information."
1.6
1.7 - self.arg_locations = get_allocated_locations(self.importer.function_parameters, get_parameters_and_sizes)
1.8 + self.arg_locations = [set()] + get_allocated_locations(self.importer.function_parameters, get_parameters_and_sizes)
1.9
1.10 def position_attributes(self):
1.11
1.12 @@ -568,16 +568,16 @@
1.13
1.14 for i, argnames in enumerate(self.arg_locations):
1.15
1.16 - # Position the arguments after the first context argument.
1.17 + # Position the arguments.
1.18
1.19 for argname in argnames:
1.20 - param_locations[argname] = i + 1
1.21 + param_locations[argname] = i
1.22
1.23 for name, argnames in self.importer.function_parameters.items():
1.24
1.25 # Allocate an extra context parameter in the table.
1.26
1.27 - l = self.parameters[name] = [None] + [None] * len(argnames)
1.28 + l = self.parameters[name] = [None] * len(argnames)
1.29
1.30 # Store an entry for the name along with the name's position in the
1.31 # parameter list.
1.32 @@ -593,7 +593,7 @@
1.33 # Indicate an argument list position starting from 1 (after the
1.34 # initial context argument).
1.35
1.36 - l[position] = (argname, pos + 1)
1.37 + l[position] = (argname, pos)
1.38
1.39 def populate_tables(self):
1.40
1.41 @@ -832,6 +832,13 @@
1.42 # Return the list of attribute names from each row of the allocated
1.43 # attributes table.
1.44
1.45 - return [set([attrname for attrname in attrnames if attrname]) for attrnames in allocated]
1.46 + locations = []
1.47 + for attrnames in allocated:
1.48 + l = set()
1.49 + for attrname in attrnames:
1.50 + if attrname:
1.51 + l.add(attrname)
1.52 + locations.append(l)
1.53 + return locations
1.54
1.55 # vim: tabstop=4 expandtab shiftwidth=4