Clean up code, add documentation, implement pieces properly

This commit is contained in:
Mark McCaskey
2020-02-18 16:51:02 -08:00
parent 923e4ac83a
commit 3653a448f5
9 changed files with 168 additions and 100 deletions

View File

@ -124,6 +124,15 @@ pub struct CompilerConfig {
pub generate_debug_info: bool,
}
impl CompilerConfig {
/// Use this to check if we should be generating debug information.
/// This function takes into account the features that runtime-core was
/// compiled with in addition to the value of the `generate_debug_info` field.
pub(crate) fn should_generate_debug_info(&self) -> bool {
cfg!(feature = "generate-debug-information") && self.generate_debug_info
}
}
/// An exception table for a `RunnableModule`.
#[derive(Clone, Debug, Default, Serialize, Deserialize)]
pub struct ExceptionTable {
@ -212,11 +221,6 @@ pub trait RunnableModule: Send + Sync {
None
}
/// TODO: document before shipppping
fn get_local_function_pointers_and_lengths(&self) -> Option<Vec<(*const u8, usize)>> {
None
}
/// Returns the inline breakpoint size corresponding to an Architecture (None in case is not implemented)
fn get_inline_breakpoint_size(&self, _arch: Architecture) -> Option<usize> {
None