[Lldb-commits] [lldb] r186337 - Actually use the return value we get back when

Sean Callanan scallanan at apple.com
Mon Jul 15 11:43:37 PDT 2013


Author: spyffe
Date: Mon Jul 15 13:43:36 2013
New Revision: 186337

URL: http://llvm.org/viewvc/llvm-project?rev=186337&view=rev
Log:
Actually use the return value we get back when
creating a persistent variable, rather than making
a (potentially expensive) lookup by name.

<rdar://problem/14337653>

Modified:
    lldb/trunk/source/Expression/ClangExpressionDeclMap.cpp

Modified: lldb/trunk/source/Expression/ClangExpressionDeclMap.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Expression/ClangExpressionDeclMap.cpp?rev=186337&r1=186336&r2=186337&view=diff
==============================================================================
--- lldb/trunk/source/Expression/ClangExpressionDeclMap.cpp (original)
+++ lldb/trunk/source/Expression/ClangExpressionDeclMap.cpp Mon Jul 15 13:43:36 2013
@@ -204,13 +204,11 @@ ClangExpressionDeclMap::AddPersistentVar
         
         uint32_t offset = m_parser_vars->m_materializer->AddResultVariable(user_type, is_lvalue, m_keep_result_in_memory, err);
         
-        m_found_entities.CreateVariable(exe_ctx.GetBestExecutionContextScope(),
-                                        name,
-                                        user_type,
-                                        m_parser_vars->m_target_info.byte_order,
-                                        m_parser_vars->m_target_info.address_byte_size);
-        
-        ClangExpressionVariableSP var_sp (m_found_entities.GetVariable(name));
+        ClangExpressionVariableSP var_sp = m_found_entities.CreateVariable(exe_ctx.GetBestExecutionContextScope(),
+                                                                           name,
+                                                                           user_type,
+                                                                           m_parser_vars->m_target_info.byte_order,
+                                                                           m_parser_vars->m_target_info.address_byte_size);
         
         if (!var_sp)
             return false;
@@ -254,14 +252,11 @@ ClangExpressionDeclMap::AddPersistentVar
     if (!m_parser_vars->m_target_info.IsValid())
         return false;
     
-    if (!m_parser_vars->m_persistent_vars->CreatePersistentVariable (exe_ctx.GetBestExecutionContextScope (),
-                                                                     name, 
-                                                                     user_type, 
-                                                                     m_parser_vars->m_target_info.byte_order,
-                                                                     m_parser_vars->m_target_info.address_byte_size))
-        return false;
-    
-    ClangExpressionVariableSP var_sp (m_parser_vars->m_persistent_vars->GetVariable(name));
+    ClangExpressionVariableSP var_sp = m_parser_vars->m_persistent_vars->CreatePersistentVariable (exe_ctx.GetBestExecutionContextScope (),
+                                                                                                   name,
+                                                                                                   user_type,
+                                                                                                   m_parser_vars->m_target_info.byte_order,
+                                                                                                   m_parser_vars->m_target_info.address_byte_size);
     
     if (!var_sp)
         return false;





More information about the lldb-commits mailing list