[Lldb-commits] [lldb] r261950 - Fix all of the unannotated switch cases to annotate the fall through or do the right thing and break.

Greg Clayton via lldb-commits lldb-commits at lists.llvm.org
Thu Feb 25 17:20:21 PST 2016


Author: gclayton
Date: Thu Feb 25 19:20:20 2016
New Revision: 261950

URL: http://llvm.org/viewvc/llvm-project?rev=261950&view=rev
Log:
Fix all of the unannotated switch cases to annotate the fall through or do the right thing and break.


Modified:
    lldb/trunk/source/Core/ArchSpec.cpp
    lldb/trunk/source/Core/FastDemangle.cpp
    lldb/trunk/source/Core/RegisterValue.cpp
    lldb/trunk/source/Core/Scalar.cpp
    lldb/trunk/source/Core/ValueObject.cpp
    lldb/trunk/source/Expression/IRMemoryMap.cpp
    lldb/trunk/source/Host/common/SocketAddress.cpp
    lldb/trunk/source/Host/posix/FileSystem.cpp
    lldb/trunk/source/Interpreter/CommandInterpreter.cpp
    lldb/trunk/source/Plugins/ABI/MacOSX-arm/ABIMacOSX_arm.cpp
    lldb/trunk/source/Plugins/ABI/MacOSX-arm64/ABIMacOSX_arm64.cpp
    lldb/trunk/source/Plugins/ABI/SysV-arm/ABISysV_arm.cpp
    lldb/trunk/source/Plugins/ABI/SysV-arm64/ABISysV_arm64.cpp
    lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangModulesDeclVendor.cpp
    lldb/trunk/source/Plugins/Instruction/ARM64/EmulateInstructionARM64.cpp
    lldb/trunk/source/Plugins/Language/ObjC/Cocoa.cpp
    lldb/trunk/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.cpp
    lldb/trunk/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp
    lldb/trunk/source/Plugins/Platform/FreeBSD/PlatformFreeBSD.cpp
    lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
    lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp
    lldb/trunk/source/Plugins/SymbolFile/DWARF/HashedNameToDIE.cpp
    lldb/trunk/source/Symbol/ObjectFile.cpp
    lldb/trunk/source/Symbol/Variable.cpp
    lldb/trunk/source/Target/StackFrameList.cpp
    lldb/trunk/source/Utility/JSON.cpp
    lldb/trunk/source/Utility/StringExtractorGDBRemote.cpp
    lldb/trunk/tools/lldb-server/lldb-gdbserver.cpp

Modified: lldb/trunk/source/Core/ArchSpec.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/ArchSpec.cpp?rev=261950&r1=261949&r2=261950&view=diff
==============================================================================
--- lldb/trunk/source/Core/ArchSpec.cpp (original)
+++ lldb/trunk/source/Core/ArchSpec.cpp Thu Feb 25 19:20:20 2016
@@ -1257,6 +1257,7 @@ cores_match (const ArchSpec::Core core1,
                 return true;
             try_inverse = false;
         }
+        break;
 
     case ArchSpec::eCore_mips64:
         if (!enforce_exact_match)
@@ -1267,6 +1268,7 @@ cores_match (const ArchSpec::Core core1,
                 return true;
             try_inverse = false;
         }
+        break;
 
     case ArchSpec::eCore_mips64el:
         if (!enforce_exact_match)
@@ -1277,6 +1279,7 @@ cores_match (const ArchSpec::Core core1,
                 return true;
             try_inverse = false;
         }
+        break;
 
     case ArchSpec::eCore_mips64r2:
     case ArchSpec::eCore_mips64r3:

Modified: lldb/trunk/source/Core/FastDemangle.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/FastDemangle.cpp?rev=261950&r1=261949&r2=261950&view=diff
==============================================================================
--- lldb/trunk/source/Core/FastDemangle.cpp (original)
+++ lldb/trunk/source/Core/FastDemangle.cpp Thu Feb 25 19:20:20 2016
@@ -2365,6 +2365,7 @@ private:
                 Write('(');
                 Write(m_read_ptr, m_read_end - m_read_ptr);
                 Write(')');
