[Lldb-commits] [lldb] r121952 - in /lldb/trunk: include/lldb/Expression/ClangExpressionDeclMap.h include/lldb/Expression/ClangExpressionParser.h include/lldb/Expression/ClangUserExpression.h include/lldb/Expression/IRForTarget.h include/lldb/Expression/RecordingMemoryManager.h source/Expression/ClangExpressionDeclMap.cpp source/Expression/ClangExpressionParser.cpp source/Expression/ClangUserExpression.cpp source/Expression/IRForTarget.cpp

Sean Callanan scallanan at apple.com
Wed Dec 15 19:17:46 PST 2010


Author: spyffe
Date: Wed Dec 15 21:17:46 2010
New Revision: 121952

URL: http://llvm.org/viewvc/llvm-project?rev=121952&view=rev
Log:
Implemented a feature where the expression parser
can avoid running the code in the target if the
expression's result is known and the expression
has no side effects.

Right now this feature is quite conservative in
its guess about side effects, and it only computes
integer results, but the machinery to make it more
sophisticated is there.

Modified:
    lldb/trunk/include/lldb/Expression/ClangExpressionDeclMap.h
    lldb/trunk/include/lldb/Expression/ClangExpressionParser.h
    lldb/trunk/include/lldb/Expression/ClangUserExpression.h
    lldb/trunk/include/lldb/Expression/IRForTarget.h
    lldb/trunk/include/lldb/Expression/RecordingMemoryManager.h
    lldb/trunk/source/Expression/ClangExpressionDeclMap.cpp
    lldb/trunk/source/Expression/ClangExpressionParser.cpp
    lldb/trunk/source/Expression/ClangUserExpression.cpp
    lldb/trunk/source/Expression/IRForTarget.cpp

Modified: lldb/trunk/include/lldb/Expression/ClangExpressionDeclMap.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Expression/ClangExpressionDeclMap.h?rev=121952&r1=121951&r2=121952&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Expression/ClangExpressionDeclMap.h (original)
+++ lldb/trunk/include/lldb/Expression/ClangExpressionDeclMap.h Wed Dec 15 21:17:46 2010
@@ -110,6 +110,28 @@
                   const ClangNamespaceDecl &namespace_decl);
 
     //------------------------------------------------------------------
+    /// [Used by IRForTarget] Get a constant variable given a name,
+    ///     a type, and an llvm::APInt.
+    ///
+    /// @param[in] name
+    ///     The name of the variable
+    ///
+    /// @param[in] type
+    ///     The type of the variable, which will be imported into the
+    ///     target's AST context
+    ///
+    /// @param[in] value
+    ///     The value of the variable
+    ///
+    /// @return
+    ///     The created variable
+    //------------------------------------------------------------------
+    lldb::ClangExpressionVariableSP
+    BuildIntegerVariable (const ConstString &name,
+                          lldb_private::TypeFromParser type,
+                          const llvm::APInt& value);
+    
+    //------------------------------------------------------------------
     /// [Used by IRForTarget] Add a variable to the list of persistent
     ///     variables for the process.
     ///

Modified: lldb/trunk/include/lldb/Expression/ClangExpressionParser.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Expression/ClangExpressionParser.h?rev=121952&r1=121951&r2=121952&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Expression/ClangExpressionParser.h (original)
+++ lldb/trunk/include/lldb/Expression/ClangExpressionParser.h Wed Dec 15 21:17:46 2010
@@ -101,6 +101,11 @@
     /// @param[in] exe_ctx
     ///     The execution context to write the function into.
     ///
+    /// @param[out] const_result
+    ///     If non-NULL, the result of the expression is constant, and the
+    ///     expression has no side effects, this is set to the result of the 
+    ///     expression.  
+    ///
     /// @return
     ///     An error code indicating the success or failure of the operation.
     ///     Test with Success().
@@ -108,7 +113,8 @@
     Error
     MakeJIT (lldb::addr_t &func_addr,
              lldb::addr_t &func_end,
-             ExecutionContext &exe_ctx);
+             ExecutionContext &exe_ctx,
+             lldb::ClangExpressionVariableSP *const_result = NULL);
     
     //------------------------------------------------------------------
     /// Disassemble the machine code for a JITted function from the target 
