[Lldb-commits] [lldb] r135508 - in /lldb/trunk: include/lldb/Core/ include/lldb/Expression/ include/lldb/Symbol/ include/lldb/Target/ source/Commands/ source/Core/ source/Expression/ source/Host/common/

Johnny Chen johnny.chen at apple.com
Tue Jul 19 12:48:13 PDT 2011


Author: johnny
Date: Tue Jul 19 14:48:13 2011
New Revision: 135508

URL: http://llvm.org/viewvc/llvm-project?rev=135508&view=rev
Log:
Patch by Matt Johnson to silence G++ warnings!
Used hand merge to apply the diffs.  I did not apply the diffs for FormatManager.h and
the diffs for memberwise initialization for ValueObject.cpp because they changed since.
I will ask my colleague to apply them later.

Modified:
    lldb/trunk/include/lldb/Core/InputReaderEZ.h
    lldb/trunk/include/lldb/Core/Value.h
    lldb/trunk/include/lldb/Core/ValueObject.h
    lldb/trunk/include/lldb/Expression/ClangExpressionDeclMap.h
    lldb/trunk/include/lldb/Expression/ProcessDataAllocator.h
    lldb/trunk/include/lldb/Symbol/ClangASTContext.h
    lldb/trunk/include/lldb/Symbol/ClangASTImporter.h
    lldb/trunk/include/lldb/Symbol/ObjectFile.h
    lldb/trunk/include/lldb/Target/Process.h
    lldb/trunk/source/Commands/CommandObjectExpression.cpp
    lldb/trunk/source/Commands/CommandObjectType.cpp
    lldb/trunk/source/Core/ValueObject.cpp
    lldb/trunk/source/Expression/ClangExpressionDeclMap.cpp
    lldb/trunk/source/Expression/ClangExpressionParser.cpp
    lldb/trunk/source/Expression/ClangUserExpression.cpp
    lldb/trunk/source/Expression/IRForTarget.cpp
    lldb/trunk/source/Host/common/FileSpec.cpp
    lldb/trunk/source/Host/common/Host.cpp

Modified: lldb/trunk/include/lldb/Core/InputReaderEZ.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/InputReaderEZ.h?rev=135508&r1=135507&r2=135508&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Core/InputReaderEZ.h (original)
+++ lldb/trunk/include/lldb/Core/InputReaderEZ.h Tue Jul 19 14:48:13 2011
@@ -26,11 +26,11 @@
 
 private:
     
-    static size_t Callback_Impl(void *baton, 
-                         InputReader &reader, 
-                         lldb::InputReaderAction notification,
-                         const char *bytes, 
-                         size_t bytes_len);    
+    static size_t Callback_Impl(void *baton,
+                                InputReader &reader,
+                                lldb::InputReaderAction notification,
+                                const char *bytes,
+                                size_t bytes_len);
 public:
     
     InputReaderEZ (Debugger &debugger) :
@@ -40,6 +40,7 @@
     virtual
     ~InputReaderEZ ();
 
+    using InputReader::Initialize;
     virtual Error
     Initialize(void* baton,
                lldb::InputReaderGranularity token_size = lldb::eInputReaderGranularityLine,

Modified: lldb/trunk/include/lldb/Core/Value.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/Value.h?rev=135508&r1=135507&r2=135508&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Core/Value.h (original)
+++ lldb/trunk/include/lldb/Core/Value.h Tue Jul 19 14:48:13 2011
@@ -47,7 +47,7 @@
         eContextTypeClangType,          // void * (an opaque clang::QualType * that can be fed to "static QualType QualType::getFromOpaquePtr(void *)")
         eContextTypeRegisterInfo,       // RegisterInfo *
         eContextTypeLLDBType,           // lldb_private::Type *
-        eContextTypeVariable,           // lldb_private::Variable *
+        eContextTypeVariable            // lldb_private::Variable *
     };
 
     Value();

Modified: lldb/trunk/include/lldb/Core/ValueObject.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/ValueObject.h?rev=135508&r1=135507&r2=135508&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Core/ValueObject.h (original)
+++ lldb/trunk/include/lldb/Core/ValueObject.h Tue Jul 19 14:48:13 2011
@@ -69,7 +69,7 @@
     enum GetExpressionPathFormat
     {
         eDereferencePointers = 1,
-        eHonorPointers,
+        eHonorPointers
     };
     
     enum ValueObjectRepresentationStyle

