about summary refs log tree commit diff
path: root/library/stdarch/crates/intrinsic-test/src/arm/argument.rs
blob: c43609bb2db0d97b8d35031188cd01ea02975271 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
use crate::arm::intrinsic::ArmIntrinsicType;
use crate::common::argument::Argument;

// This functionality is present due to the nature
// of how intrinsics are defined in the JSON source
// of ARM intrinsics.
impl Argument<ArmIntrinsicType> {
    pub fn type_and_name_from_c(arg: &str) -> (&str, &str) {
        let split_index = arg
            .rfind([' ', '*'])
            .expect("Couldn't split type and argname");

        (arg[..split_index + 1].trim_end(), &arg[split_index + 1..])
    }
}