@@ -120,10 +126,6 @@
     /// @param[in] exc_context
     ///     The execution context to get the machine code from.
     ///
-    /// @param[in] func_name
-    ///     The name of the function to be disassembled.  By default, the
-    ///     function wrapped by ParseExpression().
-    ///
     /// @return
     ///     The error generated.  If .Success() is true, disassembly succeeded.
     //------------------------------------------------------------------

Modified: lldb/trunk/include/lldb/Expression/ClangUserExpression.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Expression/ClangUserExpression.h?rev=121952&r1=121951&r2=121952&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Expression/ClangUserExpression.h (original)
+++ lldb/trunk/include/lldb/Expression/ClangUserExpression.h Wed Dec 15 21:17:46 2010
@@ -81,13 +81,19 @@
     ///     The type that the expression should be coerced to.  If NULL,
     ///     inferred from the expression itself.
     ///
+    /// @param[out] const_result
+    ///     If this is non-NULL, the expression has no side effects, and 
+    ///     the expression returns a constant result, then that result 
+    ///     is put into this variable.
+    ///
     /// @return
     ///     True on success (no errors); false otherwise.
     //------------------------------------------------------------------
     bool
     Parse (Stream &error_stream, 
            ExecutionContext &exe_ctx,
-           TypeFromUser desired_type);
+           TypeFromUser desired_type,
+           lldb::ClangExpressionVariableSP *const_result = NULL);
     
     //------------------------------------------------------------------
     /// Execute the parsed expression

Modified: lldb/trunk/include/lldb/Expression/IRForTarget.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Expression/IRForTarget.h?rev=121952&r1=121951&r2=121952&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Expression/IRForTarget.h (original)
+++ lldb/trunk/include/lldb/Expression/IRForTarget.h Wed Dec 15 21:17:46 2010
@@ -10,6 +10,9 @@
 #ifndef liblldb_IRForTarget_h_
 #define liblldb_IRForTarget_h_
 