Modified: lldb/trunk/include/lldb/Expression/ClangExpressionDeclMap.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Expression/ClangExpressionDeclMap.h?rev=135508&r1=135507&r2=135508&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Expression/ClangExpressionDeclMap.h (original)
+++ lldb/trunk/include/lldb/Expression/ClangExpressionDeclMap.h Tue Jul 19 14:48:13 2011
@@ -644,8 +644,8 @@
     //----------------------------------------------------------------------
     struct MaterialVars {
         MaterialVars() :
-            m_allocated_area(NULL),
-            m_materialized_location(NULL)
+            m_allocated_area(0),
+            m_materialized_location(0)
         {
         }
         

Modified: lldb/trunk/include/lldb/Expression/ProcessDataAllocator.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Expression/ProcessDataAllocator.h?rev=135508&r1=135507&r2=135508&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Expression/ProcessDataAllocator.h (original)
+++ lldb/trunk/include/lldb/Expression/ProcessDataAllocator.h Tue Jul 19 14:48:13 2011
@@ -24,7 +24,7 @@
         IRForTarget::StaticDataAllocator(),
         m_process(process),
         m_stream_string(StreamString::eBinary, process.GetAddressByteSize(), process.GetByteOrder()),
-        m_allocation(NULL)
+        m_allocation(0)
     {
     }
     
@@ -46,18 +46,18 @@
         if (m_allocation)
             m_process.DeallocateMemory(m_allocation);
         
-        m_allocation = NULL;
+        m_allocation = 0;
         
         m_allocation = m_process.AllocateMemory(m_stream_string.GetSize(), lldb::ePermissionsReadable | lldb::ePermissionsWritable, err);
         
         if (!err.Success())
-            return NULL;
+            return 0;
         
         if (m_allocation)
             m_process.WriteMemory(m_allocation, m_stream_string.GetData(), m_stream_string.GetSize(), err);
         
         if (!err.Success())
-            return NULL;
+            return 0;
         
         return m_allocation;
     }
@@ -71,4 +71,4 @@
     
 } // namespace lldb_private
 
-#endif
\ No newline at end of file
+#endif

Modified: lldb/trunk/include/lldb/Symbol/ClangASTContext.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Symbol/ClangASTContext.h?rev=135508&r1=135507&r2=135508&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Symbol/ClangASTContext.h (original)
+++ lldb/trunk/include/lldb/Symbol/ClangASTContext.h Tue Jul 19 14:48:13 2011
@@ -50,7 +50,7 @@
         eTypeIsTemplate         = (1u << 14),
         eTypeIsTypedef          = (1u << 15),
         eTypeIsVector           = (1u << 16),
-        eTypeIsScalar           = (1u << 17),
+        eTypeIsScalar           = (1u << 17)
     };
 
     typedef void (*CompleteTagDeclCallback)(void *baton, clang::TagDecl *);

Modified: lldb/trunk/include/lldb/Symbol/ClangASTImporter.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Symbol/ClangASTImporter.h?rev=135508&r1=135507&r2=135508&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Symbol/ClangASTImporter.h (original)
+++ lldb/trunk/include/lldb/Symbol/ClangASTImporter.h Tue Jul 19 14:48:13 2011
@@ -24,8 +24,8 @@
 {
 public:
     ClangASTImporter (clang::ASTContext *target_ctx) :
-        m_target_ctx(target_ctx),
-        m_file_manager(clang::FileSystemOptions())
+        m_file_manager(clang::FileSystemOptions()),
+        m_target_ctx(target_ctx)
     {
     }
     
@@ -161,4 +161,4 @@
     
 }
 
-#endif
\ No newline at end of file
+#endif

Modified: lldb/trunk/include/lldb/Symbol/ObjectFile.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Symbol/ObjectFile.h?rev=135508&r1=135507&r2=135508&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Symbol/ObjectFile.h (original)
+++ lldb/trunk/include/lldb/Symbol/ObjectFile.h Tue Jul 19 14:48:13 2011
@@ -66,7 +66,7 @@
         eTypeObjectFile,    /// An intermediate object file
         eTypeSharedLibrary, /// A shared library that can be used during execution
         eTypeStubLibrary,   /// A library that can be linked against but not used for execution
