Append link and sret arguments in legalize_signature.

These special-purpose arguments and return values are only relevant for
the function being compiled, so add a `current` flag to
legalize_signature().

- Add the necessary argument values to the entry block to represent
  the special-purpose arguments.
- Propagate the link and sret arguments to return instructions if the
  legalized signature asks for it.
This commit is contained in:
Jakob Stoklund Olesen
2017-04-19 15:44:17 -07:00
parent c040a495c0
commit 315c858b48
9 changed files with 161 additions and 35 deletions

View File

@@ -78,9 +78,9 @@ impl TargetIsa for Isa {
})
}
fn legalize_signature(&self, sig: &mut Signature) {
fn legalize_signature(&self, sig: &mut Signature, current: bool) {
// We can pass in `self.isa_flags` too, if we need it.
abi::legalize_signature(sig, &self.shared_flags)
abi::legalize_signature(sig, &self.shared_flags, current)
}
fn emit_inst(&self, func: &Function, inst: Inst, sink: &mut CodeSink) {