TargetIsa implies a Display of shared and isa-specific flags

This commit is contained in:
Pat Hickey
2018-01-29 13:38:26 -08:00
committed by Jakob Stoklund Olesen
parent 21f0fc39ad
commit 099b959d57
5 changed files with 32 additions and 2 deletions

View File

@@ -13,6 +13,7 @@ use isa::Builder as IsaBuilder;
use isa::{TargetIsa, RegInfo, RegClass, EncInfo};
use ir;
use regalloc;
use std::fmt;
#[allow(dead_code)]
struct Isa {
@@ -252,3 +253,9 @@ mod tests {
assert_eq!(encstr(&*isa, isa.encode(&dfg, &mul32, types::I32)), "R#10c");
}
}
impl fmt::Display for Isa {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}\n{}", self.shared_flags, self.isa_flags)
}
}