Parsing stack_limit

This commit is contained in:
Sergey Pepyakin
2018-05-31 00:12:13 +02:00
committed by Dan Gohman
parent effe770c5f
commit 73b6468d25
3 changed files with 48 additions and 0 deletions

View File

@@ -126,6 +126,15 @@ impl Function {
self.stack_slots.push(data)
}
/// Sets the stack limit for the function.
///
/// Returns previous one if any.
pub fn set_stack_limit(&mut self, stack_limit: Option<GlobalVar>) -> Option<GlobalVar> {
let prev = self.stack_limit.take();
self.stack_limit = stack_limit;
prev
}
/// Adds a signature which can later be used to declare an external function import.
pub fn import_signature(&mut self, signature: Signature) -> SigRef {
self.dfg.signatures.push(signature)