[llvm] r230964 - TblGen: Remove copy of SmallVector::operator==. NFC intended.
Benjamin Kramer
benny.kra at googlemail.com
Mon Mar 2 07:24:30 PST 2015
Author: d0k
Date: Mon Mar 2 09:24:30 2015
New Revision: 230964
URL: http://llvm.org/viewvc/llvm-project?rev=230964&view=rev
Log:
TblGen: Remove copy of SmallVector::operator==. NFC intended.
Modified:
llvm/trunk/utils/TableGen/CodeGenRegisters.h
llvm/trunk/utils/TableGen/RegisterInfoEmitter.cpp
Modified: llvm/trunk/utils/TableGen/CodeGenRegisters.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/TableGen/CodeGenRegisters.h?rev=230964&r1=230963&r2=230964&view=diff
==============================================================================
--- llvm/trunk/utils/TableGen/CodeGenRegisters.h (original)
+++ llvm/trunk/utils/TableGen/CodeGenRegisters.h Mon Mar 2 09:24:30 2015
@@ -42,10 +42,10 @@ namespace llvm {
struct MaskRolPair {
unsigned Mask;
uint8_t RotateLeft;
- bool operator==(const MaskRolPair Other) {
+ bool operator==(const MaskRolPair Other) const {
return Mask == Other.Mask && RotateLeft == Other.RotateLeft;
}
- bool operator!=(const MaskRolPair Other) {
+ bool operator!=(const MaskRolPair Other) const {
return Mask != Other.Mask || RotateLeft != Other.RotateLeft;
}
};
Modified: llvm/trunk/utils/TableGen/RegisterInfoEmitter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/TableGen/RegisterInfoEmitter.cpp?rev=230964&r1=230963&r2=230964&view=diff
==============================================================================
--- llvm/trunk/utils/TableGen/RegisterInfoEmitter.cpp (original)
+++ llvm/trunk/utils/TableGen/RegisterInfoEmitter.cpp Mon Mar 2 09:24:30 2015
@@ -716,16 +716,7 @@ RegisterInfoEmitter::emitComposeSubRegIn
for (size_t s = 0, se = Sequences.size(); s != se; ++s, SIdx = NextSIdx) {
SmallVectorImpl<MaskRolPair> &Sequence = Sequences[s];
NextSIdx = SIdx + Sequence.size() + 1;
- if (Sequence.size() != IdxSequence.size())
- continue;
- bool Identical = true;
- for (size_t o = 0, oe = Sequence.size(); o != oe; ++o) {
- if (Sequence[o] != IdxSequence[o]) {
- Identical = false;
- break;
- }
- }
- if (Identical) {
+ if (Sequence == IdxSequence) {
Found = SIdx;
break;
}
More information about the llvm-commits
mailing list