+                LLVM_FALLTHROUGH;
             case '\0':
                 return true;
             default:

Modified: lldb/trunk/source/Core/RegisterValue.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/RegisterValue.cpp?rev=261950&r1=261949&r2=261950&view=diff
==============================================================================
--- lldb/trunk/source/Core/RegisterValue.cpp (original)
+++ lldb/trunk/source/Core/RegisterValue.cpp Thu Feb 25 19:20:20 2016
@@ -239,16 +239,17 @@ RegisterValue::GetScalarValue (Scalar &s
     {
         case eTypeInvalid:      break;
         case eTypeBytes:
-        {
-            switch (buffer.length)
             {
-            default:    break;
-            case 1:     scalar = *(const uint8_t *)buffer.bytes; return true;
-            case 2:     scalar = *(const uint16_t *)buffer.bytes; return true;
-            case 4:     scalar = *(const uint32_t *)buffer.bytes; return true;
-            case 8:     scalar = *(const uint64_t *)buffer.bytes; return true;
+                switch (buffer.length)
+                {
+                default:    break;
+                case 1:     scalar = *(const uint8_t *)buffer.bytes; return true;
+                case 2:     scalar = *(const uint16_t *)buffer.bytes; return true;
+                case 4:     scalar = *(const uint32_t *)buffer.bytes; return true;
+                case 8:     scalar = *(const uint64_t *)buffer.bytes; return true;
+                }
             }
-        }
+            break;
         case eTypeUInt8:
         case eTypeUInt16:
         case eTypeUInt32:

Modified: lldb/trunk/source/Core/Scalar.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/Scalar.cpp?rev=261950&r1=261949&r2=261950&view=diff
==============================================================================
--- lldb/trunk/source/Core/Scalar.cpp (original)
+++ lldb/trunk/source/Core/Scalar.cpp Thu Feb 25 19:20:20 2016
@@ -2630,6 +2630,7 @@ Scalar::ExtractBitfield (uint32_t bit_si
         case e_double:
             result = SignedBits ((uint64_t )m_float.convertToDouble(), msbit, lsbit);
             m_float = llvm::APFloat((double_t)result);
+            return true;
         case e_long_double:
             m_integer = m_float.bitcastToAPInt();
             result = SignedBits (*m_integer.getRawData(), msbit, lsbit);

Modified: lldb/trunk/source/Core/ValueObject.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/ValueObject.cpp?rev=261950&r1=261949&r2=261950&view=diff
==============================================================================
--- lldb/trunk/source/Core/ValueObject.cpp (original)
+++ lldb/trunk/source/Core/ValueObject.cpp Thu Feb 25 19:20:20 2016
@@ -2797,6 +2797,7 @@ ValueObject::GetValueForExpressionPath_I
                 }
                 expression_cstr++; // skip the -
             }
+            LLVM_FALLTHROUGH;
             case '.': // or fallthrough from ->
             {
                 if (options.m_check_dot_vs_arrow_syntax && *expression_cstr == '.' &&

Modified: lldb/trunk/source/Expression/IRMemoryMap.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Expression/IRMemoryMap.cpp?rev=261950&r1=261949&r2=261950&view=diff
==============================================================================
--- lldb/trunk/source/Expression/IRMemoryMap.cpp (original)
+++ lldb/trunk/source/Expression/IRMemoryMap.cpp Thu Feb 25 19:20:20 2016
@@ -784,6 +784,7 @@ IRMemoryMap::GetMemoryData (DataExtracto
                     return;
                 }
             }
+            break;
         case eAllocationPolicyHostOnly:
             if (!allocation.m_data.GetByteSize())
             {

Modified: lldb/trunk/source/Host/common/SocketAddress.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Host/common/SocketAddress.cpp?rev=261950&r1=261949&r2=261950&view=diff
==============================================================================
--- lldb/trunk/source/Host/common/SocketAddress.cpp (original)
+++ lldb/trunk/source/Host/common/SocketAddress.cpp Thu Feb 25 19:20:20 2016
@@ -185,14 +185,12 @@ SocketAddress::GetIPAddress () const
     {
         case AF_INET:
             if (inet_ntop(GetFamily(), &m_socket_addr.sa_ipv4.sin_addr, str, sizeof(str)))
-            {
                 return str;
-            }
+            break;
         case AF_INET6:
             if (inet_ntop(GetFamily(), &m_socket_addr.sa_ipv6.sin6_addr, str, sizeof(str)))
-            {
                 return str;
-            }
+            break;
     }
     return "";
 }

Modified: lldb/trunk/source/Host/posix/FileSystem.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Host/posix/FileSystem.cpp?rev=261950&r1=261949&r2=261950&view=diff
==============================================================================
--- lldb/trunk/source/Host/posix/FileSystem.cpp (original)
+++ lldb/trunk/source/Host/posix/FileSystem.cpp Thu Feb 25 19:20:20 2016
@@ -54,30 +54,32 @@ FileSystem::MakeDirectory(const FileSpec
             switch (error.GetError())
             {
                 case ENOENT:
-                {
-                    // Parent directory doesn't exist, so lets make it if we can
-                    // Make the parent directory and try again
-                    FileSpec parent_file_spec{file_spec.GetDirectory().GetCString(), false};
-                    error = MakeDirectory(parent_file_spec, file_permissions);
-                    if (error.Fail())
-                        return error;
-                    // Try and make the directory again now that the parent directory was made successfully
-                    if (::mkdir(file_spec.GetCString(), file_permissions) == -1)
                     {
-                        error.SetErrorToErrno();
+                        // Parent directory doesn't exist, so lets make it if we can
+                        // Make the parent directory and try again
+                        FileSpec parent_file_spec{file_spec.GetDirectory().GetCString(), false};
+                        error = MakeDirectory(parent_file_spec, file_permissions);
+                        if (error.Fail())
+                            return error;
+                        // Try and make the directory again now that the parent directory was made successfully
+                        if (::mkdir(file_spec.GetCString(), file_permissions) == -1)
+                        {
+                            error.SetErrorToErrno();
+                        }
                         return error;
                     }
-                }
+                    break;
                 case EEXIST:
-                {
-                    if (file_spec.IsDirectory())
-                        return Error{}; // It is a directory and it already exists
-                }
+                    {
+                        if (file_spec.IsDirectory())
+                            return Error(); // It is a directory and it already exists
+                    }
+                    break;
             }
         }
         return error;
     }
-    return Error{"empty path"};
+    return Error("empty path");
 }
 
 Error

