Enabled extra warnings and fixed a bunch of small issues.



git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@124250 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/source/Expression/ClangExpressionDeclMap.cpp b/source/Expression/ClangExpressionDeclMap.cpp
index f996242..5c377cf 100644
--- a/source/Expression/ClangExpressionDeclMap.cpp
+++ b/source/Expression/ClangExpressionDeclMap.cpp
@@ -1402,17 +1402,15 @@
 {
     uint32_t register_number = reg_info.kinds[lldb::eRegisterKindLLDB];
     uint32_t register_byte_size = reg_info.byte_size;
-    
-    Error error;
-    
+
     if (dematerialize)
     {
         DataBufferHeap register_data (register_byte_size, 0);
         
-        Error error;
-        if (exe_ctx.process->ReadMemory (addr, register_data.GetBytes(), register_byte_size, error) != register_byte_size)
+        Error read_error;
+        if (exe_ctx.process->ReadMemory (addr, register_data.GetBytes(), register_byte_size, read_error) != register_byte_size)
         {
-            err.SetErrorStringWithFormat ("Couldn't read %s from the target: %s", reg_info.name, error.AsCString());
+            err.SetErrorStringWithFormat ("Couldn't read %s from the target: %s", reg_info.name, read_error.AsCString());
             return false;
         }
         
@@ -1801,7 +1799,7 @@
     }
     Error err;
     
-    if (!var_location_expr.Evaluate(&exe_ctx, ast, NULL, loclist_base_load_addr, NULL, *var_location.get(), &err))
+    if (!var_location_expr.Evaluate(&exe_ctx, ast, NULL, NULL, NULL, loclist_base_load_addr, NULL, *var_location.get(), &err))
     {
         if (log)
             log->Printf("Error evaluating location: %s", err.AsCString());
diff --git a/source/Expression/DWARFExpression.cpp b/source/Expression/DWARFExpression.cpp
index 7114518..1679c8d 100644
--- a/source/Expression/DWARFExpression.cpp
+++ b/source/Expression/DWARFExpression.cpp
@@ -217,18 +217,14 @@
 DWARFExpression::DWARFExpression() :
     m_data(),
     m_reg_kind (eRegisterKindDWARF),
-    m_loclist_slide (LLDB_INVALID_ADDRESS),
-    m_expr_locals (NULL),
-    m_decl_map (NULL)
+    m_loclist_slide (LLDB_INVALID_ADDRESS)
 {
 }
 
 DWARFExpression::DWARFExpression(const DWARFExpression& rhs) :
     m_data(rhs.m_data),
     m_reg_kind (rhs.m_reg_kind),
-    m_loclist_slide(rhs.m_loclist_slide),
-    m_expr_locals (rhs.m_expr_locals),
-    m_decl_map (rhs.m_decl_map)
+    m_loclist_slide(rhs.m_loclist_slide)
 {
 }
 
@@ -236,9 +232,7 @@
 DWARFExpression::DWARFExpression(const DataExtractor& data, uint32_t data_offset, uint32_t data_length) :
     m_data(data, data_offset, data_length),
     m_reg_kind (eRegisterKindDWARF),
-    m_loclist_slide(LLDB_INVALID_ADDRESS),
-    m_expr_locals (NULL),
-    m_decl_map (NULL)
+    m_loclist_slide(LLDB_INVALID_ADDRESS)
 {
 }
 
@@ -256,19 +250,6 @@
     return m_data.GetByteSize() > 0;
 }
 
-
-void
-DWARFExpression::SetExpressionLocalVariableList (ClangExpressionVariableList *locals)
-{
-    m_expr_locals = locals;
-}
-
-void
-DWARFExpression::SetExpressionDeclMap (ClangExpressionDeclMap *decl_map)
-{
-    m_decl_map = decl_map;
-}
-
 void
 DWARFExpression::SetOpcodeData (const DataExtractor& data)
 {
@@ -749,6 +730,8 @@
 (
     ExecutionContextScope *exe_scope,
     clang::ASTContext *ast_context,
+    ClangExpressionVariableList *expr_locals,
+    ClangExpressionDeclMap *decl_map,
     lldb::addr_t loclist_base_load_addr,
     const Value* initial_value_ptr,
     Value& result,
@@ -756,7 +739,7 @@
 ) const
 {
     ExecutionContext exe_ctx (exe_scope);
-    return Evaluate(&exe_ctx, ast_context, NULL, loclist_base_load_addr, initial_value_ptr, result, error_ptr);
+    return Evaluate(&exe_ctx, ast_context, expr_locals, decl_map, NULL, loclist_base_load_addr, initial_value_ptr, result, error_ptr);
 }
 
 bool
@@ -764,6 +747,8 @@
 (
     ExecutionContext *exe_ctx,
     clang::ASTContext *ast_context,
+    ClangExpressionVariableList *expr_locals,
+    ClangExpressionDeclMap *decl_map,
     RegisterContext *reg_ctx,
     lldb::addr_t loclist_base_load_addr,
     const Value* initial_value_ptr,
@@ -809,7 +794,7 @@
 
                     if (length > 0 && lo_pc <= pc && pc < hi_pc)
                     {
-                        return DWARFExpression::Evaluate (exe_ctx, ast_context, m_data, m_expr_locals, m_decl_map, reg_ctx, offset, length, m_reg_kind, initial_value_ptr, result, error_ptr);
+                        return DWARFExpression::Evaluate (exe_ctx, ast_context, expr_locals, decl_map, reg_ctx, m_data, offset, length, m_reg_kind, initial_value_ptr, result, error_ptr);
                     }
                     offset += length;
                 }
@@ -821,7 +806,7 @@
     }
 
     // Not a location list, just a single expression.
-    return DWARFExpression::Evaluate (exe_ctx, ast_context, m_data, m_expr_locals, m_decl_map, reg_ctx, 0, m_data.GetByteSize(), m_reg_kind, initial_value_ptr, result, error_ptr);
+    return DWARFExpression::Evaluate (exe_ctx, ast_context, expr_locals, decl_map, reg_ctx, m_data, 0, m_data.GetByteSize(), m_reg_kind, initial_value_ptr, result, error_ptr);
 }
 
 
