Skip to content

Commit

Permalink
Fix Wcovered-switch-default Werror after #78252
Browse files Browse the repository at this point in the history
  • Loading branch information
OCHyams committed Feb 20, 2024
1 parent ef28379 commit 4a23ab4
Showing 1 changed file with 9 additions and 17 deletions.
26 changes: 9 additions & 17 deletions llvm/lib/IR/DebugProgramInstruction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -63,31 +63,28 @@ void DbgRecord::deleteRecord() {
switch (RecordKind) {
case ValueKind:
delete cast<DPValue>(this);
break;
default:
llvm_unreachable("unsupported DbgRecord kind");
return;
}
llvm_unreachable("unsupported DbgRecord kind");
}

void DbgRecord::print(raw_ostream &O, bool IsForDebug) const {
switch (RecordKind) {
case ValueKind:
cast<DPValue>(this)->print(O, IsForDebug);
break;
default:
llvm_unreachable("unsupported DbgRecord kind");
return;
};
llvm_unreachable("unsupported DbgRecord kind");
}

void DbgRecord::print(raw_ostream &O, ModuleSlotTracker &MST,
bool IsForDebug) const {
switch (RecordKind) {
case ValueKind:
cast<DPValue>(this)->print(O, MST, IsForDebug);
break;
default:
llvm_unreachable("unsupported DbgRecord kind");
return;
};
llvm_unreachable("unsupported DbgRecord kind");
}

bool DbgRecord::isIdenticalToWhenDefined(const DbgRecord &R) const {
Expand All @@ -96,10 +93,8 @@ bool DbgRecord::isIdenticalToWhenDefined(const DbgRecord &R) const {
switch (RecordKind) {
case ValueKind:
return cast<DPValue>(this)->isIdenticalToWhenDefined(*cast<DPValue>(&R));
break;
default:
llvm_unreachable("unsupported DbgRecord kind");
};
llvm_unreachable("unsupported DbgRecord kind");
}

bool DbgRecord::isEquivalentTo(const DbgRecord &R) const {
Expand All @@ -108,10 +103,8 @@ bool DbgRecord::isEquivalentTo(const DbgRecord &R) const {
switch (RecordKind) {
case ValueKind:
return cast<DPValue>(this)->isEquivalentTo(*cast<DPValue>(&R));
break;
default:
llvm_unreachable("unsupported DbgRecord kind");
};
llvm_unreachable("unsupported DbgRecord kind");
}

DPValue *DPValue::createDPValue(Value *Location, DILocalVariable *DV,
Expand Down Expand Up @@ -314,9 +307,8 @@ DbgRecord *DbgRecord::clone() const {
switch (RecordKind) {
case ValueKind:
return cast<DPValue>(this)->clone();
default:
llvm_unreachable("unsupported DbgRecord kind");
};
llvm_unreachable("unsupported DbgRecord kind");
}

DPValue *DPValue::clone() const { return new DPValue(*this); }
Expand Down

0 comments on commit 4a23ab4

Please sign in to comment.