mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-11-10 17:18:11 +00:00
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
This commit is contained in:
@@ -2507,7 +2507,8 @@ public:
|
|||||||
|
|
||||||
/// Resolves successor for current case.
|
/// Resolves successor for current case.
|
||||||
BasicBlockTy *getCaseSuccessor() {
|
BasicBlockTy *getCaseSuccessor() {
|
||||||
assert((Index < SI->getNumCases() || DefaultPseudoIndex) &&
|
assert((Index < SI->getNumCases() ||
|
||||||
|
Index == DefaultPseudoIndex) &&
|
||||||
"Index out the number of cases.");
|
"Index out the number of cases.");
|
||||||
return SI->getSuccessor(getSuccessorIndex());
|
return SI->getSuccessor(getSuccessorIndex());
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -100,8 +100,8 @@ unsigned MBlazeELFWriterInfo::getAbsoluteLabelMachineRelTy() const {
|
|||||||
long int MBlazeELFWriterInfo::computeRelocation(unsigned SymOffset,
|
long int MBlazeELFWriterInfo::computeRelocation(unsigned SymOffset,
|
||||||
unsigned RelOffset,
|
unsigned RelOffset,
|
||||||
unsigned RelTy) const {
|
unsigned RelTy) const {
|
||||||
if (RelTy == ELF::R_MICROBLAZE_32_PCREL || ELF::R_MICROBLAZE_64_PCREL)
|
assert((RelTy == ELF::R_MICROBLAZE_32_PCREL ||
|
||||||
|
RelTy == ELF::R_MICROBLAZE_64_PCREL) &&
|
||||||
|
"computeRelocation unknown for this relocation type");
|
||||||
return SymOffset - (RelOffset + 4);
|
return SymOffset - (RelOffset + 4);
|
||||||
|
|
||||||
llvm_unreachable("computeRelocation unknown for this relocation type");
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user