mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-25 20:23:11 +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:
parent
b0acef6ebb
commit
992f58385f
@ -54,7 +54,7 @@ static uint8_t byteFromBitsInit(BitsInit &init) {
|
|||||||
/// @param rec - The record from which to extract the value.
|
/// @param rec - The record from which to extract the value.
|
||||||
/// @param name - The name of the field in the record.
|
/// @param name - The name of the field in the record.
|
||||||
/// @return - The field, as translated by byteFromBitsInit().
|
/// @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);
|
BitsInit* bits = rec->getValueAsBitsInit(name);
|
||||||
return byteFromBitsInit(*bits);
|
return byteFromBitsInit(*bits);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user