Fix a bug in the TopoOrderRC comparison function.

The final tie breaker comparison also needs to return +/-1, or 0.
This is not a less() function.

This could cause otherwise identical super-classes to be ordered
unstably, depending on what the system qsort routine does with a bad
compare function.

llvm-svn: 149549
This commit is contained in:
Jakob Stoklund Olesen 2012-02-01 22:19:26 +00:00
parent 9f05206659
commit fff0dfd810
1 changed files with 1 additions and 1 deletions

View File

@ -503,7 +503,7 @@ static int TopoOrderRC(const void *PA, const void *PB) {
return 1;
// Finally order by name as a tie breaker.
return A->getName() < B->getName();
return StringRef(A->getName()).compare(B->getName());
}
std::string CodeGenRegisterClass::getQualifiedName() const {