Reconstruct locations of the original source variable

This commit is contained in:
Yury Delendik
2019-03-06 11:20:26 -06:00
committed by Dan Gohman
parent d6059d4605
commit 8f95c51730
21 changed files with 556 additions and 31 deletions

View File

@@ -29,6 +29,7 @@ use crate::simple_gvn::do_simple_gvn;
use crate::simple_preopt::do_preopt;
use crate::timing;
use crate::unreachable_code::eliminate_unreachable_code;
use crate::value_label::{build_value_labels_ranges, ComparableSourceLoc, ValueLabelsRanges};
use crate::verifier::{verify_context, verify_locations, VerifierErrors, VerifierResult};
use std::vec::Vec;
@@ -331,4 +332,13 @@ impl Context {
self.verify_locations_if(isa)?;
Ok(code_size)
}
/// Builds ranges and location for specified value labels.
pub fn build_value_labels_ranges(&self, isa: &TargetIsa) -> CodegenResult<ValueLabelsRanges> {
Ok(build_value_labels_ranges::<ComparableSourceLoc>(
&self.func,
&self.regalloc,
isa,
))
}
}