Modified: lldb/trunk/source/Interpreter/CommandInterpreter.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Interpreter/CommandInterpreter.cpp?rev=261950&r1=261949&r2=261950&view=diff
==============================================================================
--- lldb/trunk/source/Interpreter/CommandInterpreter.cpp (original)
+++ lldb/trunk/source/Interpreter/CommandInterpreter.cpp Thu Feb 25 19:20:20 2016
@@ -1625,6 +1625,7 @@ CommandInterpreter::PreprocessCommand (s
                                     break;
                                 case eExpressionResultUnavailable:
                                     error.SetErrorStringWithFormat ("expression error fetching result for the expression '%s'", expr_str.c_str());
+                                    break;
                                 case eExpressionCompleted:
                                     break;
                                 case eExpressionDiscarded:

Modified: lldb/trunk/source/Plugins/ABI/MacOSX-arm/ABIMacOSX_arm.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/ABI/MacOSX-arm/ABIMacOSX_arm.cpp?rev=261950&r1=261949&r2=261950&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/ABI/MacOSX-arm/ABIMacOSX_arm.cpp (original)
+++ lldb/trunk/source/Plugins/ABI/MacOSX-arm/ABIMacOSX_arm.cpp Thu Feb 25 19:20:20 2016
@@ -843,6 +843,7 @@ ABIMacOSX_arm::RegisterIsVolatile (const
                     default:
                         break;
                     }
+                    break;
                 case '4':
                 case '5':
                 case '6':
@@ -878,30 +879,14 @@ ABIMacOSX_arm::RegisterIsVolatile (const
                     break;
 
                 case '2':
-                    switch (name[2])
-                    {
-                    case '\0':
-                        return true; // s2 is volatile
-                    default:
-                        break;
-                    }
-                    break;
-
                 case '3':
-                    switch (name[2])
-                    {
-                    case '\0':
-                        return true; // s3 is volatile
-                    default:
-                        break;
-                    }
                 case '4':
                 case '5':
                 case '6':
                 case '7':
                 case '8':
                 case '9':
-                    return name[2] == '\0'; // s4 - s9 are volatile
+                    return name[2] == '\0'; // s2 - s9 are volatile
 
                 default:
                     break;
@@ -926,7 +911,8 @@ ABIMacOSX_arm::RegisterIsVolatile (const
                         default:
                             break;
                     };
-                case '0': 
+                    break;
+                case '0':
                 case '2': 
                 case '3': 
                     return name[2] == '\0'; // q0-q3 are volatile

Modified: lldb/trunk/source/Plugins/ABI/MacOSX-arm64/ABIMacOSX_arm64.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/ABI/MacOSX-arm64/ABIMacOSX_arm64.cpp?rev=261950&r1=261949&r2=261950&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/ABI/MacOSX-arm64/ABIMacOSX_arm64.cpp (original)
+++ lldb/trunk/source/Plugins/ABI/MacOSX-arm64/ABIMacOSX_arm64.cpp Thu Feb 25 19:20:20 2016
@@ -670,6 +670,7 @@ ABIMacOSX_arm64::RegisterIsVolatile (con
                 case '3':                             // x30 aka lr treat as non-volatile
                     if (name[2] == '0')
                       return false;
+                    break;
                 default:
                     return true;
             }

Modified: lldb/trunk/source/Plugins/ABI/SysV-arm/ABISysV_arm.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/ABI/SysV-arm/ABISysV_arm.cpp?rev=261950&r1=261949&r2=261950&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/ABI/SysV-arm/ABISysV_arm.cpp (original)
+++ lldb/trunk/source/Plugins/ABI/SysV-arm/ABISysV_arm.cpp Thu Feb 25 19:20:20 2016
@@ -915,6 +915,7 @@ ABISysV_arm::RegisterIsVolatile (const R
                     default:
                         break;
                     }
+                    break;
                 case '4':
                 case '5':
                 case '6':
@@ -950,30 +951,14 @@ ABISysV_arm::RegisterIsVolatile (const R
                     break;
 
                 case '2':
-                    switch (name[2])
-                    {
-                    case '\0':
-                        return true; // s2 is volatile
-                    default:
-                        break;
-                    }
-                    break;
-
                 case '3':
-                    switch (name[2])
-                    {
-                    case '\0':
-                        return true; // s3 is volatile
-                    default:
-                        break;
-                    }
                 case '4':
                 case '5':
                 case '6':
                 case '7':
                 case '8':
                 case '9':
-                    return name[2] == '\0'; // s4 - s9 are volatile
+                    return name[2] == '\0'; // s2 - s9 are volatile
 
                 default:
                     break;
@@ -996,9 +981,11 @@ ABISysV_arm::RegisterIsVolatile (const R
                         case '5':
                             return true; // q10-q15 are volatile
                         default:
-                            break;
-                    };
-                case '0': 
+                            return false;
+                    }
+                    break;
+
+                case '0':
                 case '2': 
                 case '3': 
                     return name[2] == '\0'; // q0-q3 are volatile

Modified: lldb/trunk/source/Plugins/ABI/SysV-arm64/ABISysV_arm64.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/ABI/SysV-arm64/ABISysV_arm64.cpp?rev=261950&r1=261949&r2=261950&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/ABI/SysV-arm64/ABISysV_arm64.cpp (original)
+++ lldb/trunk/source/Plugins/ABI/SysV-arm64/ABISysV_arm64.cpp Thu Feb 25 19:20:20 2016
@@ -648,6 +648,7 @@ ABISysV_arm64::RegisterIsVolatile (const
                 case '3':                             // x30 (lr) and x31 (sp) treat as non-volatile
                     if (name[2] == '0' || name[2] == '1')
                       return false;
+                    break;
                 default:
                     return true;                      // all volatile cases not handled above fall here.
             }

Modified: lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangModulesDeclVendor.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangModulesDeclVendor.cpp?rev=261950&r1=261949&r2=261950&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangModulesDeclVendor.cpp (original)
+++ lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangModulesDeclVendor.cpp Thu Feb 25 19:20:20 2016
@@ -585,6 +585,7 @@ ClangModulesDeclVendorImpl::ForEachMacro
                                 break;
                             case clang::tok::TokenKind::raw_identifier:
                                 macro_expansion.append(ti->getRawIdentifier().str());
+                                break;
                             default:
                                 macro_expansion.append(ti->getName());
                                 break;

Modified: lldb/trunk/source/Plugins/Instruction/ARM64/EmulateInstructionARM64.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Instruction/ARM64/EmulateInstructionARM64.cpp?rev=261950&r1=261949&r2=261950&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Instruction/ARM64/EmulateInstructionARM64.cpp (original)
+++ lldb/trunk/source/Plugins/Instruction/ARM64/EmulateInstructionARM64.cpp Thu Feb 25 19:20:20 2016
@@ -980,7 +980,7 @@ EmulateInstructionARM64::EmulateLDRSTRIm
 
             if (!WriteRegister (context, &reg_info_Rt, data_Rt))
                 return false;
-
+            break;
         default:
             return false;
     }

Modified: lldb/trunk/source/Plugins/Language/ObjC/Cocoa.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Language/ObjC/Cocoa.cpp?rev=261950&r1=261949&r2=261950&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Language/ObjC/Cocoa.cpp (original)
+++ lldb/trunk/source/Plugins/Language/ObjC/Cocoa.cpp Thu Feb 25 19:20:20 2016
@@ -531,6 +531,7 @@ lldb_private::formatters::NSNumberSummar
                     break;
                 case 17: // 0B10001
                     data_location += 8;
+                    LLVM_FALLTHROUGH;
                 case 4: // 0B0100
                     value = process_sp->ReadUnsignedIntegerFromMemory(data_location, 8, 0, error);
                     if (error.Fail())

Modified: lldb/trunk/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.cpp?rev=261950&r1=261949&r2=261950&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.cpp (original)
+++ lldb/trunk/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.cpp Thu Feb 25 19:20:20 2016
@@ -2486,7 +2486,7 @@ RenderScriptRuntime::SaveAllocation(Stre
     // Write the file header
     size_t num_bytes = sizeof(AllocationDetails::FileHeader);
     if (log)
-        log->Printf("%s - writing File Header, 0x%" PRIx64 " bytes", __FUNCTION__, num_bytes);
+        log->Printf("%s - writing File Header, 0x%" PRIx64 " bytes", __FUNCTION__, (uint64_t)num_bytes);
 
     Error err = file.Write(&head, num_bytes);
     if (!err.Success())
@@ -2500,7 +2500,7 @@ RenderScriptRuntime::SaveAllocation(Stre
     std::shared_ptr<uint8_t> element_header_buffer(new uint8_t[element_header_size]);
     if (element_header_buffer == nullptr)
     {
-        strm.Printf("Internal Error: Couldn't allocate %" PRIu64 " bytes on the heap", element_header_size);
+        strm.Printf("Internal Error: Couldn't allocate %" PRIu64 " bytes on the heap", (uint64_t)element_header_size);
         strm.EOL();
         return false;
     }
@@ -2510,7 +2510,7 @@ RenderScriptRuntime::SaveAllocation(Stre
     // Write headers for allocation element type to file
     num_bytes = element_header_size;
     if (log)
-        log->Printf("%s - writing element headers, 0x%" PRIx64 " bytes.", __FUNCTION__, num_bytes);
+        log->Printf("%s - writing element headers, 0x%" PRIx64 " bytes.", __FUNCTION__, (uint64_t)num_bytes);
 
     err = file.Write(element_header_buffer.get(), num_bytes);
     if (!err.Success())
@@ -2523,7 +2523,7 @@ RenderScriptRuntime::SaveAllocation(Stre
     // Write allocation data to file
     num_bytes = static_cast<size_t>(*alloc->size.get());
     if (log)
-        log->Printf("%s - writing 0x%" PRIx64 " bytes", __FUNCTION__, num_bytes);
+        log->Printf("%s - writing 0x%" PRIx64 " bytes", __FUNCTION__, (uint64_t)num_bytes);
 
     err = file.Write(buffer.get(), num_bytes);
     if (!err.Success())

Modified: lldb/trunk/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp?rev=261950&r1=261949&r2=261950&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp (original)
+++ lldb/trunk/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp Thu Feb 25 19:20:20 2016
@@ -5120,6 +5120,7 @@ ObjectFileMachO::GetEntryPointAddress ()
                         start_address = text_segment_sp->GetFileAddress() + entryoffset;
                     }
                 }
+                break;
 
             default:
                 break;

Modified: lldb/trunk/source/Plugins/Platform/FreeBSD/PlatformFreeBSD.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Platform/FreeBSD/PlatformFreeBSD.cpp?rev=261950&r1=261949&r2=261950&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Platform/FreeBSD/PlatformFreeBSD.cpp (original)
+++ lldb/trunk/source/Plugins/Platform/FreeBSD/PlatformFreeBSD.cpp Thu Feb 25 19:20:20 2016
@@ -635,8 +635,7 @@ PlatformFreeBSD::GetSoftwareBreakpointTr
                 return 0;
             }
         }
-
-        // Fall through...
+        LLVM_FALLTHROUGH;
     default:
         return Platform::GetSoftwareBreakpointTrapOpcode(target, bp_site);
     }

