Generate code to precompute predicates.
Each ISA predicate is assigned a bit the the Flags struct, and a corresponding method is generated.
This commit is contained in:
@@ -63,6 +63,15 @@ class BoolSetting(Setting):
|
||||
else:
|
||||
return 0
|
||||
|
||||
def rust_predicate(self, prec):
|
||||
"""
|
||||
Return the Rust code to compute the value of this setting.
|
||||
|
||||
The emitted code assumes that the setting group exists as a local
|
||||
variable.
|
||||
"""
|
||||
return '{}.{}()'.format(self.group.name, self.name)
|
||||
|
||||
|
||||
class NumSetting(Setting):
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user