summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2016-01-14 20:28:25 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2016-01-14 20:28:25 +0000
commit56cb2734e3ffd576636bace34a0d7c690b5703c9 (patch)
tree843d9d932e14d8b962f137696d9e88597b5ef87f /llvm/lib/Target
parentd5354fdddb3f02beb33ea3d3b06dbe50687bc81c (diff)
downloadbcm5719-llvm-56cb2734e3ffd576636bace34a0d7c690b5703c9.tar.gz
bcm5719-llvm-56cb2734e3ffd576636bace34a0d7c690b5703c9.zip
Assert that a cmp function defines a total order.
Thanks to David Blaikie for noticing it. llvm-svn: 257796
Diffstat (limited to 'llvm/lib/Target')
-rw-r--r--llvm/lib/Target/Mips/MCTargetDesc/MipsELFObjectWriter.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/llvm/lib/Target/Mips/MCTargetDesc/MipsELFObjectWriter.cpp b/llvm/lib/Target/Mips/MCTargetDesc/MipsELFObjectWriter.cpp
index 3b702fe4bee..8e6603c5559 100644
--- a/llvm/lib/Target/Mips/MCTargetDesc/MipsELFObjectWriter.cpp
+++ b/llvm/lib/Target/Mips/MCTargetDesc/MipsELFObjectWriter.cpp
@@ -334,9 +334,8 @@ static int cmpRel(const ELFRelocationEntry *AP, const ELFRelocationEntry *BP) {
const ELFRelocationEntry &B = *BP;
if (A.Offset != B.Offset)
return B.Offset - A.Offset;
- if (B.Type != A.Type)
- return A.Type - B.Type;
- return 0;
+ assert(B.Type != A.Type && "We don't have a total order");
+ return A.Type - B.Type;
}
void MipsELFObjectWriter::sortRelocs(const MCAssembler &Asm,
OpenPOWER on IntegriCloud