Skip to content

Commit 24e9886

Browse files
committed
[lldb][NFC] Reduce scope of some variables in ClangExpressionDeclMap::FindExternalVisibleDecls
1 parent 161742a commit 24e9886

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionDeclMap.cpp

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1223,8 +1223,6 @@ void ClangExpressionDeclMap::FindExternalVisibleDecls(
12231223

12241224
Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_EXPRESSIONS));
12251225

1226-
SymbolContextList sc_list;
1227-
12281226
const ConstString name(context.m_decl_name.getAsString().c_str());
12291227
if (IgnoreName(name, false))
12301228
return;
@@ -1288,8 +1286,6 @@ void ClangExpressionDeclMap::FindExternalVisibleDecls(
12881286
}
12891287
return;
12901288
}
1291-
ValueObjectSP valobj;
1292-
VariableSP var;
12931289

12941290
bool local_var_lookup =
12951291
!namespace_decl || (namespace_decl.GetName() ==
@@ -1299,6 +1295,8 @@ void ClangExpressionDeclMap::FindExternalVisibleDecls(
12991295
return;
13001296

13011297
if (target) {
1298+
ValueObjectSP valobj;
1299+
VariableSP var;
13021300
var = FindGlobalVariable(*target, module_sp, name, &namespace_decl,
13031301
nullptr);
13041302

@@ -1320,7 +1318,7 @@ void ClangExpressionDeclMap::FindExternalVisibleDecls(
13201318
}
13211319

13221320
const bool include_inlines = false;
1323-
sc_list.Clear();
1321+
SymbolContextList sc_list;
13241322
if (namespace_decl && module_sp) {
13251323
const bool include_symbols = false;
13261324

0 commit comments

Comments
 (0)