llvm.org GIT mirror llvm / 6bb5212
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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@154324 91177308-0d34-0410-b5e6-96231b3b80d8 David Blaikie 8 years ago
2 changed file(s) with 6 addition(s) and 5 deletion(s). Raw diff Collapse all Expand all
25062506
25072507 /// Resolves successor for current case.
25082508 BasicBlockTy *getCaseSuccessor() {
2509 assert((Index < SI->getNumCases() || DefaultPseudoIndex) &&
2509 assert((Index < SI->getNumCases() ||
2510 Index == DefaultPseudoIndex) &&
25102511 "Index out the number of cases.");
25112512 return SI->getSuccessor(getSuccessorIndex());
25122513 }
9999 long int MBlazeELFWriterInfo::computeRelocation(unsigned SymOffset,
100100 unsigned RelOffset,
101101 unsigned RelTy) const {
102 if (RelTy == ELF::R_MICROBLAZE_32_PCREL || ELF::R_MICROBLAZE_64_PCREL)
103 return SymOffset - (RelOffset + 4);
104
105 llvm_unreachable("computeRelocation unknown for this relocation type");
102 assert((RelTy == ELF::R_MICROBLAZE_32_PCREL ||
103 RelTy == ELF::R_MICROBLAZE_64_PCREL) &&
104 "computeRelocation unknown for this relocation type");
105 return SymOffset - (RelOffset + 4);
106106 }