[meta-python] Use named predicates for x86 encodings instead of anonymous predicates;
And generate those in a deterministic order that the Rust crate can reproduce easily.
This commit is contained in:
@@ -229,16 +229,25 @@ class SettingGroup(object):
|
||||
.format(self, SettingGroup._current))
|
||||
SettingGroup._current = None
|
||||
if globs:
|
||||
# Ensure that named predicates are ordered in a deterministic way
|
||||
# that the Rust crate may simply reproduce, by pushing entries into
|
||||
# a vector that we'll sort by name later.
|
||||
named_predicates = []
|
||||
|
||||
for name, obj in globs.items():
|
||||
if isinstance(obj, Setting):
|
||||
assert obj.name is None, obj.name
|
||||
obj.name = name
|
||||
if isinstance(obj, Predicate):
|
||||
self.named_predicates[name] = obj
|
||||
named_predicates.append((name, obj))
|
||||
if isinstance(obj, Preset):
|
||||
assert obj.name is None, obj.name
|
||||
obj.name = name
|
||||
|
||||
named_predicates.sort(key=lambda x: x[0])
|
||||
for (name, obj) in named_predicates:
|
||||
self.named_predicates[name] = obj
|
||||
|
||||
self.layout()
|
||||
|
||||
@staticmethod
|
||||
|
||||
Reference in New Issue
Block a user