-        eTypeUnknown,
+        eTypeUnknown
     } Type;
 
     typedef enum 

Modified: lldb/trunk/include/lldb/Target/Process.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Target/Process.h?rev=135508&r1=135507&r2=135508&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Target/Process.h (original)
+++ lldb/trunk/include/lldb/Target/Process.h Tue Jul 19 14:48:13 2011
@@ -883,7 +883,7 @@
     {
         if (idx < m_infos.size())
             return m_infos[idx].GetProcessID();
-        return NULL;        
+        return 0;
     }
 
     bool

Modified: lldb/trunk/source/Commands/CommandObjectExpression.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Commands/CommandObjectExpression.cpp?rev=135508&r1=135507&r2=135508&view=diff
==============================================================================
--- lldb/trunk/source/Commands/CommandObjectExpression.cpp (original)
+++ lldb/trunk/source/Commands/CommandObjectExpression.cpp Tue Jul 19 14:48:13 2011
@@ -463,14 +463,14 @@
 OptionDefinition
 CommandObjectExpression::CommandOptions::g_option_table[] =
 {
-  //{ LLDB_OPT_SET_ALL, false, "language",   'l', required_argument, NULL, 0, "[c|c++|objc|objc++]",          "Sets the language to use when parsing the expression."},
+//{ LLDB_OPT_SET_ALL, false, "language",   'l', required_argument, NULL, 0, "[c|c++|objc|objc++]",          "Sets the language to use when parsing the expression."},
 //{ LLDB_OPT_SET_1, false, "format",     'f', required_argument, NULL, 0, "[ [bool|b] | [bin] | [char|c] | [oct|o] | [dec|i|d|u] | [hex|x] | [float|f] | [cstr|s] ]",  "Specify the format that the expression output should use."},
-{ LLDB_OPT_SET_1, false, "format",             'f', required_argument, NULL, 0, eArgTypeExprFormat,  "Specify the format that the expression output should use."},
-{ LLDB_OPT_SET_2, false, "object-description", 'o', no_argument,       NULL, 0, eArgTypeNone, "Print the object description of the value resulting from the expression."},
-{ LLDB_OPT_SET_2, false, "dynamic-value", 'd', required_argument,       NULL, 0, eArgTypeBoolean, "Upcast the value resulting from the expression to its dynamic type if available."},
-{ LLDB_OPT_SET_ALL, false, "unwind-on-error",  'u', required_argument, NULL, 0, eArgTypeBoolean, "Clean up program state if the expression causes a crash, breakpoint hit or signal."},
-{ LLDB_OPT_SET_ALL, false, "debug",            'g', no_argument,       NULL, 0, eArgTypeNone, "Enable verbose debug logging of the expression parsing and evaluation."},
-{ LLDB_OPT_SET_ALL, false, "use-ir",           'i', no_argument,       NULL, 0, eArgTypeNone, "[Temporary] Instructs the expression evaluator to use IR instead of ASTs."},
-{ 0, false, NULL, 0, 0, NULL, NULL, eArgTypeNone, NULL }
+{ LLDB_OPT_SET_1,   false, "format",             'f', required_argument, NULL, 0, eArgTypeExprFormat, "Specify the format that the expression output should use."},
+{ LLDB_OPT_SET_2,   false, "object-description", 'o', no_argument,       NULL, 0, eArgTypeNone,       "Print the object description of the value resulting from the expression."},
+{ LLDB_OPT_SET_2,   false, "dynamic-value",      'd', required_argument, NULL, 0, eArgTypeBoolean,    "Upcast the value resulting from the expression to its dynamic type if available."},
+{ LLDB_OPT_SET_ALL, false, "unwind-on-error",    'u', required_argument, NULL, 0, eArgTypeBoolean,    "Clean up program state if the expression causes a crash, breakpoint hit or signal."},
+{ LLDB_OPT_SET_ALL, false, "debug",              'g', no_argument,       NULL, 0, eArgTypeNone,       "Enable verbose debug logging of the expression parsing and evaluation."},
+{ LLDB_OPT_SET_ALL, false, "use-ir",             'i', no_argument,       NULL, 0, eArgTypeNone,       "[Temporary] Instructs the expression evaluator to use IR instead of ASTs."},
+{ 0,                false, NULL,                 0,   0,                 NULL, 0, eArgTypeNone,       NULL }
 };
 

