Do not align the stack frame for leaf functions not using the stack.

This commit is contained in:
Benjamin Bouvier
2019-11-06 16:48:34 +01:00
parent 1074c7675e
commit 143cb01489
6 changed files with 54 additions and 24 deletions

View File

@@ -279,6 +279,14 @@ impl Function {
Ok(())
}
/// Returns true if the function is function that doesn't call any other functions. This is not
/// to be confused with a "leaf function" in Windows terminology.
pub fn is_leaf(&self) -> bool {
// Conservative result: if there's at least one function signature referenced in this
// function, assume it may call.
!self.dfg.signatures.is_empty()
}
}
/// Additional annotations for function display.