+#include "lldb/lldb-include.h"
+#include "lldb/Core/ConstString.h"
+#include "lldb/Symbol/TaggedASTType.h"
 #include "llvm/Pass.h"
 
 namespace llvm {
@@ -62,6 +65,7 @@
     //------------------------------------------------------------------
     IRForTarget(lldb_private::ClangExpressionDeclMap *decl_map,
                 bool resolve_vars,
+                lldb::ClangExpressionVariableSP *const_result,
                 const char* func_name = "$__lldb_expr");
     
     //------------------------------------------------------------------
@@ -106,11 +110,55 @@
 
 private:
     //------------------------------------------------------------------
+    /// A function-level pass to check whether the function has side
+    /// effects.
+    //------------------------------------------------------------------
+    
+    //------------------------------------------------------------------
+    /// The top-level pass implementation
+    ///
+    /// @param[in] llvm_module
+    ///     The module currently being processed.
+    ///
+    /// @param[in] llvm_function
+    ///     The function currently being processed.
+    ///
+    /// @return
+    ///     True if the function has side effects (or if this cannot
+    ///     be determined); false otherwise.
+    //------------------------------------------------------------------
+    bool 
+    HasSideEffects (llvm::Module &llvm_module,
+                    llvm::Function &llvm_function);
+    
+    //------------------------------------------------------------------
     /// A function-level pass to take the generated global value
     /// $__lldb_expr_result and make it into a persistent variable.
     /// Also see ASTResultSynthesizer.
     //------------------------------------------------------------------
-
+    
+    //------------------------------------------------------------------
+    /// Set the constant result variable m_const_result to the provided
+    /// constant, assuming it can be evaluated.  The result variable
+    /// will be reset to NULL later if the expression has side effects.
+    ///
+    /// @param[in] initializer
+    ///     The constant initializer for the variable.
+    ///
+    /// @param[in] name
+    ///     The name of the result variable.
+    ///
+    /// @param[in] type
+    ///     The Clang type of the result variable.
+    ///
+    /// @return
+    ///     True on success; false otherwise
+    //------------------------------------------------------------------    
+    void 
+    MaybeSetConstantResult (llvm::Constant *initializer,
+                            const lldb_private::ConstString &name,
+                            lldb_private::TypeFromParser type);
+    
     //------------------------------------------------------------------
     /// The top-level pass implementation
     ///
@@ -403,6 +451,9 @@
     lldb_private::ClangExpressionDeclMap   *m_decl_map;                 ///< The DeclMap containing the Decls 
     llvm::Constant                         *m_CFStringCreateWithBytes;  ///< The address of the function CFStringCreateWithBytes, cast to the appropriate function pointer type
     llvm::Constant                         *m_sel_registerName;         ///< The address of the function sel_registerName, cast to the appropriate function pointer type
+    lldb::ClangExpressionVariableSP        *m_const_result;             ///< If non-NULL, this value should be set to the return value of the expression if it is constant and the expression has no side effects
+    
+    bool                                    m_has_side_effects;         ///< True if the function's result cannot be simply determined statically
     
 private:
     //------------------------------------------------------------------

Modified: lldb/trunk/include/lldb/Expression/RecordingMemoryManager.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Expression/RecordingMemoryManager.h?rev=121952&r1=121951&r2=121952&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Expression/RecordingMemoryManager.h (original)
+++ lldb/trunk/include/lldb/Expression/RecordingMemoryManager.h Wed Dec 15 21:17:46 2010
@@ -54,7 +54,8 @@
 {
 friend Error ClangExpressionParser::MakeJIT (uint64_t &, 
                                              uint64_t&, 
-                                             ExecutionContext &);
+                                             ExecutionContext &,
+                                             lldb::ClangExpressionVariableSP *);
 
 public:
     //------------------------------------------------------------------

Modified: lldb/trunk/source/Expression/ClangExpressionDeclMap.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Expression/ClangExpressionDeclMap.cpp?rev=121952&r1=121951&r2=121952&view=diff
==============================================================================
--- lldb/trunk/source/Expression/ClangExpressionDeclMap.cpp (original)
+++ lldb/trunk/source/Expression/ClangExpressionDeclMap.cpp Wed Dec 15 21:17:46 2010
@@ -20,6 +20,7 @@
 #include "lldb/Core/Error.h"
 #include "lldb/Core/Log.h"
 #include "lldb/Core/Module.h"
+#include "lldb/Core/ValueObjectConstResult.h"
 #include "lldb/Expression/ClangASTSource.h"
 #include "lldb/Expression/ClangPersistentVariables.h"
 #include "lldb/Symbol/ClangASTContext.h"
@@ -121,6 +122,78 @@
     return m_struct_vars->m_result_name;
 }
 