Modified: lldb/trunk/source/Commands/CommandObjectType.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Commands/CommandObjectType.cpp?rev=135508&r1=135507&r2=135508&view=diff
==============================================================================
--- lldb/trunk/source/Commands/CommandObjectType.cpp (original)
+++ lldb/trunk/source/Commands/CommandObjectType.cpp Tue Jul 19 14:48:13 2011
@@ -192,7 +192,7 @@
 
         // now I have a valid format, let's add it to every type
         
-        for (int i = 0; i < argc; i++) {
+        for (size_t i = 0; i < argc; i++) {
             const char* typeA = command.GetArgumentAtIndex(i);
             ConstString typeCS(typeA);
             if (typeCS)
@@ -542,7 +542,7 @@
         
         Error error;
         
-        for (int i = 0; i < options->m_target_types.GetSize(); i++)
+        for (size_t i = 0; i < options->m_target_types.GetSize(); i++)
         {
             const char *type_name = options->m_target_types.GetStringAtIndex(i);
             CommandObjectTypeSummaryAdd::AddSummary(ConstString(type_name),
@@ -785,7 +785,7 @@
                                                          m_options.m_name,
                                                          m_options.m_category);
         
-        for (int i = 0; i < argc; i++) {
+        for (size_t i = 0; i < argc; i++) {
             const char* typeA = command.GetArgumentAtIndex(i);
             if (typeA && *typeA)
                 options->m_target_types << typeA;
@@ -806,7 +806,7 @@
     
     Error error;
     
-    for (int i = 0; i < command.GetArgumentCount(); i++)
+    for (size_t i = 0; i < command.GetArgumentCount(); i++)
     {
         const char *type_name = command.GetArgumentAtIndex(i);
         CommandObjectTypeSummaryAdd::AddSummary(ConstString(type_name),
@@ -886,7 +886,7 @@
     
     // now I have a valid format, let's add it to every type
     
-    for (int i = 0; i < argc; i++) {
+    for (size_t i = 0; i < argc; i++) {
         const char* typeA = command.GetArgumentAtIndex(i);
         if (!typeA || typeA[0] == '\0')
         {

Modified: lldb/trunk/source/Core/ValueObject.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/ValueObject.cpp?rev=135508&r1=135507&r2=135508&view=diff
==============================================================================
--- lldb/trunk/source/Core/ValueObject.cpp (original)
+++ lldb/trunk/source/Core/ValueObject.cpp Tue Jul 19 14:48:13 2011
@@ -2356,7 +2356,7 @@
                     }
                     else
                     {
-                        for (int index = index_lower;
+                        for (unsigned long index = index_lower;
                              index <= index_higher; index++)
                         {
                             ValueObjectSP child = 
@@ -3091,4 +3091,4 @@
     m_value_str.clear();
     m_summary_str.clear();
     m_object_desc_str.clear();
-}
\ No newline at end of file
+}

Modified: lldb/trunk/source/Expression/ClangExpressionDeclMap.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Expression/ClangExpressionDeclMap.cpp?rev=135508&r1=135507&r2=135508&view=diff
==============================================================================
--- lldb/trunk/source/Expression/ClangExpressionDeclMap.cpp (original)
+++ lldb/trunk/source/Expression/ClangExpressionDeclMap.cpp Tue Jul 19 14:48:13 2011
@@ -168,7 +168,7 @@
     if (num_bytes > num_data_bytes)
         num_bytes = num_data_bytes;
     
-    for (off_t byte_idx = 0;
+    for (size_t byte_idx = 0;
          byte_idx < num_bytes;
          ++byte_idx)
     {
@@ -915,7 +915,7 @@
         if (log)
             log->PutCString("Not bothering to allocate a struct because no arguments are needed");
         
-        m_material_vars->m_allocated_area = NULL;
+        m_material_vars->m_allocated_area = 0;
         
         return true;
     }

Modified: lldb/trunk/source/Expression/ClangExpressionParser.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Expression/ClangExpressionParser.cpp?rev=135508&r1=135507&r2=135508&view=diff
==============================================================================
--- lldb/trunk/source/Expression/ClangExpressionParser.cpp (original)
+++ lldb/trunk/source/Expression/ClangExpressionParser.cpp Tue Jul 19 14:48:13 2011
@@ -257,7 +257,7 @@
         std::string triple = target->GetArchitecture().GetTriple().str();
         
         int dash_count = 0;
-        for (int i = 0; i < triple.size(); ++i)
+        for (size_t i = 0; i < triple.size(); ++i)
         {
             if (triple[i] == '-')
                 dash_count++;

Modified: lldb/trunk/source/Expression/ClangUserExpression.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Expression/ClangUserExpression.cpp?rev=135508&r1=135507&r2=135508&view=diff
==============================================================================
--- lldb/trunk/source/Expression/ClangUserExpression.cpp (original)
+++ lldb/trunk/source/Expression/ClangUserExpression.cpp Tue Jul 19 14:48:13 2011
@@ -413,8 +413,8 @@
 {
     lldb::addr_t struct_address;
             
-    lldb::addr_t object_ptr = NULL;
-    lldb::addr_t cmd_ptr = NULL;
+    lldb::addr_t object_ptr = 0;
+    lldb::addr_t cmd_ptr = 0;
     
     PrepareToExecuteJITExpression (error_stream, exe_ctx, struct_address, object_ptr, cmd_ptr);
     
@@ -494,8 +494,8 @@
     {
         lldb::addr_t struct_address;
                 
-        lldb::addr_t object_ptr = NULL;
-        lldb::addr_t cmd_ptr = NULL;
+        lldb::addr_t object_ptr = 0;
+        lldb::addr_t cmd_ptr = 0;
         
         if (!PrepareToExecuteJITExpression (error_stream, exe_ctx, struct_address, object_ptr, cmd_ptr))
             return eExecutionSetupError;

Modified: lldb/trunk/source/Expression/IRForTarget.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Expression/IRForTarget.cpp?rev=135508&r1=135507&r2=135508&view=diff
==============================================================================
--- lldb/trunk/source/Expression/IRForTarget.cpp (original)
+++ lldb/trunk/source/Expression/IRForTarget.cpp Tue Jul 19 14:48:13 2011
@@ -52,16 +52,16 @@
     ModulePass(ID),
     m_resolve_vars(resolve_vars),
     m_func_name(func_name),
-    m_decl_map(decl_map),
     m_module(NULL),
+    m_decl_map(decl_map),
+    m_data_allocator(data_allocator),
     m_CFStringCreateWithBytes(NULL),
     m_sel_registerName(NULL),
+    m_const_result(const_result),
     m_error_stream(error_stream),
     m_has_side_effects(false),
     m_result_store(NULL),
     m_result_is_pointer(false),
-    m_const_result(const_result),
-    m_data_allocator(data_allocator),
     m_reloc_placeholder(NULL)
 {
 }
@@ -1918,7 +1918,7 @@
          ++ui)
         users.push_back(*ui);
         
-    for (int i = 0;
+    for (size_t i = 0;
          i < users.size();
          ++i)
     {

Modified: lldb/trunk/source/Host/common/FileSpec.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Host/common/FileSpec.cpp?rev=135508&r1=135507&r2=135508&view=diff
==============================================================================
--- lldb/trunk/source/Host/common/FileSpec.cpp (original)
+++ lldb/trunk/source/Host/common/FileSpec.cpp Tue Jul 19 14:48:13 2011
@@ -913,7 +913,7 @@
                 {
                     char child_path[PATH_MAX];
                     const int child_path_len = ::snprintf (child_path, sizeof(child_path), "%s/%s", dir_path, dp->d_name);
-                    if (child_path_len < sizeof(child_path) - 1)
+                    if (child_path_len < (int)(sizeof(child_path) - 1))
                     {
                         // Don't resolve the file type or path
                         FileSpec child_path_spec (child_path, false);

Modified: lldb/trunk/source/Host/common/Host.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Host/common/Host.cpp?rev=135508&r1=135507&r2=135508&view=diff
==============================================================================
--- lldb/trunk/source/Host/common/Host.cpp (original)
+++ lldb/trunk/source/Host/common/Host.cpp Tue Jul 19 14:48:13 2011
@@ -183,7 +183,7 @@
             }
             else
             {
-                status_cstr = "(???)";
+                status_cstr = "(\?\?\?)";
             }
 
             // Scope for pthread_cancel_disabler





More information about the lldb-commits mailing list