@@ -831,10 +816,10 @@
 (
     ExecutionContext *exe_ctx,
     clang::ASTContext *ast_context,
-    const DataExtractor& opcodes,
     ClangExpressionVariableList *expr_locals,
     ClangExpressionDeclMap *decl_map,
     RegisterContext *reg_ctx,
+    const DataExtractor& opcodes,
     const uint32_t opcodes_offset,
     const uint32_t opcodes_length,
     const uint32_t reg_kind,
diff --git a/source/Expression/IRDynamicChecks.cpp b/source/Expression/IRDynamicChecks.cpp
index a59ac64..e0284c7 100644
--- a/source/Expression/IRDynamicChecks.cpp
+++ b/source/Expression/IRDynamicChecks.cpp
@@ -127,6 +127,10 @@
     {
     }
     
+    virtual~Instrumenter ()
+    {
+    }
+
     //------------------------------------------------------------------
     /// Inspect a function to find instructions to instrument
     ///
@@ -287,12 +291,16 @@
 class ValidPointerChecker : public Instrumenter
 {
 public:
-    ValidPointerChecker(llvm::Module &module,
-                        DynamicCheckerFunctions &checker_functions) :
+    ValidPointerChecker (llvm::Module &module,
+                         DynamicCheckerFunctions &checker_functions) :
         Instrumenter(module, checker_functions),
         m_valid_pointer_check_func(NULL)
     {
     }
+    
+    virtual ~ValidPointerChecker ()
+    {
+    }
 private:
     bool InstrumentInstruction(llvm::Instruction *inst)
     {
@@ -356,6 +364,12 @@
         m_objc_object_check_func(NULL)
     {
     }
+    
+    virtual
+    ~ObjcObjectChecker ()
+    {
+    }
+
 private:
     bool InstrumentInstruction(llvm::Instruction *inst)
     {