From 59d2495fe2c1254f84ad4d2bd61a41e79ff0d44d Mon Sep 17 00:00:00 2001 From: Fangrui Song Date: Mon, 8 Aug 2022 11:31:49 -0700 Subject: [PATCH] [lldb] LLVM_FALLTHROUGH => [[fallthrough]]. NFC --- lldb/source/Commands/CommandObjectMemory.cpp | 2 +- lldb/source/Core/Address.cpp | 2 +- lldb/source/Core/AddressRange.cpp | 2 +- lldb/source/Core/Communication.cpp | 2 +- lldb/source/Core/FormatEntity.cpp | 2 +- lldb/source/Core/ValueObject.cpp | 2 +- lldb/source/Expression/DWARFExpression.cpp | 7 ++++--- lldb/source/Expression/REPL.cpp | 2 +- lldb/source/Interpreter/OptionValueArray.cpp | 2 +- lldb/source/Interpreter/OptionValueFileSpecList.cpp | 2 +- lldb/source/Interpreter/OptionValuePathMappings.cpp | 2 +- lldb/source/Interpreter/Options.cpp | 4 ++-- .../Plugins/ExpressionParser/Clang/ClangExpressionParser.cpp | 2 +- lldb/source/Plugins/Language/ObjC/Cocoa.cpp | 2 +- .../RenderScriptRuntime/RenderScriptExpressionOpts.cpp | 2 +- lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp | 4 ++-- lldb/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp | 4 ++-- lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp | 2 +- lldb/source/Plugins/Process/MacOSX-Kernel/CommunicationKDP.cpp | 2 +- .../source/Plugins/Process/Windows/Common/NativeProcessWindows.cpp | 2 +- lldb/source/Plugins/Process/Windows/Common/ProcessWindows.cpp | 2 +- lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp | 2 +- .../Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp | 2 +- .../Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp | 4 ++-- lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp | 4 ++-- lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.cpp | 2 +- lldb/source/Plugins/SymbolFile/DWARF/HashedNameToDIE.cpp | 6 +++--- lldb/source/Plugins/SymbolFile/NativePDB/SymbolFileNativePDB.cpp | 4 ++-- lldb/source/Plugins/SymbolFile/PDB/SymbolFilePDB.cpp | 2 +- lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp | 4 ++-- lldb/source/Target/Process.cpp | 2 +- lldb/source/Target/StackFrame.cpp | 6 +++--- lldb/source/Target/StackFrameList.cpp | 2 +- lldb/source/Utility/ArchSpec.cpp | 2 +- lldb/tools/lldb-test/lldb-test.cpp | 2 +- lldb/unittests/Expression/DWARFExpressionTest.cpp | 2 +- 36 files changed, 50 insertions(+), 49 deletions(-) diff --git a/lldb/source/Commands/CommandObjectMemory.cpp b/lldb/source/Commands/CommandObjectMemory.cpp index 5051f9a..22483e7 100644 --- a/lldb/source/Commands/CommandObjectMemory.cpp +++ b/lldb/source/Commands/CommandObjectMemory.cpp @@ -427,7 +427,7 @@ protected: switch (type_str[type_str.size() - 1]) { case '*': ++pointer_count; - LLVM_FALLTHROUGH; + [[fallthrough]]; case ' ': case '\t': type_str.erase(type_str.size() - 1); diff --git a/lldb/source/Core/Address.cpp b/lldb/source/Core/Address.cpp index b84e1ac..5969cf1 100644 --- a/lldb/source/Core/Address.cpp +++ b/lldb/source/Core/Address.cpp @@ -451,7 +451,7 @@ bool Address::Dump(Stream *s, ExecutionContextScope *exe_scope, DumpStyle style, else s->Printf("%s[", ""); } - LLVM_FALLTHROUGH; + [[fallthrough]]; case DumpStyleFileAddress: { addr_t file_addr = GetFileAddress(); if (file_addr == LLDB_INVALID_ADDRESS) { diff --git a/lldb/source/Core/AddressRange.cpp b/lldb/source/Core/AddressRange.cpp index 66dcda5..1830f2c 100644 --- a/lldb/source/Core/AddressRange.cpp +++ b/lldb/source/Core/AddressRange.cpp @@ -169,7 +169,7 @@ bool AddressRange::Dump(Stream *s, Target *target, Address::DumpStyle style, case Address::DumpStyleModuleWithFileAddress: show_module = true; - LLVM_FALLTHROUGH; + [[fallthrough]]; case Address::DumpStyleFileAddress: vmaddr = m_base_addr.GetFileAddress(); break; diff --git a/lldb/source/Core/Communication.cpp b/lldb/source/Core/Communication.cpp index f41ce46..d5f8f89 100644 --- a/lldb/source/Core/Communication.cpp +++ b/lldb/source/Core/Communication.cpp @@ -356,7 +356,7 @@ lldb::thread_result_t Communication::ReadThread() { case eConnectionStatusLostConnection: // Lost connection while connected to // a valid connection done = true; - LLVM_FALLTHROUGH; + [[fallthrough]]; case eConnectionStatusTimedOut: // Request timed out if (error.Fail()) LLDB_LOG(log, "error: {0}, status = {1}", error, diff --git a/lldb/source/Core/FormatEntity.cpp b/lldb/source/Core/FormatEntity.cpp index 6e7f44e..0ac8fca 100644 --- a/lldb/source/Core/FormatEntity.cpp +++ b/lldb/source/Core/FormatEntity.cpp @@ -696,7 +696,7 @@ static bool DumpValue(Stream &s, const SymbolContext *sc, case FormatEntity::Entry::Type::ScriptVariableSynthetic: is_script = true; - LLVM_FALLTHROUGH; + [[fallthrough]]; case FormatEntity::Entry::Type::VariableSynthetic: custom_format = entry.fmt; val_obj_display = (ValueObject::ValueObjectRepresentationStyle)entry.number; diff --git a/lldb/source/Core/ValueObject.cpp b/lldb/source/Core/ValueObject.cpp index d80139a..19d86be 100644 --- a/lldb/source/Core/ValueObject.cpp +++ b/lldb/source/Core/ValueObject.cpp @@ -2113,7 +2113,7 @@ ValueObjectSP ValueObject::GetValueForExpressionPath_Impl( return ValueObjectSP(); } } - LLVM_FALLTHROUGH; + [[fallthrough]]; case '.': // or fallthrough from -> { if (options.m_check_dot_vs_arrow_syntax && diff --git a/lldb/source/Expression/DWARFExpression.cpp b/lldb/source/Expression/DWARFExpression.cpp index 25f6a46..283e040 100644 --- a/lldb/source/Expression/DWARFExpression.cpp +++ b/lldb/source/Expression/DWARFExpression.cpp @@ -985,11 +985,12 @@ bool DWARFExpression::Evaluate( stack.back().GetScalar() = *maybe_load_addr; // Fall through to load address promotion code below. - } LLVM_FALLTHROUGH; + } + [[fallthrough]]; case Value::ValueType::Scalar: // Promote Scalar to LoadAddress and fall through. stack.back().SetValueType(Value::ValueType::LoadAddress); - LLVM_FALLTHROUGH; + [[fallthrough]]; case Value::ValueType::LoadAddress: if (exe_ctx) { if (process) { @@ -1134,7 +1135,7 @@ bool DWARFExpression::Evaluate( // Fall through to load address promotion code below. } - LLVM_FALLTHROUGH; + [[fallthrough]]; case Value::ValueType::Scalar: case Value::ValueType::LoadAddress: if (exe_ctx) { diff --git a/lldb/source/Expression/REPL.cpp b/lldb/source/Expression/REPL.cpp index 36a21de..e2db8cd 100644 --- a/lldb/source/Expression/REPL.cpp +++ b/lldb/source/Expression/REPL.cpp @@ -378,7 +378,7 @@ void REPL::IOHandlerInputComplete(IOHandler &io_handler, std::string &code) { case lldb::eExpressionSetupError: case lldb::eExpressionParseError: add_to_code = false; - LLVM_FALLTHROUGH; + [[fallthrough]]; case lldb::eExpressionDiscarded: error_sp->Printf("%s\n", error.AsCString()); break; diff --git a/lldb/source/Interpreter/OptionValueArray.cpp b/lldb/source/Interpreter/OptionValueArray.cpp index c202a18..07cb79e 100644 --- a/lldb/source/Interpreter/OptionValueArray.cpp +++ b/lldb/source/Interpreter/OptionValueArray.cpp @@ -279,7 +279,7 @@ Status OptionValueArray::SetArgs(const Args &args, VarSetOperationType op) { case eVarSetOperationAssign: m_values.clear(); // Fall through to append case - LLVM_FALLTHROUGH; + [[fallthrough]]; case eVarSetOperationAppend: for (size_t i = 0; i < argc; ++i) { lldb::OptionValueSP value_sp(CreateValueFromCStringForTypeMask( diff --git a/lldb/source/Interpreter/OptionValueFileSpecList.cpp b/lldb/source/Interpreter/OptionValueFileSpecList.cpp index 9b4114e..b47feb9 100644 --- a/lldb/source/Interpreter/OptionValueFileSpecList.cpp +++ b/lldb/source/Interpreter/OptionValueFileSpecList.cpp @@ -81,7 +81,7 @@ Status OptionValueFileSpecList::SetValueFromString(llvm::StringRef value, case eVarSetOperationAssign: m_current_value.Clear(); // Fall through to append case - LLVM_FALLTHROUGH; + [[fallthrough]]; case eVarSetOperationAppend: if (argc > 0) { m_value_was_set = true; diff --git a/lldb/source/Interpreter/OptionValuePathMappings.cpp b/lldb/source/Interpreter/OptionValuePathMappings.cpp index 6096f45..438c9b7 100644 --- a/lldb/source/Interpreter/OptionValuePathMappings.cpp +++ b/lldb/source/Interpreter/OptionValuePathMappings.cpp @@ -91,7 +91,7 @@ Status OptionValuePathMappings::SetValueFromString(llvm::StringRef value, } m_path_mappings.Clear(m_notify_changes); // Fall through to append case - LLVM_FALLTHROUGH; + [[fallthrough]]; case eVarSetOperationAppend: if (argc < 2 || (argc & 1)) { error.SetErrorString("append operation takes one or more path pairs"); diff --git a/lldb/source/Interpreter/Options.cpp b/lldb/source/Interpreter/Options.cpp index 26d9d2a..09af51a 100644 --- a/lldb/source/Interpreter/Options.cpp +++ b/lldb/source/Interpreter/Options.cpp @@ -988,10 +988,10 @@ llvm::Expected Options::ParseAlias(const Args &args, .str(), llvm::inconvertibleErrorCode()); } - LLVM_FALLTHROUGH; + [[fallthrough]]; case OptionParser::eOptionalArgument: option_arg = OptionParser::GetOptionArgument(); - LLVM_FALLTHROUGH; + [[fallthrough]]; case OptionParser::eNoArgument: break; default: diff --git a/lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionParser.cpp b/lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionParser.cpp index ec3dc28..dad22ad 100644 --- a/lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionParser.cpp +++ b/lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionParser.cpp @@ -559,7 +559,7 @@ ClangExpressionParser::ClangExpressionParser( case lldb::eLanguageTypeC_plus_plus_14: lang_opts.CPlusPlus11 = true; m_compiler->getHeaderSearchOpts().UseLibcxx = true; - LLVM_FALLTHROUGH; + [[fallthrough]]; case lldb::eLanguageTypeC_plus_plus_03: lang_opts.CPlusPlus = true; if (process_sp) diff --git a/lldb/source/Plugins/Language/ObjC/Cocoa.cpp b/lldb/source/Plugins/Language/ObjC/Cocoa.cpp index 14cd64f..46f82da 100644 --- a/lldb/source/Plugins/Language/ObjC/Cocoa.cpp +++ b/lldb/source/Plugins/Language/ObjC/Cocoa.cpp @@ -616,7 +616,7 @@ bool lldb_private::formatters::NSNumberSummaryProvider( break; case 17: data_location += 8; - LLVM_FALLTHROUGH; + [[fallthrough]]; case 4: type_code = TypeCodes::sint64; break; diff --git a/lldb/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptExpressionOpts.cpp b/lldb/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptExpressionOpts.cpp index 7078c05..bc93f4e 100644 --- a/lldb/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptExpressionOpts.cpp +++ b/lldb/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptExpressionOpts.cpp @@ -49,7 +49,7 @@ static bool registerRSDefaultTargetOpts(clang::TargetOptions &proto, proto.CPU = "atom"; proto.Features.push_back("+long64"); // Fallthrough for common x86 family features - LLVM_FALLTHROUGH; + [[fallthrough]]; case llvm::Triple::ArchType::x86_64: proto.Features.push_back("+mmx"); proto.Features.push_back("+sse"); diff --git a/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp b/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp index 15b06db..73597ae 100644 --- a/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp +++ b/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp @@ -4077,7 +4077,7 @@ void ObjectFileMachO::ParseSymtab(Symtab &symtab) { case N_ECOML: // end common (local name): 0,,n_sect,0,address symbol_section = section_info.GetSection(nlist.n_sect, nlist.n_value); - LLVM_FALLTHROUGH; + [[fallthrough]]; case N_ECOMM: // end common: name,,n_sect,0,0 @@ -4128,7 +4128,7 @@ void ObjectFileMachO::ParseSymtab(Symtab &symtab) { ((symbol_name[0] == '_') ? 1 : 0)); undefined_name_to_desc[undefined_name] = nlist.n_desc; } - LLVM_FALLTHROUGH; + [[fallthrough]]; case N_PBUD: type = eSymbolTypeUndefined; diff --git a/lldb/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp b/lldb/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp index 83ee9c3..6dbe504 100644 --- a/lldb/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp +++ b/lldb/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp @@ -428,7 +428,7 @@ PlatformDarwin::GetSoftwareBreakpointTrapOpcode(Target &target, case llvm::Triple::thumb: bp_is_thumb = true; - LLVM_FALLTHROUGH; + [[fallthrough]]; case llvm::Triple::arm: { static const uint8_t g_arm_breakpoint_opcode[] = {0xFE, 0xDE, 0xFF, 0xE7}; static const uint8_t g_thumb_breakpooint_opcode[] = {0xFE, 0xDE}; @@ -498,7 +498,7 @@ void PlatformDarwin::x86GetSupportedArchitectures( static llvm::ArrayRef GetCompatibleArchs(ArchSpec::Core core) { switch (core) { default: - LLVM_FALLTHROUGH; + [[fallthrough]]; case ArchSpec::eCore_arm_arm64e: { static const char *g_arm64e_compatible_archs[] = { "arm64e", "arm64", "armv7", "armv7f", "armv7k", "armv7s", diff --git a/lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp b/lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp index ec2aebc..5556f69 100644 --- a/lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp +++ b/lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp @@ -852,7 +852,7 @@ bool NativeProcessLinux::MonitorClone(NativeThreadLinux &parent, break; } } - LLVM_FALLTHROUGH; + [[fallthrough]]; case PTRACE_EVENT_FORK: case PTRACE_EVENT_VFORK: { bool is_vfork = event == PTRACE_EVENT_VFORK; diff --git a/lldb/source/Plugins/Process/MacOSX-Kernel/CommunicationKDP.cpp b/lldb/source/Plugins/Process/MacOSX-Kernel/CommunicationKDP.cpp index ea18930..343ab6b 100644 --- a/lldb/source/Plugins/Process/MacOSX-Kernel/CommunicationKDP.cpp +++ b/lldb/source/Plugins/Process/MacOSX-Kernel/CommunicationKDP.cpp @@ -267,7 +267,7 @@ bool CommunicationKDP::CheckForPacket(const uint8_t *src, size_t src_len, SendRequestPacketNoLock(request_ack_packet); } // Fall through to case below to get packet contents - LLVM_FALLTHROUGH; + [[fallthrough]]; case ePacketTypeReply | KDP_CONNECT: case ePacketTypeReply | KDP_DISCONNECT: case ePacketTypeReply | KDP_HOSTINFO: diff --git a/lldb/source/Plugins/Process/Windows/Common/NativeProcessWindows.cpp b/lldb/source/Plugins/Process/Windows/Common/NativeProcessWindows.cpp index 2abb09c..7570ba0 100644 --- a/lldb/source/Plugins/Process/Windows/Common/NativeProcessWindows.cpp +++ b/lldb/source/Plugins/Process/Windows/Common/NativeProcessWindows.cpp @@ -528,7 +528,7 @@ NativeProcessWindows::OnDebugException(bool first_chance, return ExceptionResult::BreakInDebugger; } - LLVM_FALLTHROUGH; + [[fallthrough]]; default: LLDB_LOG(log, "Debugger thread reported exception {0:x} at address {1:x} " diff --git a/lldb/source/Plugins/Process/Windows/Common/ProcessWindows.cpp b/lldb/source/Plugins/Process/Windows/Common/ProcessWindows.cpp index 20f5969..e3d04c9 100644 --- a/lldb/source/Plugins/Process/Windows/Common/ProcessWindows.cpp +++ b/lldb/source/Plugins/Process/Windows/Common/ProcessWindows.cpp @@ -483,7 +483,7 @@ void ProcessWindows::RefreshStateAfterStop() { "Creating stop info with the exception."); // FALLTHROUGH: We'll treat this as a generic exception record in the // default case. - LLVM_FALLTHROUGH; + [[fallthrough]]; } } diff --git a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp index 755b822..616de51 100644 --- a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp +++ b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp @@ -679,7 +679,7 @@ GDBRemoteCommunication::CheckForPacket(const uint8_t *src, size_t src_len, case '%': // Async notify packet isNotifyPacket = true; - LLVM_FALLTHROUGH; + [[fallthrough]]; case '$': // Look for a standard gdb packet? diff --git a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp index c468ed9..29417b3 100644 --- a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp +++ b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp @@ -3968,7 +3968,7 @@ GDBRemoteCommunicationClient::ReadExtFeature(llvm::StringRef object, // last chunk case ('l'): active = false; - LLVM_FALLTHROUGH; + [[fallthrough]]; // more chunks case ('m'): diff --git a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp index d1b30f7..34753d5 100644 --- a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp +++ b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp @@ -1733,7 +1733,7 @@ GDBRemoteCommunicationServerLLGS::Handle_vCont( if (thread_action.signal == 0) return SendIllFormedResponse( packet, "Could not parse signal in vCont packet C action"); - LLVM_FALLTHROUGH; + [[fallthrough]]; case 'c': // Continue @@ -1745,7 +1745,7 @@ GDBRemoteCommunicationServerLLGS::Handle_vCont( if (thread_action.signal == 0) return SendIllFormedResponse( packet, "Could not parse signal in vCont packet S action"); - LLVM_FALLTHROUGH; + [[fallthrough]]; case 's': // Step diff --git a/lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp b/lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp index 9e37bef..20eb49d 100644 --- a/lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp +++ b/lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp @@ -608,7 +608,7 @@ DWARFASTParserClang::ParseTypeModifier(const SymbolContext &sc, } // Fall through to base type below in case we can handle the type // there... - LLVM_FALLTHROUGH; + [[fallthrough]]; case DW_TAG_base_type: resolve_state = Type::ResolveState::Full; @@ -1930,7 +1930,7 @@ bool DWARFASTParserClang::ParseTemplateDIE( } case DW_TAG_GNU_template_template_param: is_template_template_argument = true; - LLVM_FALLTHROUGH; + [[fallthrough]]; case DW_TAG_template_type_parameter: case DW_TAG_template_value_parameter: { DWARFAttributes attributes; diff --git a/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.cpp b/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.cpp index 600a2ea..b9a018c 100644 --- a/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.cpp +++ b/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.cpp @@ -433,7 +433,7 @@ size_t DWARFDebugInfoEntry::GetAttributes(DWARFUnit *cu, // curr_depth is not zero break; } - LLVM_FALLTHROUGH; + [[fallthrough]]; default: attributes.Append(form_value, offset, attr); break; diff --git a/lldb/source/Plugins/SymbolFile/DWARF/HashedNameToDIE.cpp b/lldb/source/Plugins/SymbolFile/DWARF/HashedNameToDIE.cpp index fdc24e2..c31a3d8 100644 --- a/lldb/source/Plugins/SymbolFile/DWARF/HashedNameToDIE.cpp +++ b/lldb/source/Plugins/SymbolFile/DWARF/HashedNameToDIE.cpp @@ -174,7 +174,7 @@ void DWARFMappedHash::Prologue::AppendAtom(AtomType type, dw_form_t form) { case DW_FORM_GNU_addr_index: case DW_FORM_GNU_str_index: hash_data_has_fixed_byte_size = false; - LLVM_FALLTHROUGH; + [[fallthrough]]; case DW_FORM_flag: case DW_FORM_data1: case DW_FORM_ref1: @@ -184,7 +184,7 @@ void DWARFMappedHash::Prologue::AppendAtom(AtomType type, dw_form_t form) { case DW_FORM_block2: hash_data_has_fixed_byte_size = false; - LLVM_FALLTHROUGH; + [[fallthrough]]; case DW_FORM_data2: case DW_FORM_ref2: min_hash_data_byte_size += 2; @@ -192,7 +192,7 @@ void DWARFMappedHash::Prologue::AppendAtom(AtomType type, dw_form_t form) { case DW_FORM_block4: hash_data_has_fixed_byte_size = false; - LLVM_FALLTHROUGH; + [[fallthrough]]; case DW_FORM_data4: case DW_FORM_ref4: case DW_FORM_addr: diff --git a/lldb/source/Plugins/SymbolFile/NativePDB/SymbolFileNativePDB.cpp b/lldb/source/Plugins/SymbolFile/NativePDB/SymbolFileNativePDB.cpp index ee70a4b..ada7a0f 100644 --- a/lldb/source/Plugins/SymbolFile/NativePDB/SymbolFileNativePDB.cpp +++ b/lldb/source/Plugins/SymbolFile/NativePDB/SymbolFileNativePDB.cpp @@ -774,7 +774,7 @@ VariableSP SymbolFileNativePDB::CreateGlobalVariable(PdbGlobalSymId var_id) { switch (sym.kind()) { case S_GDATA32: is_external = true; - LLVM_FALLTHROUGH; + [[fallthrough]]; case S_LDATA32: { DataSym ds(sym.kind()); llvm::cantFail(SymbolDeserializer::deserializeAs(sym, ds)); @@ -789,7 +789,7 @@ VariableSP SymbolFileNativePDB::CreateGlobalVariable(PdbGlobalSymId var_id) { } case S_GTHREAD32: is_external = true; - LLVM_FALLTHROUGH; + [[fallthrough]]; case S_LTHREAD32: { ThreadLocalDataSym tlds(sym.kind()); llvm::cantFail( diff --git a/lldb/source/Plugins/SymbolFile/PDB/SymbolFilePDB.cpp b/lldb/source/Plugins/SymbolFile/PDB/SymbolFilePDB.cpp index f6caf8f..82b1e8e 100644 --- a/lldb/source/Plugins/SymbolFile/PDB/SymbolFilePDB.cpp +++ b/lldb/source/Plugins/SymbolFile/PDB/SymbolFilePDB.cpp @@ -1057,7 +1057,7 @@ SymbolFilePDB::ParseVariables(const lldb_private::SymbolContext &sc, switch (lexical_parent->getSymTag()) { case PDB_SymType::Exe: assert(sc.comp_unit); - LLVM_FALLTHROUGH; + [[fallthrough]]; case PDB_SymType::Compiland: { if (sc.comp_unit) { local_variable_list_sp = sc.comp_unit->GetVariableList(false); diff --git a/lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp b/lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp index 2b03afd..de6cffe 100644 --- a/lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp +++ b/lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp @@ -4721,7 +4721,7 @@ TypeSystemClang::GetBitSize(lldb::opaque_compiler_type_t type, } } } - LLVM_FALLTHROUGH; + [[fallthrough]]; default: const uint32_t bit_size = getASTContext().getTypeSize(qual_type); if (bit_size == 0) { @@ -8981,7 +8981,7 @@ bool TypeSystemClang::DumpTypeValue( bitfield_bit_offset, bitfield_bit_size); // format was not enum, just fall through and dump the value as // requested.... - LLVM_FALLTHROUGH; + [[fallthrough]]; default: // We are down to a scalar type that we just need to display. diff --git a/lldb/source/Target/Process.cpp b/lldb/source/Target/Process.cpp index 1b8df33..68d0321 100644 --- a/lldb/source/Target/Process.cpp +++ b/lldb/source/Target/Process.cpp @@ -3362,7 +3362,7 @@ bool Process::ShouldBroadcastEvent(Event *event_ptr) { m_stdio_communication.Disconnect(); m_stdin_forward = false; - LLVM_FALLTHROUGH; + [[fallthrough]]; case eStateConnected: case eStateAttaching: case eStateLaunching: diff --git a/lldb/source/Target/StackFrame.cpp b/lldb/source/Target/StackFrame.cpp index 4fb5ba0..8c79c9e 100644 --- a/lldb/source/Target/StackFrame.cpp +++ b/lldb/source/Target/StackFrame.cpp @@ -666,7 +666,7 @@ ValueObjectSP StackFrame::GetValueForVariableExpressionPath( } var_expr = var_expr.drop_front(); // Remove the '-' - LLVM_FALLTHROUGH; + [[fallthrough]]; case '.': { var_expr = var_expr.drop_front(); // Remove the '.' or '>' separator_idx = var_expr.find_first_of(".-["); @@ -1932,12 +1932,12 @@ bool StackFrame::GetStatus(Stream &strm, bool show_frame_info, bool show_source, case Debugger::eStopDisassemblyTypeNoDebugInfo: if (have_debuginfo) break; - LLVM_FALLTHROUGH; + [[fallthrough]]; case Debugger::eStopDisassemblyTypeNoSource: if (have_source) break; - LLVM_FALLTHROUGH; + [[fallthrough]]; case Debugger::eStopDisassemblyTypeAlways: if (target) { diff --git a/lldb/source/Target/StackFrameList.cpp b/lldb/source/Target/StackFrameList.cpp index 14663e4..c782b50 100644 --- a/lldb/source/Target/StackFrameList.cpp +++ b/lldb/source/Target/StackFrameList.cpp @@ -168,7 +168,7 @@ void StackFrameList::ResetCurrentInlinedDepth() { break; } } - LLVM_FALLTHROUGH; + [[fallthrough]]; default: { // Otherwise, we should set ourselves at the container of the inlining, so // that the user can descend into them. So first we check whether we have diff --git a/lldb/source/Utility/ArchSpec.cpp b/lldb/source/Utility/ArchSpec.cpp index 7ea76c3..b61d180 100644 --- a/lldb/source/Utility/ArchSpec.cpp +++ b/lldb/source/Utility/ArchSpec.cpp @@ -1083,7 +1083,7 @@ static bool cores_match(const ArchSpec::Core core1, const ArchSpec::Core core2, case ArchSpec::eCore_arm_generic: if (enforce_exact_match) break; - LLVM_FALLTHROUGH; + [[fallthrough]]; case ArchSpec::kCore_arm_any: if (core2 >= ArchSpec::kCore_arm_first && core2 <= ArchSpec::kCore_arm_last) return true; diff --git a/lldb/tools/lldb-test/lldb-test.cpp b/lldb/tools/lldb-test/lldb-test.cpp index 5c7b128..c6f9463 100644 --- a/lldb/tools/lldb-test/lldb-test.cpp +++ b/lldb/tools/lldb-test/lldb-test.cpp @@ -401,7 +401,7 @@ std::string opts::breakpoint::substitute(StringRef Cmd) { OS << sys::path::parent_path(breakpoint::CommandFile); break; } - LLVM_FALLTHROUGH; + [[fallthrough]]; default: size_t pos = Cmd.find('%'); OS << Cmd.substr(0, pos); diff --git a/lldb/unittests/Expression/DWARFExpressionTest.cpp b/lldb/unittests/Expression/DWARFExpressionTest.cpp index de8087f..2678db9 100644 --- a/lldb/unittests/Expression/DWARFExpressionTest.cpp +++ b/lldb/unittests/Expression/DWARFExpressionTest.cpp @@ -53,7 +53,7 @@ static llvm::Expected Evaluate(llvm::ArrayRef expr, return Scalar(llvm::APInt(buf.GetByteSize()*8, val, false)); } } - LLVM_FALLTHROUGH; + [[fallthrough]]; default: return status.ToError(); } -- 2.7.4