mirror of
https://github.com/revng/revng
synced 2026-06-21 14:07:57 +00:00
Introduce -Wunreachable-code-break
This commit is contained in:
@@ -252,7 +252,6 @@ handleReturnValue(const model::TypeDefinition &Prototype,
|
||||
revng_assert(Layout.ReturnValues.size() == 1);
|
||||
revng_assert(Layout.ReturnValues[0].Type->isScalar());
|
||||
return { Layout.ReturnValues[0].Type };
|
||||
break;
|
||||
case abi::FunctionType::ReturnMethod::RegisterSet:
|
||||
return flattenReturnTypes(Layout, Model);
|
||||
default:
|
||||
@@ -448,14 +447,14 @@ getExpectedModelType(const llvm::Use *U, const model::Binary &Model) {
|
||||
auto BitWidth = U->get()->getType()->getIntegerBitWidth();
|
||||
revng_assert(BitWidth >= 8 and std::has_single_bit(BitWidth));
|
||||
return { model::PrimitiveType::makeSigned(BitWidth / 8) };
|
||||
} break;
|
||||
}
|
||||
|
||||
case llvm::Instruction::UDiv:
|
||||
case llvm::Instruction::URem: {
|
||||
auto BitWidth = U->get()->getType()->getIntegerBitWidth();
|
||||
revng_assert(BitWidth >= 8 and std::has_single_bit(BitWidth));
|
||||
return { model::PrimitiveType::makeUnsigned(BitWidth / 8) };
|
||||
} break;
|
||||
}
|
||||
|
||||
case llvm::Instruction::AShr:
|
||||
case llvm::Instruction::LShr:
|
||||
@@ -494,7 +493,7 @@ getExpectedModelType(const llvm::Use *U, const model::Binary &Model) {
|
||||
return { model::PrimitiveType::makeNumber(Bytes) };
|
||||
else
|
||||
return { model::PrimitiveType::makePointerOrNumber(Bytes) };
|
||||
} break;
|
||||
}
|
||||
case llvm::Instruction::Mul:
|
||||
case llvm::Instruction::And:
|
||||
case llvm::Instruction::Or:
|
||||
@@ -504,7 +503,7 @@ getExpectedModelType(const llvm::Use *U, const model::Binary &Model) {
|
||||
and (BitWidth == 1 or BitWidth >= 8));
|
||||
auto Bytes = (BitWidth == 1) ? 1 : BitWidth / 8;
|
||||
return { model::PrimitiveType::makeNumber(Bytes) };
|
||||
} break;
|
||||
}
|
||||
case llvm::Instruction::FAdd:
|
||||
case llvm::Instruction::FSub:
|
||||
case llvm::Instruction::FMul:
|
||||
|
||||
Reference in New Issue
Block a user