mirror of
https://github.com/rust-lang/rust.git
synced 2026-05-31 21:47:15 +03:00
intrinsic-test: remove arm::argument module
This module only defined a single function that could easily just be inlined into its only caller.
This commit is contained in:
@@ -1,15 +0,0 @@
|
||||
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..])
|
||||
}
|
||||
}
|
||||
@@ -89,7 +89,13 @@ fn json_to_intrinsic(
|
||||
.into_iter()
|
||||
.enumerate()
|
||||
.map(|(i, arg)| {
|
||||
let (type_name, arg_name) = Argument::<ArmIntrinsicType>::type_and_name_from_c(&arg);
|
||||
let (type_name, arg_name) = {
|
||||
let split_index = arg
|
||||
.rfind([' ', '*'])
|
||||
.expect("Couldn't split type and argname");
|
||||
|
||||
(arg[..split_index + 1].trim_end(), &arg[split_index + 1..])
|
||||
};
|
||||
|
||||
let arg_ty = parse_intrinsic_type(type_name)
|
||||
.unwrap_or_else(|_| panic!("Failed to parse argument '{arg}'"));
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
mod argument;
|
||||
mod config;
|
||||
mod intrinsic;
|
||||
mod json_parser;
|
||||
|
||||
Reference in New Issue
Block a user