summaryrefslogtreecommitdiffstats
path: root/llvm/utils
diff options
context:
space:
mode:
authorJakob Stoklund Olesen <stoklund@2pi.dk>2012-02-01 22:19:26 +0000
committerJakob Stoklund Olesen <stoklund@2pi.dk>2012-02-01 22:19:26 +0000
commitfff0dfd810d462a3450e6fa1fffec2ecffeff3d2 (patch)
tree63b8b9314f2ee904cfab3b419ea31d1967f9fe3a /llvm/utils
parent9f05206659d5017f9fced959d72b018a4ec54f46 (diff)
downloadbcm5719-llvm-fff0dfd810d462a3450e6fa1fffec2ecffeff3d2.tar.gz
bcm5719-llvm-fff0dfd810d462a3450e6fa1fffec2ecffeff3d2.zip
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
Diffstat (limited to 'llvm/utils')
-rw-r--r--llvm/utils/TableGen/CodeGenRegisters.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/utils/TableGen/CodeGenRegisters.cpp b/llvm/utils/TableGen/CodeGenRegisters.cpp
index 7c6661742aa..1d06f3e5287 100644
--- a/llvm/utils/TableGen/CodeGenRegisters.cpp
+++ b/llvm/utils/TableGen/CodeGenRegisters.cpp
@@ -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 {
OpenPOWER on IntegriCloud