Add a PredicateView type to abstract the predicate bit vector a bit.

The encoding tables contain references to numbered ISA predicates.

- Give the ISA Flags types a predicate_view() method which returns a
  PredicateView.
- Delete the old predicate_bytes() method which returned a raw &[u8].
- Use a 'static lifetime for the encoding list slice in the Encodings
  iterator, and a single 'a lifetime for everything else.
This commit is contained in:
Jakob Stoklund Olesen
2017-07-21 13:48:18 -07:00
parent 4142a9ca9c
commit f651ec4f78
8 changed files with 78 additions and 54 deletions

View File

@@ -138,11 +138,11 @@ pub trait TargetIsa {
fn register_info(&self) -> RegInfo;
/// Returns an iterartor over legal encodings for the instruction.
fn legal_encodings<'a, 'b>(&'a self,
dfg: &'b ir::DataFlowGraph,
inst: &'b ir::InstructionData,
ctrl_typevar: ir::Type)
-> Result<Encodings<'a, 'b>, Legalize>;
fn legal_encodings<'a>(&'a self,
dfg: &'a ir::DataFlowGraph,
inst: &'a ir::InstructionData,
ctrl_typevar: ir::Type)
-> Result<Encodings<'a>, Legalize>;
/// Encode an instruction after determining it is legal.
///