1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2025-01-31 20:51:52 +01:00

[TableGen] Fix invalid comparison function SizeOrder in getMatchingSubClassWithSubRegs

Building LLVM with -DEXPENSIVE_CHECKS fails with the following error
message with libstdc++ in debug mode:

Error: comparison doesn't meet irreflexive requirements,
assert(!(a < a)).

The patch fixes the comparison function SizeOrder by returning false
when comparing two equal items.
This commit is contained in:
Ta-Wei Tu 2020-09-15 15:38:06 -04:00 committed by Matt Arsenault
parent 7872d20b80
commit 524ed02943

View File

@ -999,6 +999,8 @@ CodeGenRegisterClass::getMatchingSubClassWithSubRegs(
const CodeGenRegisterClass *B) {
// If there are multiple, identical register classes, prefer the original
// register class.
if (A == B)
return false;
if (A->getMembers().size() == B->getMembers().size())
return A == this;
return A->getMembers().size() > B->getMembers().size();