mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-22 18:54:02 +01:00
[TableGen] Use StringRef::compare instead of != and <. NFC.
The previous code would always do 1 or 2 prefix compares; explicitly only do one. This speeds up debug -gen-asm-matcher by ~10% (e.g. X86: 40s -> 35s). llvm-svn: 273583
This commit is contained in:
parent
382cd268e3
commit
5c6db14ac7
@ -579,8 +579,8 @@ struct MatchableInfo {
|
||||
/// operator< - Compare two matchables.
|
||||
bool operator<(const MatchableInfo &RHS) const {
|
||||
// The primary comparator is the instruction mnemonic.
|
||||
if (Mnemonic != RHS.Mnemonic)
|
||||
return Mnemonic < RHS.Mnemonic;
|
||||
if (int Cmp = Mnemonic.compare(RHS.Mnemonic))
|
||||
return Cmp == -1;
|
||||
|
||||
if (AsmOperands.size() != RHS.AsmOperands.size())
|
||||
return AsmOperands.size() < RHS.AsmOperands.size();
|
||||
|
Loading…
Reference in New Issue
Block a user