diff --git a/Cargo.lock b/Cargo.lock index 52c8ef1b89..71798731de 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -489,6 +489,7 @@ name = "cranelift-reader" version = "0.63.0" dependencies = [ "cranelift-codegen", + "smallvec", "target-lexicon", "thiserror", ] diff --git a/cranelift/reader/Cargo.toml b/cranelift/reader/Cargo.toml index fb0f8a1fda..8b8b451bfd 100644 --- a/cranelift/reader/Cargo.toml +++ b/cranelift/reader/Cargo.toml @@ -11,6 +11,7 @@ edition = "2018" [dependencies] cranelift-codegen = { path = "../codegen", version = "0.63.0" } +smallvec = "1.0.0" target-lexicon = "0.10" thiserror = "1.0.15" diff --git a/cranelift/reader/src/parser.rs b/cranelift/reader/src/parser.rs index 4e9608a506..4a59a13667 100644 --- a/cranelift/reader/src/parser.rs +++ b/cranelift/reader/src/parser.rs @@ -23,6 +23,7 @@ use cranelift_codegen::ir::{ use cranelift_codegen::isa::{self, CallConv, Encoding, RegUnit, TargetIsa}; use cranelift_codegen::packed_option::ReservedValue; use cranelift_codegen::{settings, timing}; +use smallvec::SmallVec; use std::mem; use std::str::FromStr; use std::{u16, u32}; @@ -2223,9 +2224,9 @@ impl<'a> Parser<'a> { // // inst-results ::= Value(v) { "," Value(v) } // - fn parse_inst_results(&mut self) -> ParseResult> { + fn parse_inst_results(&mut self) -> ParseResult> { // Result value numbers. - let mut results = Vec::new(); + let mut results = SmallVec::new(); // instruction ::= * [inst-results "="] Opcode(opc) ["." Type] ... // inst-results ::= * Value(v) { "," Value(v) }