summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target
diff options
context:
space:
mode:
authorDavid Blaikie <dblaikie@gmail.com>2012-04-09 16:29:35 +0000
committerDavid Blaikie <dblaikie@gmail.com>2012-04-09 16:29:35 +0000
commite6b6fae8ffdbaa38bf88a0d5d207c02df3ab22c5 (patch)
tree5b64af72cf0d060ba22e43cd48da77a48edd1bc7 /llvm/lib/Target
parent8f62b3248ed3600358ce7b265776e615a519b1f4 (diff)
downloadbcm5719-llvm-e6b6fae8ffdbaa38bf88a0d5d207c02df3ab22c5.tar.gz
bcm5719-llvm-e6b6fae8ffdbaa38bf88a0d5d207c02df3ab22c5.zip
Fix accidentally constant conditions found by uncommitted improvements to -Wconstant-conversion.
A couple of cases where we were accidentally creating constant conditions by something like "x == a || b" instead of "x == a || x == b". In one case a conditional & then unreachable was used - I transformed this into a direct assert instead. llvm-svn: 154324
Diffstat (limited to 'llvm/lib/Target')
-rw-r--r--llvm/lib/Target/MBlaze/MBlazeELFWriterInfo.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/llvm/lib/Target/MBlaze/MBlazeELFWriterInfo.cpp b/llvm/lib/Target/MBlaze/MBlazeELFWriterInfo.cpp
index 60a65bbb733..e3c7236d114 100644
--- a/llvm/lib/Target/MBlaze/MBlazeELFWriterInfo.cpp
+++ b/llvm/lib/Target/MBlaze/MBlazeELFWriterInfo.cpp
@@ -100,8 +100,8 @@ unsigned MBlazeELFWriterInfo::getAbsoluteLabelMachineRelTy() const {
long int MBlazeELFWriterInfo::computeRelocation(unsigned SymOffset,
unsigned RelOffset,
unsigned RelTy) const {
- if (RelTy == ELF::R_MICROBLAZE_32_PCREL || ELF::R_MICROBLAZE_64_PCREL)
- return SymOffset - (RelOffset + 4);
-
- llvm_unreachable("computeRelocation unknown for this relocation type");
+ assert((RelTy == ELF::R_MICROBLAZE_32_PCREL ||
+ RelTy == ELF::R_MICROBLAZE_64_PCREL) &&
+ "computeRelocation unknown for this relocation type");
+ return SymOffset - (RelOffset + 4);
}
OpenPOWER on IntegriCloud