Add ABI annotations to function signatures.

Specify the location of arguments as well as the size of stack argument
array needed. The ABI annotations are optional, just like the value
locations.

Remove the Eq implementation for Signature which was only used by a
single parser test.
This commit is contained in:
Jakob Stoklund Olesen
2017-02-24 13:43:04 -08:00
parent 15e0822ac3
commit c8be39fa9d
3 changed files with 65 additions and 11 deletions

View File

@@ -1360,7 +1360,7 @@ impl<'a> Parser<'a> {
#[cfg(test)]
mod tests {
use super::*;
use cretonne::ir::{ArgumentType, ArgumentExtension};
use cretonne::ir::ArgumentExtension;
use cretonne::ir::types;
use cretonne::ir::entities::AnyEntity;
use testfile::{Details, Comment};
@@ -1371,12 +1371,9 @@ mod tests {
fn argument_type() {
let mut p = Parser::new("i32 sext");
let arg = p.parse_argument_type().unwrap();
assert_eq!(arg,
ArgumentType {
value_type: types::I32,
extension: ArgumentExtension::Sext,
inreg: false,
});
assert_eq!(arg.value_type, types::I32);
assert_eq!(arg.extension, ArgumentExtension::Sext);
assert_eq!(arg.inreg, false);
let Error { location, message } = p.parse_argument_type().unwrap_err();
assert_eq!(location.line_number, 1);
assert_eq!(message, "expected argument type");