+lldb::ClangExpressionVariableSP
+ClangExpressionDeclMap::BuildIntegerVariable (const ConstString &name,
+                                              lldb_private::TypeFromParser type,
+                                              const llvm::APInt& value)
+{
+    assert (m_parser_vars.get());
+
+    
+    clang::ASTContext *context(m_parser_vars->m_exe_ctx->target->GetScratchClangASTContext()->getASTContext());
+    
+    TypeFromUser user_type(ClangASTContext::CopyType(context, 
+                                                     type.GetASTContext(),
+                                                     type.GetOpaqueQualType()),
+                           context);
+    
+    DataBufferHeap *heap_data_buf = new DataBufferHeap(ClangASTType::GetClangTypeBitWidth(user_type.GetASTContext(),
+                                                                                          user_type.GetOpaqueQualType()) / 8,
+                                                       '\0');
+    
+    DataBufferSP data_sp(heap_data_buf);
+    
+    uint64_t value64 = value.getLimitedValue();
+    
+    ByteOrder byte_order = m_parser_vars->m_exe_ctx->process->GetByteOrder();
+    
+    size_t num_val_bytes = sizeof(value64);
+    size_t num_data_bytes = heap_data_buf->GetByteSize();
+    
+    size_t num_bytes = num_val_bytes;
+    if (num_bytes > num_data_bytes)
+        num_bytes = num_data_bytes;
+    
+    uint8_t *data_bytes = heap_data_buf->GetBytes();
+    
+    for (off_t byte_idx = 0;
+         byte_idx < num_bytes;
+         ++byte_idx)
+    {
+        uint64_t shift = byte_idx * 8;
+        uint64_t mask = 0xffll << shift;
+        uint8_t cur_byte = (uint8_t)((value64 & mask) >> shift);
+        
+        switch (byte_order)
+        {
+        case eByteOrderBig:
+            //                    High         Low
+            // Original:         |AABBCCDDEEFFGGHH|
+            // Target:                   |EEFFGGHH|
+            
+            data_bytes[num_data_bytes - (1 + byte_idx)] = cur_byte;
+            break;
+        case eByteOrderLittle:
+            // Target:                   |HHGGFFEE|
+            data_bytes[byte_idx] = cur_byte;
+            break;
+        default:
+            return lldb::ClangExpressionVariableSP();    
+        }
+    }
+    
+    ValueObjectSP valobj_sp(new ValueObjectConstResult(user_type.GetASTContext(),
+                                                       user_type.GetOpaqueQualType(),
+                                                       name,
+                                                       data_sp,
+                                                       m_parser_vars->m_exe_ctx->process->GetByteOrder(), 
+                                                       m_parser_vars->m_exe_ctx->process->GetAddressByteSize()));
+    
+    ClangExpressionVariableSP var_sp(new ClangExpressionVariable(valobj_sp));
+    
+    return var_sp;
+}
+
 bool 
 ClangExpressionDeclMap::AddPersistentVariable 
 (

Modified: lldb/trunk/source/Expression/ClangExpressionParser.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Expression/ClangExpressionParser.cpp?rev=121952&r1=121951&r2=121952&view=diff
==============================================================================
--- lldb/trunk/source/Expression/ClangExpressionParser.cpp (original)
+++ lldb/trunk/source/Expression/ClangExpressionParser.cpp Wed Dec 15 21:17:46 2010
@@ -409,7 +409,8 @@
 Error
 ClangExpressionParser::MakeJIT (lldb::addr_t &func_addr, 
                                 lldb::addr_t &func_end, 
-                                ExecutionContext &exe_ctx)
+                                ExecutionContext &exe_ctx,
+                                lldb::ClangExpressionVariableSP *const_result)
 {
     lldb::LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_EXPRESSIONS));
 
@@ -446,6 +447,7 @@
     {
         IRForTarget ir_for_target(decl_map, 
                                   m_expr.NeedsVariableResolution(),
+                                  const_result,
                                   function_name.c_str());
         
         if (!ir_for_target.runOnModule(*module))

Modified: lldb/trunk/source/Expression/ClangUserExpression.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Expression/ClangUserExpression.cpp?rev=121952&r1=121951&r2=121952&view=diff
==============================================================================
--- lldb/trunk/source/Expression/ClangUserExpression.cpp (original)
+++ lldb/trunk/source/Expression/ClangUserExpression.cpp Wed Dec 15 21:17:46 2010
@@ -22,10 +22,11 @@
 #include "lldb/Core/Log.h"
 #include "lldb/Core/StreamString.h"
 #include "lldb/Core/ValueObjectConstResult.h"
+#include "lldb/Expression/ASTSplitConsumer.h"
+#include "lldb/Expression/ASTResultSynthesizer.h"
 #include "lldb/Expression/ClangExpressionDeclMap.h"
 #include "lldb/Expression/ClangExpressionParser.h"
 #include "lldb/Expression/ClangFunction.h"
-#include "lldb/Expression/ASTResultSynthesizer.h"
 #include "lldb/Expression/ClangUserExpression.h"
 #include "lldb/Host/Host.h"
 #include "lldb/Symbol/VariableList.h"
@@ -143,7 +144,8 @@
 bool
 ClangUserExpression::Parse (Stream &error_stream, 
                             ExecutionContext &exe_ctx,
-                            TypeFromUser desired_type)
+                            TypeFromUser desired_type,
+                            lldb::ClangExpressionVariableSP *const_result)
 {
     lldb::LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_EXPRESSIONS));
     
@@ -292,8 +294,8 @@
     m_dwarf_opcodes.reset();
     
     lldb::addr_t jit_end;
