Implement an iterator over encodings (#96)
* Implement an iterator over encodings * Implement TargetIsa::legal_encodings * Exclude non-boolean settings of isa flags bytes * Address flake8 long line error
This commit is contained in:
committed by
Jakob Stoklund Olesen
parent
342121aba0
commit
1a480a2578
@@ -87,6 +87,10 @@ def gen_getters(sgrp, fmt):
|
||||
"""
|
||||
fmt.doc_comment("User-defined settings.")
|
||||
with fmt.indented('impl Flags {', '}'):
|
||||
fmt.doc_comment('Returns inner slice of bytes.')
|
||||
fmt.doc_comment('The byte-sized settings are not included.')
|
||||
with fmt.indented('pub fn predicate_bytes(&self) -> &[u8] {', '}'):
|
||||
fmt.line('&self.bytes[{}..]'.format(sgrp.boolean_offset))
|
||||
fmt.doc_comment('Dynamic numbered predicate getter.')
|
||||
with fmt.indented(
|
||||
'pub fn numbered_predicate(&self, p: usize) -> bool {', '}'):
|
||||
|
||||
Reference in New Issue
Block a user