Merge branch 'master' into feature/update-api

This commit is contained in:
Mark McCaskey
2020-03-23 14:07:02 -07:00
committed by GitHub
26 changed files with 1648 additions and 529 deletions

View File

@ -132,6 +132,10 @@ pub struct CompilerConfig {
/// When enabled there can be a small amount of runtime performance overhead.
pub full_preemption: bool,
/// Always choose a unique bit representation for NaN.
/// Enabling this makes execution deterministic but increases runtime overhead.
pub nan_canonicalization: bool,
pub features: Features,
// Target info. Presently only supported by LLVM.

View File

@ -410,7 +410,7 @@ impl MiddlewareChain {
};
sink.push(ev);
for m in &mut self.chain {
let prev: SmallVec<[Event; 2]> = sink.buffer.drain().collect();
let prev: SmallVec<[Event; 2]> = sink.buffer.drain(..).collect();
for ev in prev {
m.feed_event(ev, module_info, &mut sink, source_loc)?;
}

View File

@ -80,7 +80,7 @@ pub struct ModuleInfo {
pub em_symbol_map: Option<HashMap<u32, String>>,
/// Custom sections.
pub custom_sections: HashMap<String, Vec<u8>>,
pub custom_sections: HashMap<String, Vec<Vec<u8>>>,
/// Flag controlling whether or not debug information for use in a debugger
/// will be generated.
@ -104,7 +104,8 @@ impl ModuleInfo {
let bytes = reader.read_bytes(len)?;
let data = bytes.to_vec();
let name = name.to_string();
self.custom_sections.insert(name, data);
let entry: &mut Vec<Vec<u8>> = self.custom_sections.entry(name).or_default();
entry.push(data);
}
}
Ok(())