1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-25 12:12:47 +01:00

[X86] Avoid std::string creation in RecognizableInstr constructor. NFCI.

The value names in byteFromRec calls are compile time constants - just create StringRef directly instead of via std::string.
This commit is contained in:
Simon Pilgrim 2020-12-18 16:00:27 +00:00
parent b0acef6ebb
commit 992f58385f

View File

@ -54,7 +54,7 @@ static uint8_t byteFromBitsInit(BitsInit &init) {
/// @param rec - The record from which to extract the value.
/// @param name - The name of the field in the record.
/// @return - The field, as translated by byteFromBitsInit().
static uint8_t byteFromRec(const Record* rec, const std::string &name) {
static uint8_t byteFromRec(const Record* rec, StringRef name) {
BitsInit* bits = rec->getValueAsBitsInit(name);
return byteFromBitsInit(*bits);
}