[meta] Use named predicates for x86 settings in the Rust crate too;

And generate them using the same deterministic order that the Python
code uses.
This commit is contained in:
Benjamin Bouvier
2019-04-16 15:24:28 +02:00
parent 6a25354520
commit 390cfb37da
3 changed files with 62 additions and 25 deletions

View File

@@ -23,6 +23,15 @@ macro_rules! predicate {
($a:ident && $($b:tt)*) => {
PredicateNode::And(Box::new($a.into()), Box::new(predicate!($($b)*)))
};
(!$a:ident && $($b:tt)*) => {
PredicateNode::And(
Box::new(PredicateNode::Not(Box::new($a.into()))),
Box::new(predicate!($($b)*))
)
};
(!$a:ident) => {
PredicateNode::Not(Box::new($a.into()))
};
($a:ident) => {
$a.into()
};