Skip to content

Commit

Permalink
ir: don't rely on class template arg deduction
Browse files Browse the repository at this point in the history
Class template argument deduction has the potential to hide bugs, and
the compiler emits a -Wctad-maybe-unsupported warning. Although no bugs
were found, don't rely on class template argument deduction, squelching
these warnings.

While at it, also squelch the remaining -Wcovered-switch-default
warnings.
  • Loading branch information
artagnon committed Nov 27, 2024
1 parent 708948d commit aac6839
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 7 deletions.
2 changes: 1 addition & 1 deletion ir/memory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2392,7 +2392,7 @@ void Memory::copy(const Pointer &src, const Pointer &dst) {

unsigned has_bv_val = 0;
auto offset = expr::mkUInt(0, Pointer::bitsShortOffset());
DisjointExpr val(Byte::mkPoisonByte(*this)());
DisjointExpr<expr> val(Byte::mkPoisonByte(*this)());

auto fn = [&](MemBlock &blk, const Pointer &ptr, expr &&cond) {
// we assume src != dst
Expand Down
6 changes: 3 additions & 3 deletions ir/state.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ State::State(const Function &f, bool source)
: f(f), source(source), memory(*this),
fp_rounding_mode(expr::mkVar("fp_rounding_mode", 3)),
fp_denormal_mode(expr::mkVar("fp_denormal_mode", 2)),
return_val(DisjointExpr(f.getType().getDummyValue(false))) {}
return_val(DisjointExpr<StateValue>(f.getType().getDummyValue(false))) {}

void State::resetGlobals() {
Memory::resetGlobals();
Expand Down Expand Up @@ -697,7 +697,7 @@ bool State::isAsmMode() const {
expr State::getPath(BasicBlock &bb) const {
if (&f.getFirstBB() == &bb)
return true;

auto I = predecessor_data.find(&bb);
if (I == predecessor_data.end())
return false; // Block is unreachable
Expand Down Expand Up @@ -1327,7 +1327,7 @@ void State::finishInitializer() {
assert(predecessor_data.size() == 1);
mem = &predecessor_data.begin()->second.begin()->second.mem.begin()->first;
}
return_memory = DisjointExpr(mem->dup());
return_memory = DisjointExpr<Memory>(mem->dup());

if (auto *ret = getFn().getReturnedInput()) {
returned_input = (*this)[*ret];
Expand Down
1 change: 0 additions & 1 deletion llvm_util/llvm2alive.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ FpExceptionMode parse_exceptions(llvm::Instruction &i) {
case llvm::fp::ebIgnore: return FpExceptionMode::Ignore;
case llvm::fp::ebMayTrap: return FpExceptionMode::MayTrap;
case llvm::fp::ebStrict: return FpExceptionMode::Strict;
default: UNREACHABLE();
}
}

Expand Down
2 changes: 0 additions & 2 deletions smt/solver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -527,8 +527,6 @@ Result Solver::check(const char *query_name) const {
++num_errors;
return { Result::ERROR, string(reason) };
}
default:
UNREACHABLE();
}
}

Expand Down

0 comments on commit aac6839

Please sign in to comment.