Lichen

Change of optimiser.py

693:6b790fb0924e
optimiser.py
     1.1 --- a/optimiser.py	Fri Mar 10 17:26:58 2017 +0100
     1.2 +++ b/optimiser.py	Fri Mar 10 17:57:07 2017 +0100
     1.3 @@ -435,8 +435,22 @@
     1.4                  attrnames = filter(lambda x: not x.startswith("$t"), attrnames)
     1.5                  self.all_attrs[(objkind, name)] = attrnames
     1.6  
     1.7 -        self.locations = get_allocated_locations(self.all_attrs,
     1.8 -            get_attributes_and_sizes, self.existing_locations)
     1.9 +        try:
    1.10 +            self.locations = get_allocated_locations(self.all_attrs,
    1.11 +                get_attributes_and_sizes, self.existing_locations)
    1.12 +
    1.13 +        # Uphold positioning conflicts only if the existing locations were
    1.14 +        # explicitly specified.
    1.15 +
    1.16 +        except OptimiseError:
    1.17 +            if self.locations_filename:
    1.18 +                raise
    1.19 +
    1.20 +            # Otherwise, reposition attributes, causing the program to be
    1.21 +            # regenerated.
    1.22 +
    1.23 +            self.locations = get_allocated_locations(self.all_attrs,
    1.24 +                get_attributes_and_sizes)
    1.25  
    1.26      def populate_parameters(self):
    1.27