diff options
author | Sean Callanan <scallanan@apple.com> | 2013-07-15 18:43:36 +0000 |
---|---|---|
committer | Sean Callanan <scallanan@apple.com> | 2013-07-15 18:43:36 +0000 |
commit | f35bbbcd87835f20ee4d861213454f69d85f46c4 (patch) | |
tree | 0dafc04c78daf918c9ce5fee7d4be5d84e96128a /lldb/source/Expression/ClangExpressionDeclMap.cpp | |
parent | 341a2b4b5d1c3c7cc709cad45b6e2803525015cd (diff) | |
download | bcm5719-llvm-f35bbbcd87835f20ee4d861213454f69d85f46c4.tar.gz bcm5719-llvm-f35bbbcd87835f20ee4d861213454f69d85f46c4.zip |
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>
llvm-svn: 186337
Diffstat (limited to 'lldb/source/Expression/ClangExpressionDeclMap.cpp')
-rw-r--r-- | lldb/source/Expression/ClangExpressionDeclMap.cpp | 25 |
1 files changed, 10 insertions, 15 deletions
diff --git a/lldb/source/Expression/ClangExpressionDeclMap.cpp b/lldb/source/Expression/ClangExpressionDeclMap.cpp index 26dd5e725f4..3d224863e45 100644 --- a/lldb/source/Expression/ClangExpressionDeclMap.cpp +++ b/lldb/source/Expression/ClangExpressionDeclMap.cpp @@ -204,13 +204,11 @@ ClangExpressionDeclMap::AddPersistentVariable 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::AddPersistentVariable 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; |