[Lldb-commits] [lldb] r339994 - Fix compiler warnings after rL339649.

Aleksandr Urakov via lldb-commits lldb-commits at lists.llvm.org
Fri Aug 17 00:28:25 PDT 2018


Author: aleksandr.urakov
Date: Fri Aug 17 00:28:24 2018
New Revision: 339994

URL: http://llvm.org/viewvc/llvm-project?rev=339994&view=rev
Log:
Fix compiler warnings after rL339649.

Differential Revision: https://reviews.llvm.org/D49980

Modified:
    lldb/trunk/source/Plugins/SymbolFile/PDB/PDBASTParser.cpp
    lldb/trunk/source/Symbol/ClangASTContext.cpp

Modified: lldb/trunk/source/Plugins/SymbolFile/PDB/PDBASTParser.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/SymbolFile/PDB/PDBASTParser.cpp?rev=339994&r1=339993&r2=339994&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/SymbolFile/PDB/PDBASTParser.cpp (original)
+++ lldb/trunk/source/Plugins/SymbolFile/PDB/PDBASTParser.cpp Fri Aug 17 00:28:24 2018
@@ -52,9 +52,8 @@ int TranslateUdtKind(PDB_UdtType pdb_kin
     return clang::TTK_Union;
   case PDB_UdtType::Interface:
     return clang::TTK_Interface;
-  default:
-    llvm_unreachable("unsuported PDB UDT type");
   }
+  llvm_unreachable("unsuported PDB UDT type");
 }
 
 lldb::Encoding TranslateBuiltinEncoding(PDB_BuiltinType type) {
@@ -213,9 +212,8 @@ AccessType TranslateMemberAccess(PDB_Mem
     return eAccessProtected;
   case PDB_MemberAccess::Public:
     return eAccessPublic;
-  default:
-    return eAccessNone;
   }
+  return eAccessNone;
 }
 
 AccessType GetDefaultAccessibilityForUdtKind(PDB_UdtType udt_kind) {
@@ -226,9 +224,8 @@ AccessType GetDefaultAccessibilityForUdt
   case PDB_UdtType::Class:
   case PDB_UdtType::Interface:
     return eAccessPrivate;
-  default:
-    llvm_unreachable("unsupported PDB UDT type");
   }
+  llvm_unreachable("unsupported PDB UDT type");
 }
 
 AccessType GetAccessibilityForUdt(const PDBSymbolTypeUDT &udt) {

Modified: lldb/trunk/source/Symbol/ClangASTContext.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Symbol/ClangASTContext.cpp?rev=339994&r1=339993&r2=339994&view=diff
==============================================================================
--- lldb/trunk/source/Symbol/ClangASTContext.cpp (original)
+++ lldb/trunk/source/Symbol/ClangASTContext.cpp Fri Aug 17 00:28:24 2018
@@ -6543,8 +6543,8 @@ CompilerType ClangASTContext::GetChildCo
                                 vbtable_ptr + vbtable_index * 4;
                             const int32_t base_offset =
                                 process->ReadSignedIntegerFromMemory(
-                                    base_offset_addr, 4, UINT32_MAX, err);
-                            if (base_offset != UINT32_MAX) {
+                                    base_offset_addr, 4, INT32_MAX, err);
+                            if (base_offset != INT32_MAX) {
                               handled = true;
                               bit_offset = base_offset * 8;
                             }
@@ -6740,7 +6740,7 @@ CompilerType ClangASTContext::GetChildCo
 
                 // Setting this to UINT32_MAX to make sure we don't compute it
                 // twice...
-                bit_offset = UINT32_MAX;
+                bit_offset = INT32_MAX;
 
                 if (child_byte_offset ==
                     static_cast<int32_t>(LLDB_INVALID_IVAR_OFFSET)) {
@@ -6757,7 +6757,7 @@ CompilerType ClangASTContext::GetChildCo
 
                 if (ClangASTContext::FieldIsBitfield(getASTContext(), ivar_decl,
                                                      child_bitfield_bit_size)) {
-                  if (bit_offset == UINT32_MAX)
+                  if (bit_offset == INT32_MAX)
                     bit_offset = interface_layout.getFieldOffset(
                         child_idx - superclass_idx);
 




More information about the lldb-commits mailing list