Skip to content

Commit 4a23ab4

Browse files
committed
Fix Wcovered-switch-default Werror after #78252
bot failure: https://lab.llvm.org/buildbot/#/builders/19/builds/24831
1 parent ef28379 commit 4a23ab4

File tree

1 file changed

+9
-17
lines changed

1 file changed

+9
-17
lines changed

llvm/lib/IR/DebugProgramInstruction.cpp

Lines changed: 9 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -63,31 +63,28 @@ void DbgRecord::deleteRecord() {
6363
switch (RecordKind) {
6464
case ValueKind:
6565
delete cast<DPValue>(this);
66-
break;
67-
default:
68-
llvm_unreachable("unsupported DbgRecord kind");
66+
return;
6967
}
68+
llvm_unreachable("unsupported DbgRecord kind");
7069
}
7170

7271
void DbgRecord::print(raw_ostream &O, bool IsForDebug) const {
7372
switch (RecordKind) {
7473
case ValueKind:
7574
cast<DPValue>(this)->print(O, IsForDebug);
76-
break;
77-
default:
78-
llvm_unreachable("unsupported DbgRecord kind");
75+
return;
7976
};
77+
llvm_unreachable("unsupported DbgRecord kind");
8078
}
8179

8280
void DbgRecord::print(raw_ostream &O, ModuleSlotTracker &MST,
8381
bool IsForDebug) const {
8482
switch (RecordKind) {
8583
case ValueKind:
8684
cast<DPValue>(this)->print(O, MST, IsForDebug);
87-
break;
88-
default:
89-
llvm_unreachable("unsupported DbgRecord kind");
85+
return;
9086
};
87+
llvm_unreachable("unsupported DbgRecord kind");
9188
}
9289

9390
bool DbgRecord::isIdenticalToWhenDefined(const DbgRecord &R) const {
@@ -96,10 +93,8 @@ bool DbgRecord::isIdenticalToWhenDefined(const DbgRecord &R) const {
9693
switch (RecordKind) {
9794
case ValueKind:
9895
return cast<DPValue>(this)->isIdenticalToWhenDefined(*cast<DPValue>(&R));
99-
break;
100-
default:
101-
llvm_unreachable("unsupported DbgRecord kind");
10296
};
97+
llvm_unreachable("unsupported DbgRecord kind");
10398
}
10499

105100
bool DbgRecord::isEquivalentTo(const DbgRecord &R) const {
@@ -108,10 +103,8 @@ bool DbgRecord::isEquivalentTo(const DbgRecord &R) const {
108103
switch (RecordKind) {
109104
case ValueKind:
110105
return cast<DPValue>(this)->isEquivalentTo(*cast<DPValue>(&R));
111-
break;
112-
default:
113-
llvm_unreachable("unsupported DbgRecord kind");
114106
};
107+
llvm_unreachable("unsupported DbgRecord kind");
115108
}
116109

117110
DPValue *DPValue::createDPValue(Value *Location, DILocalVariable *DV,
@@ -314,9 +307,8 @@ DbgRecord *DbgRecord::clone() const {
314307
switch (RecordKind) {
315308
case ValueKind:
316309
return cast<DPValue>(this)->clone();
317-
default:
318-
llvm_unreachable("unsupported DbgRecord kind");
319310
};
311+
llvm_unreachable("unsupported DbgRecord kind");
320312
}
321313

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

0 commit comments

Comments
 (0)