Legalize entry block arguments to match ABI types.

Insert conversion code that reconstructs the original function argument
types from the legalized ABI signature.

Add abi::legalize_abi_value(). This function is used when adapting code
to a legalized function signature.
This commit is contained in:
Jakob Stoklund Olesen
2017-03-06 13:57:36 -08:00
parent 5185cce1e9
commit 5d266acb5f
6 changed files with 288 additions and 27 deletions

View File

@@ -67,6 +67,17 @@ impl Type {
}
}
/// Get an integer type with the requested number of bits.
pub fn int(bits: u16) -> Option<Type> {
match bits {
8 => Some(I8),
16 => Some(I16),
32 => Some(I32),
64 => Some(I64),
_ => None,
}
}
/// Get a type with the same number of lanes as this type, but with the lanes replaced by
/// booleans of the same size.
///