Allow building without std (#1069)

Closes https://github.com/CraneStation/cranelift/issues/1067
This commit is contained in:
Joshua Nelson
2019-09-26 12:00:03 -04:00
committed by Benjamin Bouvier
parent 40f6d3b753
commit a1f6457e8a
18 changed files with 43 additions and 31 deletions

View File

@@ -99,7 +99,7 @@ impl<'a> MemoryCodeSink<'a> {
unsafe {
#[cfg_attr(feature = "cargo-clippy", allow(clippy::cast_ptr_alignment))]
write_unaligned(self.data.offset(self.offset) as *mut T, x);
self.offset += std::mem::size_of::<T>() as isize;
self.offset += core::mem::size_of::<T>() as isize;
}
}
}

View File

@@ -4,7 +4,7 @@ use crate::isa::TargetIsa;
use std::vec::Vec;
type Num = u32;
const NUM_BITS: usize = std::mem::size_of::<Num>() * 8;
const NUM_BITS: usize = core::mem::size_of::<Num>() * 8;
/// Wrapper class for longer bit vectors that cannot be represented by a single BitSet.
#[derive(Clone, Debug)]
@@ -20,7 +20,7 @@ impl Stackmap {
isa: &dyn TargetIsa,
) -> Self {
let loc = &func.locations;
let mut live_ref_in_stack_slot = std::collections::HashSet::new();
let mut live_ref_in_stack_slot = crate::HashSet::new();
// References can be in registers, and live registers values are pushed onto the stack before calls and traps.
// TODO: Implement register maps. If a register containing a reference is spilled and reused after a safepoint,
// it could contain a stale reference value if the garbage collector relocated the value.