-    
-    Error jit_error = parser.MakeJIT (m_jit_addr, jit_end, exe_ctx);
+        
+    Error jit_error = parser.MakeJIT (m_jit_addr, jit_end, exe_ctx, const_result);
     
     m_expr_decl_map->DidParse();
     
@@ -601,10 +603,12 @@
 
     StreamString error_stream;
     
+    lldb::ClangExpressionVariableSP const_result;
+    
     if (log)
         log->Printf("== [ClangUserExpression::Evaluate] Parsing expression %s ==", expr_cstr);
     
-    if (!user_expression_sp->Parse (error_stream, exe_ctx, TypeFromUser(NULL, NULL)))
+    if (!user_expression_sp->Parse (error_stream, exe_ctx, TypeFromUser(NULL, NULL), &const_result))
     {
         if (error_stream.GetString().empty())
             error.SetErrorString ("expression failed to parse, unknown error");
@@ -615,41 +619,52 @@
     {
         lldb::ClangExpressionVariableSP expr_result;
 
-        error_stream.GetString().clear();
-        
-        if (log)
-            log->Printf("== [ClangUserExpression::Evaluate] Executing expression ==");
-
-        execution_results = user_expression_sp->Execute (error_stream, 
-                                                         exe_ctx, 
-                                                         discard_on_error, 
-                                                         user_expression_sp, 
-                                                         expr_result);
-        if (execution_results != lldb::eExecutionCompleted)
+        if (const_result.get())
         {
             if (log)
-                log->Printf("== [ClangUserExpression::Evaluate] Execution completed abnormally ==");
+                log->Printf("== [ClangUserExpression::Evaluate] Expression evaluated as a constant ==");
             
-            if (error_stream.GetString().empty())
-                error.SetErrorString ("expression failed to execute, unknown error");
-            else
-                error.SetErrorString (error_stream.GetString().c_str());
+            result_valobj_sp = const_result->GetValueObject();
         }
-        else 
-        {
-            if (expr_result)
+        else
+        {    
+            error_stream.GetString().clear();
+            
+            if (log)
+                log->Printf("== [ClangUserExpression::Evaluate] Executing expression ==");
+
+            execution_results = user_expression_sp->Execute (error_stream, 
+                                                             exe_ctx, 
+                                                             discard_on_error, 
+                                                             user_expression_sp, 
+                                                             expr_result);
+            
+            if (execution_results != lldb::eExecutionCompleted)
             {
-                result_valobj_sp = expr_result->GetValueObject();
-                
                 if (log)
-                    log->Printf("== [ClangUserExpression::Evaluate] Execution completed normally with result %s ==", result_valobj_sp->GetValueAsCString(exe_ctx.GetBestExecutionContextScope()));
+                    log->Printf("== [ClangUserExpression::Evaluate] Execution completed abnormally ==");
+                
+                if (error_stream.GetString().empty())
+                    error.SetErrorString ("expression failed to execute, unknown error");
+                else
+                    error.SetErrorString (error_stream.GetString().c_str());
             }
-            else
+            else 
             {
-                if (log)
-                    log->Printf("== [ClangUserExpression::Evaluate] Execution completed normally with no result ==");
-                
-                error.SetErrorString ("Expression did not return a result");
+                if (expr_result)
+                {
+                    result_valobj_sp = expr_result->GetValueObject();
+                    
+                    if (log)
+                        log->Printf("== [ClangUserExpression::Evaluate] Execution completed normally with result %s ==", result_valobj_sp->GetValueAsCString(exe_ctx.GetBestExecutionContextScope()));
+                }
+                else
+                {
+                    if (log)
+                        log->Printf("== [ClangUserExpression::Evaluate] Execution completed normally with no result ==");
+                    
+                    error.SetErrorString ("Expression did not return a result");
+                }
             }
         }
     }

Modified: lldb/trunk/source/Expression/IRForTarget.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Expression/IRForTarget.cpp?rev=121952&r1=121951&r2=121952&view=diff
==============================================================================
--- lldb/trunk/source/Expression/IRForTarget.cpp (original)
+++ lldb/trunk/source/Expression/IRForTarget.cpp Wed Dec 15 21:17:46 2010
@@ -34,13 +34,16 @@
 
 IRForTarget::IRForTarget (lldb_private::ClangExpressionDeclMap *decl_map,
                           bool resolve_vars,
+                          lldb::ClangExpressionVariableSP *const_result,
                           const char *func_name) :
     ModulePass(ID),
     m_decl_map(decl_map),
     m_CFStringCreateWithBytes(NULL),
     m_sel_registerName(NULL),
     m_func_name(func_name),
-    m_resolve_vars(resolve_vars)
+    m_resolve_vars(resolve_vars),
+    m_const_result(const_result),
+    m_has_side_effects(NULL)
 {
 }
 
@@ -75,6 +78,64 @@
 }
 
 bool 
+IRForTarget::HasSideEffects (llvm::Module &llvm_module,
+                             llvm::Function &llvm_function)
+{
+    llvm::Function::iterator bbi;
+    BasicBlock::iterator ii;
+    
+    for (bbi = llvm_function.begin();
+         bbi != llvm_function.end();
+         ++bbi)
+    {
+        BasicBlock &basic_block = *bbi;
+        
+        for (ii = basic_block.begin();
+             ii != basic_block.end();
+             ++ii)
+        {      
+            switch (ii->getOpcode())
+            {
+            default:
+                return true;
+            case Instruction::Store:
+                {
+                    StoreInst *store_inst = dyn_cast<StoreInst>(ii);
+                    
+                    Value *store_ptr = store_inst->getPointerOperand();
+                    
+                    if (!isa <AllocaInst> (store_ptr))
+                        return true;
+                    else
+                        break;
+                }
+            case Instruction::Load:
+            case Instruction::Alloca:
+            case Instruction::GetElementPtr:
+            case Instruction::Ret:
+                break;
+            }
+        }
+    }
+    
+    return false;
+}
+
+void 
+IRForTarget::MaybeSetConstantResult (llvm::Constant *initializer,
+                                     const lldb_private::ConstString &name,
+                                     lldb_private::TypeFromParser type)
+{
+    if (!m_const_result)
+        return;
+    
+    if (llvm::ConstantInt *init_int = dyn_cast<llvm::ConstantInt>(initializer))
+    {
+        *m_const_result = m_decl_map->BuildIntegerVariable(name, type, init_int->getValue());
+    }
+}
+
+bool 
 IRForTarget::CreateResultVariable (llvm::Module &llvm_module, llvm::Function &llvm_function)
 {
     lldb::LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_EXPRESSIONS));
