Don't generate DWARF sections when no functions were compiled. (#894)

This commit is contained in:
Yury Delendik
2020-02-03 14:41:29 -06:00
committed by GitHub
parent ea4faa4a01
commit 4599234c6f
8 changed files with 138 additions and 62 deletions

View File

@@ -48,10 +48,22 @@ pub type ValueLabelsRanges = PrimaryMap<DefinedFuncIndex, cranelift_codegen::Val
/// Stack slots for functions.
pub type StackSlots = PrimaryMap<DefinedFuncIndex, ir::StackSlots>;
/// Memory definition offset in the VMContext structure.
#[derive(Debug, Clone)]
pub enum ModuleMemoryOffset {
/// Not available.
None,
/// Offset to the defined memory.
Defined(u32),
/// Offset to the imported memory.
Imported(u32),
}
/// Module `vmctx` related info.
#[derive(Debug, Clone)]
pub struct ModuleVmctxInfo {
/// The memory definition offset in the VMContext structure.
pub memory_offset: i64,
pub memory_offset: ModuleMemoryOffset,
/// The functions stack slots.
pub stack_slots: StackSlots,

View File

@@ -40,7 +40,8 @@ pub mod cranelift;
pub mod lightbeam;
pub use crate::address_map::{
FunctionAddressMap, InstructionAddressMap, ModuleAddressMap, ModuleVmctxInfo, ValueLabelsRanges,
FunctionAddressMap, InstructionAddressMap, ModuleAddressMap, ModuleMemoryOffset,
ModuleVmctxInfo, ValueLabelsRanges,
};
pub use crate::cache::{create_new_config as cache_create_new_config, init as cache_init};
pub use crate::compilation::{