mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-02-14 02:33:53 +00:00
Cheap, mostly strict, stable sorting.
This is necessary for tests so the results are comparable. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90320 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
0fea11a805
commit
059a983531
@ -15,6 +15,7 @@
|
||||
#ifndef LLVM_ANALYSIS_MAXIMUMSPANNINGTREE_H
|
||||
#define LLVM_ANALYSIS_MAXIMUMSPANNINGTREE_H
|
||||
|
||||
#include "llvm/BasicBlock.h"
|
||||
#include "llvm/ADT/EquivalenceClasses.h"
|
||||
#include <vector>
|
||||
#include <algorithm>
|
||||
@ -33,6 +34,18 @@ namespace llvm {
|
||||
typename MaximumSpanningTree<CT>::EdgeWeight Y) const {
|
||||
if (X.second > Y.second) return true;
|
||||
if (X.second < Y.second) return false;
|
||||
if (const BasicBlock *BBX = dyn_cast<BasicBlock>(X.first.first)) {
|
||||
if (const BasicBlock *BBY = dyn_cast<BasicBlock>(Y.first.first)) {
|
||||
if (BBX->size() > BBY->size()) return true;
|
||||
if (BBX->size() < BBY->size()) return false;
|
||||
}
|
||||
}
|
||||
if (const BasicBlock *BBX = dyn_cast<BasicBlock>(X.first.second)) {
|
||||
if (const BasicBlock *BBY = dyn_cast<BasicBlock>(Y.first.second)) {
|
||||
if (BBX->size() > BBY->size()) return true;
|
||||
if (BBX->size() < BBY->size()) return false;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
Loading…
x
Reference in New Issue
Block a user