@@ -239,6 +300,16 @@
         }
         
         Constant *initializer = result_global->getInitializer();
+        
+        // Here we write the initializer into a result variable assuming it
+        // can be computed statically.
+        
+        if (!m_has_side_effects)
+        {
+            MaybeSetConstantResult (initializer, 
+                                    new_result_name, 
+                                    result_decl_type);
+        }
                 
         StoreInst *synthesized_store = new StoreInst::StoreInst(initializer,
                                                                 new_result_global,
@@ -1442,6 +1513,8 @@
         
     Function::iterator bbi;
     
+    m_has_side_effects = HasSideEffects(llvm_module, *function);
+    
     ////////////////////////////////////////////////////////////
     // Replace $__lldb_expr_result with a persistent variable
     //
@@ -1456,19 +1529,7 @@
     ///////////////////////////////////////////////////////////////////////////////
     // Fix all Objective-C constant strings to use NSStringWithCString:encoding:
     //
-    
-    if (log)
-    {
-        std::string s;
-        raw_string_ostream oss(s);
-        
-        llvm_module.print(oss, NULL);
-        
-        oss.flush();
         
-        log->Printf("Module after creating the result variable: \n\"%s\"", s.c_str());
-    }
-    
     if (!RewriteObjCConstStrings(llvm_module, *function))
     {
         if (log)
@@ -1476,18 +1537,6 @@
         return false;
     }
     
-    if (log)
-    {
-        std::string s;
-        raw_string_ostream oss(s);
-        
-        llvm_module.print(oss, NULL);
-        
-        oss.flush();
-        
-        log->Printf("Module after rewriting Objective-C const strings: \n\"%s\"", s.c_str());
-    }
-    
     //////////////////////////////////
     // Run basic-block level passes
     //





More information about the lldb-commits mailing list