Modified: lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp?rev=261950&r1=261949&r2=261950&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp (original)
+++ lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp Thu Feb 25 19:20:20 2016
@@ -3138,35 +3138,33 @@ ProcessGDBRemote::DoAllocateMemory (size
     Log *log (GetLogIfAnyCategoriesSet (LIBLLDB_LOG_PROCESS|LIBLLDB_LOG_EXPRESSIONS));
     addr_t allocated_addr = LLDB_INVALID_ADDRESS;
 
-    LazyBool supported = m_gdb_comm.SupportsAllocDeallocMemory();
-    switch (supported)
+    if (m_gdb_comm.SupportsAllocDeallocMemory() != eLazyBoolNo)
     {
-        case eLazyBoolCalculate:
-        case eLazyBoolYes:
-            allocated_addr = m_gdb_comm.AllocateMemory (size, permissions);
-            if (allocated_addr != LLDB_INVALID_ADDRESS || supported == eLazyBoolYes)
-                return allocated_addr;
+        allocated_addr = m_gdb_comm.AllocateMemory (size, permissions);
+        if (allocated_addr != LLDB_INVALID_ADDRESS || m_gdb_comm.SupportsAllocDeallocMemory() == eLazyBoolYes)
+            return allocated_addr;
+    }
 
-        case eLazyBoolNo:
-            // Call mmap() to create memory in the inferior..
-            unsigned prot = 0;
-            if (permissions & lldb::ePermissionsReadable)
-                prot |= eMmapProtRead;
-            if (permissions & lldb::ePermissionsWritable)
-                prot |= eMmapProtWrite;
-            if (permissions & lldb::ePermissionsExecutable)
-                prot |= eMmapProtExec;
+    if (m_gdb_comm.SupportsAllocDeallocMemory() == eLazyBoolNo)
+    {
+        // Call mmap() to create memory in the inferior..
+        unsigned prot = 0;
+        if (permissions & lldb::ePermissionsReadable)
+            prot |= eMmapProtRead;
+        if (permissions & lldb::ePermissionsWritable)
+            prot |= eMmapProtWrite;
+        if (permissions & lldb::ePermissionsExecutable)
+            prot |= eMmapProtExec;
 
-            if (InferiorCallMmap(this, allocated_addr, 0, size, prot,
-                                 eMmapFlagsAnon | eMmapFlagsPrivate, -1, 0))
-                m_addr_to_mmap_size[allocated_addr] = size;
-            else
-            {
-                allocated_addr = LLDB_INVALID_ADDRESS;
-                if (log)
-                    log->Printf ("ProcessGDBRemote::%s no direct stub support for memory allocation, and InferiorCallMmap also failed - is stub missing register context save/restore capability?", __FUNCTION__);
-            }
-            break;
+        if (InferiorCallMmap(this, allocated_addr, 0, size, prot,
+                             eMmapFlagsAnon | eMmapFlagsPrivate, -1, 0))
+            m_addr_to_mmap_size[allocated_addr] = size;
+        else
+        {
+            allocated_addr = LLDB_INVALID_ADDRESS;
+            if (log)
+                log->Printf ("ProcessGDBRemote::%s no direct stub support for memory allocation, and InferiorCallMmap also failed - is stub missing register context save/restore capability?", __FUNCTION__);
+        }
     }
 
     if (allocated_addr == LLDB_INVALID_ADDRESS)

Modified: lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp?rev=261950&r1=261949&r2=261950&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp (original)
+++ lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp Thu Feb 25 19:20:20 2016
@@ -277,6 +277,7 @@ DWARFASTParserClang::ParseTypeFromDWARF
                     if (type_sp)
                         return type_sp;
 
+                LLVM_FALLTHROUGH;
                 case DW_TAG_base_type:
                 case DW_TAG_pointer_type:
                 case DW_TAG_reference_type:

Modified: lldb/trunk/source/Plugins/SymbolFile/DWARF/HashedNameToDIE.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/SymbolFile/DWARF/HashedNameToDIE.cpp?rev=261950&r1=261949&r2=261950&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/SymbolFile/DWARF/HashedNameToDIE.cpp (original)
+++ lldb/trunk/source/Plugins/SymbolFile/DWARF/HashedNameToDIE.cpp Thu Feb 25 19:20:20 2016
@@ -346,7 +346,8 @@ DWARFMappedHash::Header::Read (const lld
 
             case eAtomTypeTag:          // DW_TAG value for the DIE
                 hash_data.tag = (dw_tag_t)form_value.Unsigned ();
-                
+                break;
+
             case eAtomTypeTypeFlags:    // Flags from enum TypeFlags
                 hash_data.type_flags = (uint32_t)form_value.Unsigned ();
                 break;

Modified: lldb/trunk/source/Symbol/ObjectFile.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Symbol/ObjectFile.cpp?rev=261950&r1=261949&r2=261950&view=diff
==============================================================================
--- lldb/trunk/source/Symbol/ObjectFile.cpp (original)
+++ lldb/trunk/source/Symbol/ObjectFile.cpp Thu Feb 25 19:20:20 2016
@@ -547,8 +547,6 @@ ObjectFile::ReadSectionData (const Secti
         // The object file now contains a full mmap'ed copy of the object file data, so just use this
         return MemoryMapSectionData (section, section_data);
     }
-    section_data.Clear();
-    return 0;
 }
 
 size_t

Modified: lldb/trunk/source/Symbol/Variable.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Symbol/Variable.cpp?rev=261950&r1=261949&r2=261950&view=diff
==============================================================================
--- lldb/trunk/source/Symbol/Variable.cpp (original)
+++ lldb/trunk/source/Symbol/Variable.cpp Thu Feb 25 19:20:20 2016
@@ -828,6 +828,7 @@ PrivateAutoComplete (StackFrame *frame,
                                                             word_complete);                            
                             }
                         }
