From edd2bf12fdd7be176634aa68957a99493a999a48 Mon Sep 17 00:00:00 2001 From: bjorn3 Date: Tue, 14 May 2019 15:54:04 +0200 Subject: [PATCH] Export ValueLocRange and DisplayFunctionAnnotations::default() --- cranelift/codegen/src/ir/function.rs | 3 ++- cranelift/codegen/src/lib.rs | 2 +- cranelift/codegen/src/value_label.rs | 3 +++ 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/cranelift/codegen/src/ir/function.rs b/cranelift/codegen/src/ir/function.rs index a07b0318df..6a1d4cdd0d 100644 --- a/cranelift/codegen/src/ir/function.rs +++ b/cranelift/codegen/src/ir/function.rs @@ -228,7 +228,8 @@ pub struct DisplayFunctionAnnotations<'a> { } impl<'a> DisplayFunctionAnnotations<'a> { - fn default() -> Self { + /// Create a DisplayFunctionAnnotations with all fields set to None. + pub fn default() -> Self { DisplayFunctionAnnotations { isa: None, value_ranges: None, diff --git a/cranelift/codegen/src/lib.rs b/cranelift/codegen/src/lib.rs index 46ab39d971..5b809460cf 100644 --- a/cranelift/codegen/src/lib.rs +++ b/cranelift/codegen/src/lib.rs @@ -57,7 +57,7 @@ use std::collections::{hash_map, HashMap, HashSet}; pub use crate::context::Context; pub use crate::legalizer::legalize_function; -pub use crate::value_label::ValueLabelsRanges; +pub use crate::value_label::{ValueLabelsRanges, ValueLocRange}; pub use crate::verifier::verify_function; pub use crate::write::write_function; diff --git a/cranelift/codegen/src/value_label.rs b/cranelift/codegen/src/value_label.rs index f8efca7996..d70d6258fa 100644 --- a/cranelift/codegen/src/value_label.rs +++ b/cranelift/codegen/src/value_label.rs @@ -11,8 +11,11 @@ use std::vec::Vec; /// Value location range. #[derive(Debug, Clone, Copy)] pub struct ValueLocRange { + /// The ValueLoc containing a ValueLabel during this range. pub loc: ValueLoc, + /// The start of the range. pub start: u32, + /// The end of the range. pub end: u32, }