mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-23 23:34:48 +00:00
Update cranelift
This commit is contained in:
parent
1b4aad8615
commit
ea10842d95
20
Cargo.lock
generated
20
Cargo.lock
generated
@ -114,7 +114,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "cranelift"
|
||||
version = "0.28.0"
|
||||
source = "git+https://github.com/CraneStation/cranelift.git#2145dd3ffaedaea4db1bc4f238550beae3f0492e"
|
||||
source = "git+https://github.com/CraneStation/cranelift.git#50c66ae4788ff9a1715f220d2331df575017fa17"
|
||||
dependencies = [
|
||||
"cranelift-codegen 0.28.0 (git+https://github.com/CraneStation/cranelift.git)",
|
||||
"cranelift-frontend 0.28.0 (git+https://github.com/CraneStation/cranelift.git)",
|
||||
@ -123,7 +123,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "cranelift-bforest"
|
||||
version = "0.28.0"
|
||||
source = "git+https://github.com/CraneStation/cranelift.git#2145dd3ffaedaea4db1bc4f238550beae3f0492e"
|
||||
source = "git+https://github.com/CraneStation/cranelift.git#50c66ae4788ff9a1715f220d2331df575017fa17"
|
||||
dependencies = [
|
||||
"cranelift-entity 0.28.0 (git+https://github.com/CraneStation/cranelift.git)",
|
||||
]
|
||||
@ -131,7 +131,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "cranelift-codegen"
|
||||
version = "0.28.0"
|
||||
source = "git+https://github.com/CraneStation/cranelift.git#2145dd3ffaedaea4db1bc4f238550beae3f0492e"
|
||||
source = "git+https://github.com/CraneStation/cranelift.git#50c66ae4788ff9a1715f220d2331df575017fa17"
|
||||
dependencies = [
|
||||
"cranelift-bforest 0.28.0 (git+https://github.com/CraneStation/cranelift.git)",
|
||||
"cranelift-codegen-meta 0.28.0 (git+https://github.com/CraneStation/cranelift.git)",
|
||||
@ -145,7 +145,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "cranelift-codegen-meta"
|
||||
version = "0.28.0"
|
||||
source = "git+https://github.com/CraneStation/cranelift.git#2145dd3ffaedaea4db1bc4f238550beae3f0492e"
|
||||
source = "git+https://github.com/CraneStation/cranelift.git#50c66ae4788ff9a1715f220d2331df575017fa17"
|
||||
dependencies = [
|
||||
"cranelift-entity 0.28.0 (git+https://github.com/CraneStation/cranelift.git)",
|
||||
]
|
||||
@ -153,12 +153,12 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "cranelift-entity"
|
||||
version = "0.28.0"
|
||||
source = "git+https://github.com/CraneStation/cranelift.git#2145dd3ffaedaea4db1bc4f238550beae3f0492e"
|
||||
source = "git+https://github.com/CraneStation/cranelift.git#50c66ae4788ff9a1715f220d2331df575017fa17"
|
||||
|
||||
[[package]]
|
||||
name = "cranelift-faerie"
|
||||
version = "0.28.0"
|
||||
source = "git+https://github.com/CraneStation/cranelift.git#2145dd3ffaedaea4db1bc4f238550beae3f0492e"
|
||||
source = "git+https://github.com/CraneStation/cranelift.git#50c66ae4788ff9a1715f220d2331df575017fa17"
|
||||
dependencies = [
|
||||
"cranelift-codegen 0.28.0 (git+https://github.com/CraneStation/cranelift.git)",
|
||||
"cranelift-module 0.28.0 (git+https://github.com/CraneStation/cranelift.git)",
|
||||
@ -171,7 +171,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "cranelift-frontend"
|
||||
version = "0.28.0"
|
||||
source = "git+https://github.com/CraneStation/cranelift.git#2145dd3ffaedaea4db1bc4f238550beae3f0492e"
|
||||
source = "git+https://github.com/CraneStation/cranelift.git#50c66ae4788ff9a1715f220d2331df575017fa17"
|
||||
dependencies = [
|
||||
"cranelift-codegen 0.28.0 (git+https://github.com/CraneStation/cranelift.git)",
|
||||
"log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
@ -181,7 +181,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "cranelift-module"
|
||||
version = "0.28.0"
|
||||
source = "git+https://github.com/CraneStation/cranelift.git#2145dd3ffaedaea4db1bc4f238550beae3f0492e"
|
||||
source = "git+https://github.com/CraneStation/cranelift.git#50c66ae4788ff9a1715f220d2331df575017fa17"
|
||||
dependencies = [
|
||||
"cranelift-codegen 0.28.0 (git+https://github.com/CraneStation/cranelift.git)",
|
||||
"cranelift-entity 0.28.0 (git+https://github.com/CraneStation/cranelift.git)",
|
||||
@ -192,7 +192,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "cranelift-native"
|
||||
version = "0.28.0"
|
||||
source = "git+https://github.com/CraneStation/cranelift.git#2145dd3ffaedaea4db1bc4f238550beae3f0492e"
|
||||
source = "git+https://github.com/CraneStation/cranelift.git#50c66ae4788ff9a1715f220d2331df575017fa17"
|
||||
dependencies = [
|
||||
"cranelift-codegen 0.28.0 (git+https://github.com/CraneStation/cranelift.git)",
|
||||
"raw-cpuid 6.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
@ -202,7 +202,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "cranelift-simplejit"
|
||||
version = "0.28.0"
|
||||
source = "git+https://github.com/CraneStation/cranelift.git#2145dd3ffaedaea4db1bc4f238550beae3f0492e"
|
||||
source = "git+https://github.com/CraneStation/cranelift.git#50c66ae4788ff9a1715f220d2331df575017fa17"
|
||||
dependencies = [
|
||||
"cranelift-codegen 0.28.0 (git+https://github.com/CraneStation/cranelift.git)",
|
||||
"cranelift-module 0.28.0 (git+https://github.com/CraneStation/cranelift.git)",
|
||||
|
15
src/base.rs
15
src/base.rs
@ -127,13 +127,14 @@ fn trans_fn<'a, 'clif, 'tcx: 'a, B: Backend + 'static>(
|
||||
|
||||
// Step 9. Define function
|
||||
cx.caches.context.func = func;
|
||||
cx.module
|
||||
.define_function_peek_compiled(func_id, &mut cx.caches.context, |size, context, isa| {
|
||||
debug_context.as_mut().map(|x| x.define(tcx, size, context, isa, &source_info_set));
|
||||
})
|
||||
.unwrap();
|
||||
//let module = &mut cx.module;
|
||||
//let caches = &cx.caches;
|
||||
cx.module.define_function(func_id, &mut cx.caches.context).unwrap();
|
||||
|
||||
// Step 10. Define debuginfo for function
|
||||
let context = &cx.caches.context;
|
||||
let isa = cx.module.isa();
|
||||
debug_context.as_mut().map(|x| x.define(tcx, context, isa, &source_info_set));
|
||||
|
||||
// Step 11. Clear context to make it usable for the next function
|
||||
cx.caches.context.clear();
|
||||
}
|
||||
|
||||
|
@ -264,23 +264,10 @@ impl<'a, 'b, 'tcx: 'b> FunctionDebugContext<'a, 'tcx> {
|
||||
pub fn define(
|
||||
&mut self,
|
||||
tcx: TyCtxt,
|
||||
//module: &mut Module<impl Backend>,
|
||||
code_size: u32,
|
||||
context: &Context,
|
||||
isa: &cranelift::codegen::isa::TargetIsa,
|
||||
source_info_set: &indexmap::IndexSet<SourceInfo>,
|
||||
) {
|
||||
let entry = self.debug_context.dwarf.unit.get_mut(self.entry_id);
|
||||
entry.set(gimli::DW_AT_high_pc, AttributeValue::Udata(code_size as u64));
|
||||
|
||||
self.debug_context.unit_range_list.0.push(Range::StartLength {
|
||||
begin: Address::Relative {
|
||||
symbol: self.symbol,
|
||||
addend: 0,
|
||||
},
|
||||
length: code_size as u64,
|
||||
});
|
||||
|
||||
let line_program = &mut self.debug_context.dwarf.unit.line_program;
|
||||
|
||||
line_program.begin_sequence(Some(Address::Relative {
|
||||
@ -327,12 +314,18 @@ impl<'a, 'b, 'tcx: 'b> FunctionDebugContext<'a, 'tcx> {
|
||||
}
|
||||
}
|
||||
|
||||
if code_size != end {
|
||||
line_program.row().address_offset = end as u64;
|
||||
create_row_for_span(line_program, self.mir_span);
|
||||
}
|
||||
line_program.end_sequence(end as u64);
|
||||
|
||||
line_program.end_sequence(code_size as u64);
|
||||
let entry = self.debug_context.dwarf.unit.get_mut(self.entry_id);
|
||||
entry.set(gimli::DW_AT_high_pc, AttributeValue::Udata(end as u64));
|
||||
|
||||
self.debug_context.unit_range_list.0.push(Range::StartLength {
|
||||
begin: Address::Relative {
|
||||
symbol: self.symbol,
|
||||
addend: 0,
|
||||
},
|
||||
length: end as u64,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user