Remove the debug crate's hard-coded dependency on register ordering

This commit is contained in:
Andrew Brown
2020-03-03 10:06:51 -08:00
parent 3f53bcb740
commit 1d15054310
10 changed files with 133 additions and 82 deletions

View File

@@ -64,6 +64,7 @@ use crate::timing;
use alloc::borrow::Cow;
use alloc::boxed::Box;
use core::fmt;
use core::fmt::{Debug, Formatter};
use target_lexicon::{triple, Architecture, PointerWidth, Triple};
use thiserror::Error;
@@ -390,3 +391,14 @@ pub trait TargetIsa: fmt::Display + Send + Sync {
// No-op by default
}
}
impl Debug for &dyn TargetIsa {
fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result {
write!(
f,
"TargetIsa {{ triple: {:?}, pointer_width: {:?}}}",
self.triple(),
self.pointer_width()
)
}
}