Skip to content

Commit ae2aa2d

Browse files
committed
[lldb] Silence GCC warnings about missing returns after fully covered switches. NFC.
This silences warnings like this: lldb/source/Core/DebuggerEvents.cpp: In member function ‘llvm::StringRef lldb_private::DiagnosticEventData::GetPrefix() const’: lldb/source/Core/DebuggerEvents.cpp:55:1: warning: control reaches end of non-void function [-Wreturn-type] 55 | } Differential Revision: https://reviews.llvm.org/D123203
1 parent e546bbf commit ae2aa2d

File tree

3 files changed

+3
-0
lines changed

3 files changed

+3
-0
lines changed

lldb/source/Breakpoint/Breakpoint.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1026,6 +1026,7 @@ const char *Breakpoint::BreakpointEventTypeAsCString(BreakpointEventType type) {
10261026
case eBreakpointEventTypeThreadChanged: return "thread changed";
10271027
case eBreakpointEventTypeAutoContinueChanged: return "autocontinue changed";
10281028
};
1029+
llvm_unreachable("Fully covered switch above!");
10291030
}
10301031

10311032
Log *Breakpoint::BreakpointEventData::GetLogChannel() {

lldb/source/Core/DebuggerEvents.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ llvm::StringRef DiagnosticEventData::GetPrefix() const {
5252
case Type::Error:
5353
return "error";
5454
}
55+
llvm_unreachable("Fully covered switch above!");
5556
}
5657

5758
void DiagnosticEventData::Dump(Stream *s) const {

lldb/source/Plugins/Process/Linux/IntelPTCollector.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,7 @@ static Expected<uint32_t> ReadIntelPTConfigFile(const char *file,
102102
case BitOffset:
103103
return 10;
104104
}
105+
llvm_unreachable("Fully covered switch above!");
105106
};
106107

107108
auto createError = [&](const char *expected_value_message) {

0 commit comments

Comments
 (0)