+                        break;
                     default:
                         break;
                 }
@@ -864,6 +865,7 @@ PrivateAutoComplete (StackFrame *frame,
                                                         matches,
                                                         word_complete);
                         }
+                        break;
                     default:
                         break;
                 }

Modified: lldb/trunk/source/Target/StackFrameList.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Target/StackFrameList.cpp?rev=261950&r1=261949&r2=261950&view=diff
==============================================================================
--- lldb/trunk/source/Target/StackFrameList.cpp (original)
+++ lldb/trunk/source/Target/StackFrameList.cpp Thu Feb 25 19:20:20 2016
@@ -187,6 +187,7 @@ StackFrameList::ResetCurrentInlinedDepth
                                         break;
                                     }
                                 }
+                                LLVM_FALLTHROUGH;
                             default:
                                 {
                                     // Otherwise, we should set ourselves at the container of the inlining, so that the

Modified: lldb/trunk/source/Utility/JSON.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Utility/JSON.cpp?rev=261950&r1=261949&r2=261950&view=diff
==============================================================================
--- lldb/trunk/source/Utility/JSON.cpp (original)
+++ lldb/trunk/source/Utility/JSON.cpp Thu Feb 25 19:20:20 2016
@@ -445,6 +445,7 @@ JSONParser::GetToken (std::string &value
                                 value = std::move(error.GetString());
                                 return Token::Error;
                             }
+                            break;
 
                         default:
                             done = true;

Modified: lldb/trunk/source/Utility/StringExtractorGDBRemote.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Utility/StringExtractorGDBRemote.cpp?rev=261950&r1=261949&r2=261950&view=diff
==============================================================================
--- lldb/trunk/source/Utility/StringExtractorGDBRemote.cpp (original)
+++ lldb/trunk/source/Utility/StringExtractorGDBRemote.cpp Thu Feb 25 19:20:20 2016
@@ -227,7 +227,7 @@ StringExtractorGDBRemote::GetServerPacke
     case 'j':
         if (PACKET_MATCHES("jSignalsInfo"))                     return eServerPacketType_jSignalsInfo;
         if (PACKET_MATCHES("jThreadsInfo"))                     return eServerPacketType_jThreadsInfo;
-
+        break;
 
     case 'v':
             if (PACKET_STARTS_WITH("vFile:"))

Modified: lldb/trunk/tools/lldb-server/lldb-gdbserver.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/lldb-server/lldb-gdbserver.cpp?rev=261950&r1=261949&r2=261950&view=diff
==============================================================================
--- lldb/trunk/tools/lldb-server/lldb-gdbserver.cpp (original)
+++ lldb/trunk/tools/lldb-server/lldb-gdbserver.cpp Thu Feb 25 19:20:20 2016
@@ -473,6 +473,7 @@ main_gdbserver (int argc, char *argv[])
         case 'U': // unnamed pipe
             if (optarg && optarg[0])
                 unnamed_pipe_fd = StringConvert::ToUInt32(optarg, -1);
+            break;
 
         case 'r':
             // Do nothing, native regs is the default these days




More information about the lldb-commits mailing list