Allow building without std (#1069)
Closes https://github.com/CraneStation/cranelift/issues/1067
This commit is contained in:
committed by
Benjamin Bouvier
parent
40f6d3b753
commit
a1f6457e8a
@@ -14,13 +14,13 @@ edition = "2018"
|
||||
cranelift-codegen = { path = "../cranelift-codegen", version = "0.44.0", default-features = false }
|
||||
target-lexicon = "0.8.1"
|
||||
log = { version = "0.4.6", default-features = false }
|
||||
hashmap_core = { version = "0.1.9", optional = true }
|
||||
hashbrown = { version = "0.6", optional = true }
|
||||
smallvec = { version = "0.6.10" }
|
||||
|
||||
[features]
|
||||
default = ["std"]
|
||||
std = ["cranelift-codegen/std"]
|
||||
core = ["hashmap_core", "cranelift-codegen/core"]
|
||||
core = ["hashbrown", "cranelift-codegen/core"]
|
||||
|
||||
# Temporary feature that enforces basic block semantics.
|
||||
basic-blocks = ["cranelift-codegen/basic-blocks"]
|
||||
|
||||
@@ -341,7 +341,7 @@ impl<'a> FunctionBuilder<'a> {
|
||||
/// This will not do anything unless `func.dfg.collect_debug_info` is called first.
|
||||
pub fn set_val_label(&mut self, val: Value, label: ValueLabel) {
|
||||
if let Some(values_labels) = self.func.dfg.values_labels.as_mut() {
|
||||
use std::collections::hash_map::Entry;
|
||||
use crate::hash_map::Entry;
|
||||
|
||||
let start = ValueLabelStart {
|
||||
from: self.srcloc,
|
||||
|
||||
@@ -191,9 +191,9 @@ extern crate alloc as std;
|
||||
extern crate std;
|
||||
|
||||
#[cfg(not(feature = "std"))]
|
||||
use hashmap_core::HashMap;
|
||||
use hashbrown::{hash_map, HashMap};
|
||||
#[cfg(feature = "std")]
|
||||
use std::collections::HashMap;
|
||||
use std::collections::{hash_map, HashMap};
|
||||
|
||||
pub use crate::frontend::{FunctionBuilder, FunctionBuilderContext};
|
||||
pub use crate::switch::Switch;
|
||||
|
||||
Reference in New Issue
Block a user